Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/locale/views_handler_field_node_language.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Definition of views_handler_field_node_language.
|
|
5 |
* Contains .
|
|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
... | ... | |
11 | 11 |
* @ingroup views_field_handlers |
12 | 12 |
*/ |
13 | 13 |
class views_handler_field_node_language extends views_handler_field_node { |
14 |
function option_definition() { |
|
14 |
|
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function option_definition() { |
|
15 | 19 |
$options = parent::option_definition(); |
16 | 20 |
$options['native_language'] = array('default' => FALSE, 'bool' => TRUE); |
17 | 21 |
|
18 | 22 |
return $options; |
19 | 23 |
} |
20 | 24 |
|
21 |
function options_form(&$form, &$form_state) { |
|
25 |
/** |
|
26 |
* {@inheritdoc} |
|
27 |
*/ |
|
28 |
public function options_form(&$form, &$form_state) { |
|
22 | 29 |
parent::options_form($form, $form_state); |
23 | 30 |
$form['native_language'] = array( |
24 | 31 |
'#title' => t('Native language'), |
... | ... | |
28 | 35 |
); |
29 | 36 |
} |
30 | 37 |
|
31 |
function render($values) { |
|
38 |
/** |
|
39 |
* {@inheritdoc} |
|
40 |
*/ |
|
41 |
public function render($values) { |
|
32 | 42 |
$languages = views_language_list(empty($this->options['native_language']) ? 'name' : 'native'); |
33 | 43 |
$value = $this->get_value($values); |
34 | 44 |
$value = isset($languages[$value]) ? $languages[$value] : ''; |
35 | 45 |
return $this->render_link($value, $values); |
36 | 46 |
} |
47 |
|
|
37 | 48 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules