You are here

function _panels_everywhere_find_node_context in Panels Everywhere 6

Same name and namespace in other branches
  1. 7 plugins/tasks/site_template.inc \_panels_everywhere_find_node_context()

Attempt to extract a node from the environment to turn into a context.

1 call to _panels_everywhere_find_node_context()
panels_everywhere_site_template_get_base_contexts in plugins/tasks/site_template.inc
Figure out the base contexts in use for the page.

File

plugins/tasks/site_template.inc, line 199

Code

function _panels_everywhere_find_node_context() {
  foreach (range(1, 3) as $i) {
    $node = menu_get_object('node', $i);
    if (!empty($node)) {
      return $node;
    }
  }
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    return node_load(arg(1));
  }
}