You are here

function panels_nid_context in Panels 6.2

Same name and namespace in other branches
  1. 5.2 arguments/nid.inc \panels_nid_context()

Discover if this argument gives us the node we crave.

1 string reference to 'panels_nid_context'
panels_nid_panels_arguments in arguments/nid.inc
@file arguments/nid.inc

File

arguments/nid.inc, line 29
arguments/nid.inc

Code

function panels_nid_context($node = NULL, $conf = NULL, $empty = FALSE) {

  // If unset it wants a generic, unfilled context.
  if ($empty) {
    return panels_context_create_empty('node');
  }
  if (!is_object($node)) {
    return PANELS_ARG_IS_BAD;
  }
  if (array_filter($conf['types']) && empty($conf['types'][$node->type])) {
    return PANELS_ARG_USE_FALLBACK;
  }
  return panels_context_create('node', $node);
}