You are here

function panelizer_default_settings_page in Panelizer 6

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

Page to configure basic settings for a panelizer default.

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

File

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

Code

function panelizer_default_settings_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');
  $form_state = array(
    'panelizer' => &$panelizer,
    'no_redirect' => TRUE,
    'reset button' => TRUE,
  );
  ctools_include('form');
  ctools_include('common', 'panelizer');
  $output = ctools_build_form('panelizer_settings_form', $form_state);
  if (!empty($form_state['executed'])) {
    if (empty($form_state['clicked_button']['#reset'])) {
      ctools_include('export');
      ctools_export_crud_save('panelizer_defaults', $panelizer);
      drupal_set_message(t('The settings have been updated.'));
    }
    else {
      panelizer_delete_panelizer_defaults($panelizer);
      drupal_set_message(t('The content type panel has been reset to the default.'));
    }
    drupal_goto($_GET['q']);
  }
  return $output;
}