You are here

function panelizer_settings_form_submit in Panelizer 7.3

Same name and namespace in other branches
  1. 6 includes/common.inc \panelizer_settings_form_submit()
  2. 7 includes/common.inc \panelizer_settings_form_submit()
  3. 7.2 includes/common.inc \panelizer_settings_form_submit()

Submit callback

File

includes/common.inc, line 130
Contains common forms and routines that different object types use.

Code

function panelizer_settings_form_submit(&$form, &$form_state) {
  $panelizer = $form_state['panelizer'];
  if ($form_state['view_mode'] == 'page_manager') {
    $panelizer->no_blocks = $form_state['values']['no_blocks'];
  }
  else {
    $panelizer->title_element = $form_state['values']['title_element'];
  }
  $panelizer->css_class = $form_state['values']['css_class'];
  $panelizer->css = $form_state['values']['css'];
  $panelizer->css_id = $form_state['values']['css_id'];
  $panelizer->pipeline = $form_state['values']['pipeline'];

  // Behind an if because this value does not always exist.
  if (isset($form_state['values']['link_to_entity'])) {
    $panelizer->link_to_entity = $form_state['values']['link_to_entity'];
  }
  if (!empty($form_state['has title'])) {
    $panelizer->title = $form_state['values']['title'];
  }

  // NOTE: We do not save in the submit so that the form can be re-used.
}