function advanced_forum_argument_forum_id_context in Advanced Forum 7.2
Same name and namespace in other branches
- 6.2 plugins/arguments/forum_id.inc \advanced_forum_argument_forum_id_context()
Discover if this argument gives us the user we crave.
1 string reference to 'advanced_forum_argument_forum_id_context'
- forum_id.inc in plugins/
arguments/ forum_id.inc - Plugin to provide an argument handler for a user id
File
- plugins/
arguments/ forum_id.inc, line 30 - Plugin to provide an argument handler for a user id
Code
function advanced_forum_argument_forum_id_context($arg = NULL, $conf = NULL, $empty = FALSE) {
// If unset it wants a generic, unfilled context.
if ($empty) {
return ctools_context_create_empty('forum');
}
if (!is_numeric($arg)) {
return NULL;
}
if ($arg != 0) {
$term = taxonomy_term_load($arg);
}
if ($arg == 0 || empty($term) || $term->vid != variable_get('forum_nav_vocabulary', 0)) {
$term = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary', 0));
$term->tid = 0;
}
if (!$term) {
return NULL;
}
return ctools_context_create('forum', $term);
}