function page_manager_node_view in Chaos Tool Suite (ctools) 6
Entry point for our overridden node view.
This function asks its assigned handlers who, if anyone, would like to run with it. If no one does, it passes through to Drupal core's node view, which is node_page_view().
1 string reference to 'page_manager_node_view'
- page_manager_node_view_menu_alter in page_manager/
plugins/ tasks/ node_view.inc - Callback defined by page_manager_node_view_page_manager_tasks().
File
- page_manager/
plugins/ tasks/ node_view.inc, line 79 - Handle the 'node view' override task.
Code
function page_manager_node_view($node) {
// Load my task plugin
$task = page_manager_get_task('node_view');
// Load the node into a context.
ctools_include('context');
ctools_include('context-task-handler');
// We need to mimic Drupal's behavior of setting the node title here.
drupal_set_title(check_plain($node->title));
$contexts = ctools_context_handler_get_task_contexts($task, '', array(
$node,
));
$output = ctools_context_handler_render($task, '', $contexts, array(
$node->nid,
));
if ($output !== FALSE) {
node_tag_new($node->nid);
return $output;
}
$function = 'node_page_view';
foreach (module_implements('page_manager_override') as $module) {
$call = $module . '_page_manager_override';
if (($rc = $call('node_view')) && function_exists($rc)) {
$function = $rc;
break;
}
}
// Otherwise, fall back.
return $function($node);
}