Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc | ||
---|---|---|
9 | 9 |
* Taxonomy tid default argument. |
10 | 10 |
*/ |
11 | 11 |
class views_plugin_argument_default_taxonomy_tid extends views_plugin_argument_default { |
12 |
function init(&$view, &$argument, $options) { |
|
12 |
|
|
13 |
/** |
|
14 |
* {@inheritdoc} |
|
15 |
*/ |
|
16 |
public function init(&$view, &$argument, $options) { |
|
13 | 17 |
parent::init($view, $argument, $options); |
14 | 18 |
|
15 | 19 |
// Convert legacy vids option to machine name vocabularies. |
... | ... | |
23 | 27 |
} |
24 | 28 |
} |
25 | 29 |
|
26 |
function option_definition() { |
|
30 |
/** |
|
31 |
* {@inheritdoc} |
|
32 |
*/ |
|
33 |
public function option_definition() { |
|
27 | 34 |
$options = parent::option_definition(); |
28 | 35 |
|
29 | 36 |
$options['term_page'] = array('default' => TRUE, 'bool' => TRUE); |
... | ... | |
35 | 42 |
return $options; |
36 | 43 |
} |
37 | 44 |
|
38 |
function options_form(&$form, &$form_state) { |
|
45 |
/** |
|
46 |
* {@inheritdoc} |
|
47 |
*/ |
|
48 |
public function options_form(&$form, &$form_state) { |
|
39 | 49 |
$form['term_page'] = array( |
40 | 50 |
'#type' => 'checkbox', |
41 | 51 |
'#title' => t('Load default filter from term page'), |
... | ... | |
92 | 102 |
); |
93 | 103 |
} |
94 | 104 |
|
95 |
function options_submit(&$form, &$form_state, &$options = array()) { |
|
105 |
/** |
|
106 |
* {@inheritdoc} |
|
107 |
*/ |
|
108 |
public function options_submit(&$form, &$form_state, &$options = array()) { |
|
96 | 109 |
// Filter unselected items so we don't unnecessarily store giant arrays. |
97 | 110 |
$options['vocabularies'] = array_filter($options['vocabularies']); |
98 | 111 |
} |
99 | 112 |
|
100 |
function get_argument() { |
|
113 |
/** |
|
114 |
* {@inheritdoc} |
|
115 |
*/ |
|
116 |
public function get_argument() { |
|
101 | 117 |
// Load default argument from taxonomy page. |
102 | 118 |
if (!empty($this->options['term_page'])) { |
103 | 119 |
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) { |
... | ... | |
151 | 167 |
return $views_page->argument['tid']->argument; |
152 | 168 |
} |
153 | 169 |
} |
170 |
|
|
154 | 171 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules