You are here

function panels_panel_context_edit_content_submit in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/task_handlers/panel_context.inc \panels_panel_context_edit_content_submit()

File

plugins/task_handlers/panel_context.inc, line 741
This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.

Code

function panels_panel_context_edit_content_submit(&$form, &$form_state) {

  // Update the storage_id if this is a new variant before saving.
  if ($form_state['display']->storage_id == 'new') {
    $form_state['display']->storage_id = $form_state['handler_id'];
  }
  panels_edit_display_form_submit($form, $form_state);
  $handler =& $form_state['handler'];

  // Update the cached display:
  $display = $form_state['page']->display_cache[$form_state['handler_id']]->display;
  $handler->conf['display'] = $display;
  unset($form_state['page']->display_cache[$form_state['handler_id']]);
  if ($form_state['clicked_button']['#value'] == t('Update and preview')) {
    $form_state['new trail'] = array(
      'handlers',
      $form_state['handler_id'],
      'preview',
    );
  }
}