You are here

function panels_page_add_handler in Panels 6.2

Handle the add panel-page page.

1 string reference to 'panels_page_add_handler'
panels_page_admin_static_menu_items in panels_page/panels_page.menu.inc
Define and return all the static administrative pages for hook_menu().

File

panels_page/panels_page.admin.inc, line 190
panels_page.admin.inc

Code

function panels_page_add_handler($layout = NULL) {
  drupal_set_title(t('Add panel page'));
  panels_load_include('plugins');
  $layouts = panels_get_layouts();
  $output = '';

  // If no page layout is given, choose one first.
  if ($layout === NULL) {
    foreach ($layouts as $id => $layout) {
      $output .= panels_print_layout_link($id, $layout, $_GET['q'] . '/' . $id);
    }
    return $output;
  }
  $panel_page = new stdClass();
  $panel_page->primary = panels_new_display();
  $panel_page->primary->layout = $layout;
  $panel_page->display =& $panel_page->primary;
  $panel_page->pid = 'new';
  $panel_page->did = 'new';
  $panel_page->name = '';
  $panel_page->title = '';
  $panel_page->css_id = '';
  $panel_page->path = '';
  return drupal_get_form('panels_page_edit_form', panels_page_sanitize($panel_page));
}