Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/includes/views/advanced_forum_plugin_style_forum_topic_list.inc | ||
---|---|---|
9 | 9 |
* |
10 | 10 |
* @ingroup views_style_plugins |
11 | 11 |
*/ |
12 |
// @codingStandardsIgnoreStart |
|
12 | 13 |
class advanced_forum_plugin_style_forum_topic_list extends views_plugin_style_table { |
13 |
function option_definition() { |
|
14 |
/** |
|
15 |
* {@inheritdoc} |
|
16 |
*/ |
|
17 |
public function option_definition() { |
|
14 | 18 |
$options = parent::option_definition(); |
15 | 19 |
$options['tid'] = array('default' => ''); |
16 | 20 |
return $options; |
17 | 21 |
} |
18 | 22 |
|
19 |
function options_form(&$form, &$form_state) { |
|
23 |
/** |
|
24 |
* {@inheritdoc} |
|
25 |
*/ |
|
26 |
public function options_form(&$form, &$form_state) { |
|
20 | 27 |
parent::options_form($form, $form_state); |
21 | 28 |
$options = array('' => t('None')); |
22 | 29 |
|
... | ... | |
39 | 46 |
} |
40 | 47 |
|
41 | 48 |
/** |
49 |
* {@inheritdoc} |
|
50 |
* |
|
42 | 51 |
* Add a couple of fields to the query that we can later use. We are going to |
43 | 52 |
* specificly alias them because this style is not meant to be used on relationships. |
44 | 53 |
*/ |
45 |
function query() { |
|
54 |
public function query() {
|
|
46 | 55 |
$this->view->query->add_field('node', 'sticky', 'topic_is_sticky'); |
47 | 56 |
$this->view->query->add_field('forum', 'tid', 'topic_actual_forum'); |
48 | 57 |
} |
49 | 58 |
|
50 | 59 |
/** |
51 |
* Figure out what the forum ID is. It could have come from an argument |
|
52 |
* or a filter or nowhere. This source would be set by the user in the
|
|
53 |
* options. |
|
60 |
* Figure out what the forum ID is. It could have come from an argument or a filter or nowhere.
|
|
61 |
* |
|
62 |
* This source would be set by the user in the options.
|
|
54 | 63 |
*/ |
55 |
function get_forum_ids() { |
|
64 |
public function get_forum_ids() {
|
|
56 | 65 |
$where = $this->options['tid']; |
57 | 66 |
if (empty($where)) { |
58 | 67 |
return; |
... | ... | |
66 | 75 |
return empty($handler->argument) ? array() : array($handler->argument); |
67 | 76 |
} |
68 | 77 |
else { |
69 |
$terms = is_array($handler->value) ? $handler->value : array($handler->value) ;
|
|
78 |
$terms = is_array($handler->value) ? $handler->value : array($handler->value); |
|
70 | 79 |
if (isset($handler->options['depth'])) { |
71 | 80 |
foreach ($terms as $tid) { |
72 | 81 |
$term = taxonomy_term_load($tid); |
... | ... | |
78 | 87 |
} |
79 | 88 |
} |
80 | 89 |
} |
90 |
// @codingStandardsIgnoreEnd |
Formats disponibles : Unified diff
Weekly update of contrib modules