function opigno_context in Opigno 7.0
2 calls to opigno_context()
- opigno_context_build_menu in modules/
opigno_context/ opigno_context.module - @file Contains all hook_implementations and module specific API.
- opigno_context_trail in modules/
opigno_context/ opigno_context.module
File
- modules/
opigno_context/ opigno_context.module, line 103 - Contains all hook_implementations and module specific API.
Code
function opigno_context() {
$context =& drupal_static(__FUNCTION__, NULL);
if (isset($context)) {
return $context;
}
$node = menu_get_object();
if (empty($node)) {
$path_scheme = _menu_find_router_path($_GET['q']);
$page_callback = db_select('menu_router', 'm')
->fields('m', array(
'page_callback',
))
->condition('path', $path_scheme)
->execute()
->fetchField();
if ($page_callback == 'views_page') {
$context = opigno_context_view_context($path_scheme);
}
else {
$context = arg(0) . (@is_numeric(arg(1)) ? ':' . arg(1) : '');
}
}
else {
if (isset($node->group_audience[LANGUAGE_NONE][0]['gid'])) {
$context = 'og:' . $node->group_audience[LANGUAGE_NONE][0]['gid'];
}
elseif (og_is_group_type('node', $node->type) && isset($node->group_group[LANGUAGE_NONE][0]['value'])) {
$context = 'og:' . $node->group_group[LANGUAGE_NONE][0]['value'];
}
else {
$context = 'node';
}
}
return $context;
}