Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_title_link.inc | ||
---|---|---|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
9 |
* Field handler that turns an item's title into a clickable link to the original
|
|
10 |
* source article. |
|
9 |
* Field handler that turns an item's title into a clickable link to the |
|
10 |
* original source article.
|
|
11 | 11 |
* |
12 | 12 |
* @ingroup views_field_handlers |
13 | 13 |
*/ |
14 | 14 |
class views_handler_field_aggregator_title_link extends views_handler_field { |
15 |
function construct() { |
|
15 |
|
|
16 |
/** |
|
17 |
* {@inheritdoc} |
|
18 |
*/ |
|
19 |
public function construct() { |
|
16 | 20 |
parent::construct(); |
17 | 21 |
$this->additional_fields['link'] = 'link'; |
18 | 22 |
} |
19 | 23 |
|
20 |
function option_definition() { |
|
24 |
/** |
|
25 |
* {@inheritdoc} |
|
26 |
*/ |
|
27 |
public function option_definition() { |
|
21 | 28 |
$options = parent::option_definition(); |
22 | 29 |
|
23 | 30 |
$options['display_as_link'] = array('default' => TRUE, 'bool' => TRUE); |
... | ... | |
28 | 35 |
/** |
29 | 36 |
* Provide link to the page being visited. |
30 | 37 |
*/ |
31 |
function options_form(&$form, &$form_state) { |
|
38 |
public function options_form(&$form, &$form_state) {
|
|
32 | 39 |
$form['display_as_link'] = array( |
33 | 40 |
'#title' => t('Display as link'), |
34 | 41 |
'#type' => 'checkbox', |
... | ... | |
37 | 44 |
parent::options_form($form, $form_state); |
38 | 45 |
} |
39 | 46 |
|
40 |
function render($values) { |
|
47 |
/** |
|
48 |
* {@inheritdoc} |
|
49 |
*/ |
|
50 |
public function render($values) { |
|
41 | 51 |
$value = $this->get_value($values); |
42 | 52 |
return $this->render_link($this->sanitize_value($value), $values); |
43 | 53 |
} |
44 | 54 |
|
45 |
function render_link($data, $values) { |
|
55 |
/** |
|
56 |
* {@inheritdoc} |
|
57 |
*/ |
|
58 |
public function render_link($data, $values) { |
|
46 | 59 |
$link = $this->get_value($values, 'link'); |
47 | 60 |
if (!empty($this->options['display_as_link'])) { |
48 | 61 |
$this->options['alter']['make_link'] = TRUE; |
... | ... | |
52 | 65 |
|
53 | 66 |
return $data; |
54 | 67 |
} |
68 |
|
|
55 | 69 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules