function advanced_forum_plugin_style_forum_topic_list::get_forum_ids in Advanced Forum 6.2
Same name and namespace in other branches
- 7.2 includes/views/advanced_forum_plugin_style_forum_topic_list.inc \advanced_forum_plugin_style_forum_topic_list::get_forum_ids()
Figure out what the forum ID is. It could have come from an argument or a filter or nowhere. This source would be set by the user in the options.
File
- includes/
views/ advanced_forum_plugin_style_forum_topic_list.inc, line 55 - Contains the topic list style plugin.
Class
- advanced_forum_plugin_style_forum_topic_list
- Style plugin to render each item as a row in a table.
Code
function get_forum_ids() {
$where = $this->options['tid'];
if (empty($where)) {
return;
}
$term = '';
list($type, $id) = explode('.', $where, 2);
$handler = $this->display->handler
->get_handler($type, $id);
if ($type == 'argument') {
return array(
$handler->argument,
);
}
else {
$terms = $handler->value;
if (isset($handler->options['depth'])) {
foreach ($handler->value as $tid) {
$term = taxonomy_get_term($tid);
$tree = taxonomy_get_tree($term->vid, $tid, -1, $handler->options['depth']);
$terms = array_merge($terms, array_map('_taxonomy_get_tid_from_term', $tree));
}
}
return $terms;
}
}