Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/node/views_handler_field_node_revision.inc | ||
---|---|---|
7 | 7 |
|
8 | 8 |
/** |
9 | 9 |
* Contains the basic 'node_revision' field handler. |
10 |
*/ |
|
11 |
|
|
12 |
/** |
|
13 |
* A basic node_revision handler. |
|
14 | 10 |
* |
15 | 11 |
* @ingroup views_field_handlers |
16 | 12 |
*/ |
17 | 13 |
class views_handler_field_node_revision extends views_handler_field_node { |
18 |
function init(&$view, &$options) { |
|
14 |
|
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function init(&$view, &$options) { |
|
19 | 19 |
parent::init($view, $options); |
20 | 20 |
if (!empty($this->options['link_to_node_revision'])) { |
21 | 21 |
$this->additional_fields['vid'] = 'vid'; |
... | ... | |
25 | 25 |
} |
26 | 26 |
} |
27 | 27 |
} |
28 |
function option_definition() { |
|
28 |
|
|
29 |
/** |
|
30 |
* {@inheritdoc} |
|
31 |
*/ |
|
32 |
public function option_definition() { |
|
29 | 33 |
$options = parent::option_definition(); |
30 | 34 |
$options['link_to_node_revision'] = array('default' => FALSE, 'bool' => TRUE); |
31 | 35 |
return $options; |
... | ... | |
34 | 38 |
/** |
35 | 39 |
* Provide link to revision option. |
36 | 40 |
*/ |
37 |
function options_form(&$form, &$form_state) { |
|
41 |
public function options_form(&$form, &$form_state) {
|
|
38 | 42 |
$form['link_to_node_revision'] = array( |
39 | 43 |
'#title' => t('Link this field to its content revision'), |
40 | 44 |
'#description' => t('This will override any other link you have set.'), |
... | ... | |
49 | 53 |
* |
50 | 54 |
* Data should be made XSS safe prior to calling this function. |
51 | 55 |
*/ |
52 |
function render_link($data, $values) { |
|
56 |
public function render_link($data, $values) {
|
|
53 | 57 |
if (!empty($this->options['link_to_node_revision']) && $data !== NULL && $data !== '') { |
54 | 58 |
$this->options['alter']['make_link'] = TRUE; |
55 | 59 |
$nid = $this->get_value($values, 'nid'); |
... | ... | |
71 | 75 |
} |
72 | 76 |
return $data; |
73 | 77 |
} |
78 |
|
|
74 | 79 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules