Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/contact/views_handler_field_contact_link.inc | ||
---|---|---|
12 | 12 |
*/ |
13 | 13 |
class views_handler_field_contact_link extends views_handler_field_user_link { |
14 | 14 |
|
15 |
function options_form(&$form, &$form_state) { |
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function options_form(&$form, &$form_state) { |
|
16 | 19 |
$form['text']['#title'] = t('Link label'); |
17 | 20 |
$form['text']['#required'] = TRUE; |
18 | 21 |
$form['text']['#default_value'] = empty($this->options['text']) ? t('contact') : $this->options['text']; |
19 | 22 |
parent::options_form($form, $form_state); |
20 | 23 |
} |
21 | 24 |
|
22 |
// An example of field level access control. |
|
23 |
// We must override the access method in the parent class, as that requires |
|
24 |
// the 'access user profiles' permission, which the contact form does not. |
|
25 |
function access() { |
|
25 |
/** |
|
26 |
* An example of field level access control. |
|
27 |
* |
|
28 |
* We must override the access method in the parent class, as that requires |
|
29 |
* the 'access user profiles' permission, which the contact form does not. |
|
30 |
*/ |
|
31 |
public function access() { |
|
26 | 32 |
return user_access('access user contact forms'); |
27 | 33 |
} |
28 | 34 |
|
29 |
function render_link($data, $values) { |
|
35 |
/** |
|
36 |
* {@inheritdoc} |
|
37 |
*/ |
|
38 |
public function render_link($data, $values) { |
|
30 | 39 |
global $user; |
31 | 40 |
$uid = $this->get_value($values, 'uid'); |
32 | 41 |
|
... | ... | |
54 | 63 |
|
55 | 64 |
return $text; |
56 | 65 |
} |
66 |
|
|
57 | 67 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules