Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_join.inc | ||
---|---|---|
14 | 14 |
* @ingroup views_argument_handlers |
15 | 15 |
*/ |
16 | 16 |
class views_handler_argument_term_node_tid_depth_join extends views_handler_argument { |
17 |
function option_definition() { |
|
17 |
|
|
18 |
/** |
|
19 |
* {@inheritdoc} |
|
20 |
*/ |
|
21 |
public function option_definition() { |
|
18 | 22 |
$options = parent::option_definition(); |
19 | 23 |
|
20 | 24 |
$options['depth'] = array('default' => 0); |
... | ... | |
25 | 29 |
return $options; |
26 | 30 |
} |
27 | 31 |
|
28 |
function options_form(&$form, &$form_state) { |
|
32 |
/** |
|
33 |
* {@inheritdoc} |
|
34 |
*/ |
|
35 |
public function options_form(&$form, &$form_state) { |
|
29 | 36 |
$form['depth'] = array( |
30 | 37 |
'#type' => 'weight', |
31 | 38 |
'#title' => t('Depth'), |
... | ... | |
57 | 64 |
parent::options_form($form, $form_state); |
58 | 65 |
} |
59 | 66 |
|
60 |
function set_breadcrumb(&$breadcrumb) { |
|
67 |
/** |
|
68 |
* {@inheritdoc} |
|
69 |
*/ |
|
70 |
public function set_breadcrumb(&$breadcrumb) { |
|
61 | 71 |
if (empty($this->options['set_breadcrumb']) || !is_numeric($this->argument)) { |
62 | 72 |
return; |
63 | 73 |
} |
... | ... | |
68 | 78 |
/** |
69 | 79 |
* Override default_actions() to remove summary actions. |
70 | 80 |
*/ |
71 |
function default_actions($which = NULL) { |
|
81 |
public function default_actions($which = NULL) {
|
|
72 | 82 |
if ($which) { |
73 | 83 |
if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) { |
74 | 84 |
return parent::default_actions($which); |
... | ... | |
83 | 93 |
return $actions; |
84 | 94 |
} |
85 | 95 |
|
86 |
function query($group_by = FALSE) { |
|
96 |
/** |
|
97 |
* {@inheritdoc} |
|
98 |
*/ |
|
99 |
public function query($group_by = FALSE) { |
|
87 | 100 |
$this->ensure_my_table(); |
88 | 101 |
|
89 | 102 |
if (!empty($this->options['break_phrase'])) { |
... | ... | |
172 | 185 |
'field' => 'tid', |
173 | 186 |
'value' => $tids, |
174 | 187 |
'operator' => $operator, |
175 |
) |
|
188 |
),
|
|
176 | 189 |
); |
177 | 190 |
$taxonomy_index_alias = $this->query->add_relationship('taxonomy_index', $join, 'node'); |
178 | 191 |
|
... | ... | |
180 | 193 |
$this->query->distinct = TRUE; |
181 | 194 |
} |
182 | 195 |
|
183 |
function title() { |
|
196 |
/** |
|
197 |
* |
|
198 |
*/ |
|
199 |
public function title() { |
|
184 | 200 |
$term = taxonomy_term_load($this->argument); |
185 | 201 |
if (!empty($term)) { |
186 | 202 |
return check_plain($term->name); |
... | ... | |
188 | 204 |
|
189 | 205 |
return t('No name'); |
190 | 206 |
} |
207 |
|
|
191 | 208 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules