You are here

function theme_panels_everywhere_page in Panels Everywhere 7

Output the panels everywhere task handler.

This is usually a panel, and this is used in place of theme('page') so there will be no page.tpl.php

File

theme/theme.inc, line 14
Contains preprocess functions for Panels Everywhere themes.

Code

function theme_panels_everywhere_page($vars) {
  $page =& $vars['page'];
  $task = page_manager_get_task('site_template');
  $content = new stdClass();
  $content->title = theme('head_title');
  $content->content = isset($page['content']) ? $page['content'] : '';
  $args = array(
    $content,
  );
  $contexts = ctools_context_handler_get_task_contexts($task, '', $args);

  // @todo -- we need a way to insert the page content into the panel
  // if for some reason they left out the page content pane.
  $info = ctools_context_handler_render_handler($task, '', $page['#handler'], $contexts, $args, FALSE);

  // @todo -- is this even necessary?
  $page['#panels_everywhere_site_template'] = array(
    'name' => 'site_template',
    'task' => $task,
    'subtask' => '',
    'contexts' => $contexts,
    'arguments' => $args,
  );
  return is_array($info['content']) ? drupal_render($info['content']) : $info['content'];
}