You are here

function panelizer_default_settings_page in Panelizer 7.2

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

Page to configure basic settings for a panelizer default.

2 string references to 'panelizer_default_settings_page'
PanelizerEntityDefault::add_admin_links in plugins/entity/PanelizerEntityDefault.class.php
Helper function to add administrative menu items into an entity's already existing structure.
panelizer_admin_hook_menu in includes/admin.inc
Delegated hook_menu for admin

File

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

Code

function panelizer_default_settings_page($handler, $bundle, $name) {
  if (is_string($handler)) {
    $handler = panelizer_entity_plugin_get_handler($handler);
  }
  $panelizer = $handler
    ->get_default_panelizer_object($bundle, $name);
  if (empty($panelizer)) {
    return MENU_NOT_FOUND;
  }
  $form_state = array(
    'panelizer' => &$panelizer,
    'no_redirect' => TRUE,
    'reset button' => TRUE,
  );
  if ($handler
    ->has_panel_choice($bundle)) {
    $form_state['has title'] = TRUE;
  }
  ctools_include('common', 'panelizer');
  $output = drupal_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 panelizer settings have been reset to the default.'));
    }
    drupal_goto($_GET['q']);
  }
  return $output;
}