You are here

function panelizer_get_base_context_node in Panelizer 6

Same name and namespace in other branches
  1. 7 includes/node.inc \panelizer_get_base_context_node()

Callback to get the base context for a node panelizer.

File

includes/node.inc, line 477
Contains routines specific to handling nodes that are panelized.

Code

function panelizer_get_base_context_node($object = NULL) {
  ctools_include('context');
  if ($object) {
    $context = ctools_context_create('node', $object);
  }
  else {
    $context = ctools_context_create_empty('node');

    // The placeholder is needed to create the form used for the live
    // preview.
    $context->placeholder = array(
      'type' => 'context',
      'conf' => array(
        'name' => 'node',
        'identifier' => t('This node'),
        'keyword' => 'node',
        'context_settings' => array(),
      ),
    );
  }
  $context->identifier = t('This node');
  $context->keyword = 'node';
  return array(
    'panelizer' => $context,
  );
}