You are here

function panelizer_default_layout_page in Panelizer 6

Same name and namespace in other branches
  1. 7.3 includes/admin.inc \panelizer_default_layout_page()
  2. 7 includes/admin.inc \panelizer_default_layout_page()
  3. 7.2 includes/admin.inc \panelizer_default_layout_page()

Pass through to the panels layout editor.

1 string reference to 'panelizer_default_layout_page'
panelizer_menu in ./panelizer.module
Implementation of hook_menu().

File

includes/admin.inc, line 339
Contains administrative forms and settings.

Code

function panelizer_default_layout_page($type, $key, $name) {
  $panelizer = panelizer_load_default($type, $key, $name);
  if (empty($panelizer)) {
    return MENU_NOT_FOUND;
  }

  // Drupal kills our breadcrumb. Put it back.
  ctools_include('menu');
  ctools_menu_set_trail_parent('admin/settings/panelizer');
  $display = panelizer_load_display($panelizer);
  ctools_include('context');
  $display->context = panelizer_get_contexts($panelizer);
  $output = panels_edit_layout($display, t('Save'), '', 'panelizer_' . $type . ':' . $key);
  if (is_object($output)) {

    // The display was already saved, but if we were given a did, that
    // needs to be saved too.
    if ($panelizer->did != $output->did) {
      ctools_include('export');
      $panelizer->did = $output->did;

      // Ensure we don't try to write again:
      if (isset($panelizer->display)) {
        unset($panelizer->display);
      }
      ctools_export_crud_save('panelizer_defaults', $panelizer);
    }
    drupal_goto($_GET['q']);
  }
  return $output;
}