You are here

function panels_edit_layout_settings_form_submit in Panels 5.2

Same name and namespace in other branches
  1. 6.2 includes/display-layout-settings.inc \panels_edit_layout_settings_form_submit()

File

includes/display_edit.inc, line 570

Code

function panels_edit_layout_settings_form_submit($form_id, $form_values) {
  list($display, $finish, $destination, $title) = $form_values['variables'];
  panels_panel_settings_submit($form_id, $form_values);
  $layout = $form_values['layout'];
  if (!empty($layout['settings submit']) && function_exists($layout['settings submit'])) {
    $layout['settings submit']($form_values['layout_settings'], $display, $layout, $display->layout_settings);
  }
  if (isset($form_values['display_title']['title'])) {
    $display->title = $form_values['display_title']['title'];
    $display->hide_title = $form_values['display_title']['hide_title'];
  }
  if ($form_values['op'] == $finish || $form_values['op'] == t('Save')) {
    $display->layout_settings = $form_values['layout_settings'];
    $display->panel_settings = $form_values['panel_settings'];
    panels_save_display($display);
    drupal_set_message("Your layout settings have been saved.");
    if ($form_values['op'] != $finish) {

      // This forces us to come back here if they hit Save.
      $_REQUEST['destination'] = $_GET['q'];
    }
    if (empty($destination)) {
      return $display;
    }
    return $destination;
  }
}