You are here

function _panelizer_panelizer_task_get_extra_contexts in Panelizer 7.3

Get extra contexts to pass from page manager to panelizer.

Parameters

$handler: The handler object.

$base_contexts: The base contexts from page manager.

Return value

array All contexts defined in page manager other than the panelized entity context.

1 call to _panelizer_panelizer_task_get_extra_contexts()
panelizer_panelizer_task_render in plugins/task_handlers/panelizer_node.inc
Render a entity that has been panelized.

File

plugins/task_handlers/panelizer_node.inc, line 113
This is the task handler plugin to handle an entity view. NOTE: This is named panelizer_node for historical reasons. It is too much of a pain to change the name of a task handler. This panelizes any entity not just a node.

Code

function _panelizer_panelizer_task_get_extra_contexts($handler, $base_contexts) {
  $extra_contexts = ctools_context_handler_get_handler_contexts($base_contexts, $handler);

  // Remove the panelized context to prevent duplication in the extra contexts.
  if (isset($handler->conf['context']) && !empty($extra_contexts[$handler->conf['context']])) {
    unset($extra_contexts[$handler->conf['context']]);
  }
  elseif (!empty($extra_contexts)) {
    array_shift($extra_contexts);
  }
  return $extra_contexts;
}