| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* List content by comment count |
* List content by comment count |
| 5 |
*/ |
*/ |
| 6 |
class topichubs_plugin_most_comments extends topichub_views_plugin { |
class topichubs_plugin_most_comments extends topichub_views_plugin { |
| 7 |
|
|
| 8 |
function get_view_name() { |
function get_view_name() { |
| 9 |
return 'topichub_most_comments'; |
return 'topichub_most_comments'; |
| 10 |
} |
} |
| 11 |
|
|
| 12 |
function options_form(&$form, &$form_state) { |
function options_form(&$form, &$form_state) { |
| 13 |
$this->add_types_field($form, $form_state); |
$this->add_types_field($form, $form_state); |
| 14 |
$this->add_count_field($form, $form_state); |
$this->add_count_field($form, $form_state); |
| 15 |
} |
} |
| 16 |
|
|
| 17 |
function execute() { |
function execute() { |
| 18 |
$types = $this->get_types_setting(); |
$types = $this->get_types_setting(); |
| 19 |
$this->add_content_type_filter($types); |
$this->add_content_type_filter($types); |
| 20 |
|
|
| 21 |
$count = $this->get_setting('count', 10); |
$count = $this->get_setting('count', 10); |
| 22 |
$this->set_items_per_page($count); |
$this->set_items_per_page($count); |
| 23 |
|
|
| 24 |
return $this->execute_view(); |
return $this->execute_view(); |
| 25 |
} |
} |
| 26 |
} |
} |