Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/includes/views/advanced_forum_handler_field_node_topic_icon.inc | ||
---|---|---|
5 | 5 |
* Field handler to display the topic icon. |
6 | 6 |
*/ |
7 | 7 |
|
8 |
class advanced_forum_handler_field_node_topic_icon extends views_handler_field{ |
|
9 |
function construct() { |
|
8 |
// @codingStandardsIgnoreStart |
|
9 |
class advanced_forum_handler_field_node_topic_icon extends views_handler_field { |
|
10 |
/** |
|
11 |
* {@inheritdoc} |
|
12 |
*/ |
|
13 |
public function construct() { |
|
10 | 14 |
parent::construct(); |
11 | 15 |
$this->additional_fields = array('nid' => 'nid', 'type' => 'type'); |
12 | 16 |
} |
13 | 17 |
|
14 |
function option_definition() { |
|
18 |
/** |
|
19 |
* {@inheritdoc} |
|
20 |
*/ |
|
21 |
public function option_definition() { |
|
15 | 22 |
$options = parent::option_definition(); |
16 |
|
|
17 | 23 |
$options['hot_topic_threshold'] = array('default' => 15); |
18 |
|
|
19 | 24 |
return $options; |
20 | 25 |
} |
21 | 26 |
|
22 |
function options_form(&$form, &$form_state) { |
|
27 |
/** |
|
28 |
* {@inheritdoc} |
|
29 |
*/ |
|
30 |
public function options_form(&$form, &$form_state) { |
|
23 | 31 |
parent::options_form($form, $form_state); |
24 | 32 |
$form['hot_topic_threshold'] = array( |
25 | 33 |
'#title' => t('Hot topic threshold'), |
... | ... | |
29 | 37 |
); |
30 | 38 |
} |
31 | 39 |
|
32 |
function query() { |
|
40 |
/** |
|
41 |
* {@inheritdoc} |
|
42 |
*/ |
|
43 |
public function query() { |
|
33 | 44 |
$this->ensure_my_table(); |
34 | 45 |
$this->add_additional_fields(); |
35 | 46 |
$this->field_alias = $this->table . '_' . $this->field; |
36 | 47 |
} |
37 | 48 |
|
38 |
function render($values) { |
|
49 |
/** |
|
50 |
* {@inheritdoc} |
|
51 |
*/ |
|
52 |
public function render($values) { |
|
39 | 53 |
$new_posts = advanced_forum_reply_num_new($values->nid); |
40 | 54 |
return theme('forum_icon', array( |
41 |
'new_posts' => $new_posts, |
|
42 |
'num_posts' => empty($values->node_comment_statistics_comment_count) ? 1 : $values->node_comment_statistics_comment_count + 1, |
|
43 |
'comment_mode' => $values->node_comment, |
|
44 |
'sticky' => $values->node_sticky, |
|
45 |
'node_type' => $values->node_type, |
|
55 |
'new_posts' => $new_posts,
|
|
56 |
'num_posts' => empty($values->node_comment_statistics_comment_count) ? 1 : $values->node_comment_statistics_comment_count + 1,
|
|
57 |
'comment_mode' => $values->node_comment,
|
|
58 |
'sticky' => $values->node_sticky,
|
|
59 |
'node_type' => $values->node_type,
|
|
46 | 60 |
)); |
47 | 61 |
} |
48 | 62 |
} |
63 |
// @codingStandardsIgnoreEnd |
Formats disponibles : Unified diff
Weekly update of contrib modules