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_pager.inc | ||
---|---|---|
5 | 5 |
* Field handler to display the topic pager. |
6 | 6 |
*/ |
7 | 7 |
|
8 |
class advanced_forum_handler_field_node_topic_pager extends views_handler_field{ |
|
9 |
function construct() { |
|
8 |
// @codingStandardsIgnoreStart |
|
9 |
class advanced_forum_handler_field_node_topic_pager 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 | 23 |
|
17 | 24 |
$options['total_pages_shown'] = array('default' => 6); |
... | ... | |
19 | 26 |
return $options; |
20 | 27 |
} |
21 | 28 |
|
22 |
function options_form(&$form, &$form_state) { |
|
29 |
/** |
|
30 |
* {@inheritdoc} |
|
31 |
*/ |
|
32 |
public function options_form(&$form, &$form_state) { |
|
23 | 33 |
parent::options_form($form, $form_state); |
24 | 34 |
$form['total_pages_shown'] = array( |
25 | 35 |
'#title' => t('Total pages shown'), |
... | ... | |
29 | 39 |
); |
30 | 40 |
} |
31 | 41 |
|
32 |
function query() { |
|
42 |
/** |
|
43 |
* {@inheritdoc} |
|
44 |
*/ |
|
45 |
public function query() { |
|
33 | 46 |
$this->ensure_my_table(); |
34 | 47 |
$this->add_additional_fields(); |
35 | 48 |
$this->field_alias = $this->table . '_' . $this->field; |
36 | 49 |
} |
37 | 50 |
|
38 |
function render($values) { |
|
51 |
/** |
|
52 |
* {@inheritdoc} |
|
53 |
*/ |
|
54 |
public function render($values) { |
|
39 | 55 |
// Make a fake topic object with the information that the core one has. |
40 | 56 |
$topic = new stdClass(); |
41 | 57 |
$topic->nid = $values->nid; |
... | ... | |
43 | 59 |
$topic->comment_count = $values->node_comment_statistics_comment_count; |
44 | 60 |
|
45 | 61 |
return theme('advanced_forum_topic_pager', array( |
46 |
'pagecount' => $this->options['total_pages_shown'],
|
|
47 |
'topic' => $topic |
|
62 |
'pagecount' => $this->options['total_pages_shown'], |
|
63 |
'topic' => $topic,
|
|
48 | 64 |
)); |
49 | 65 |
} |
50 | 66 |
} |
67 |
// @codingStandardsIgnoreEnd |
Formats disponibles : Unified diff
Weekly update of contrib modules