You are here

function panels_panel_context_edit_layout_validate in Panels 7.3

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

Validate that a layout was chosen.

File

plugins/task_handlers/panel_context.inc, line 647
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_layout_validate(&$form, &$form_state) {
  $display =& panels_panel_context_get_display($form_state['handler']);
  if (empty($form_state['values']['layout'])) {
    form_error($form['layout'], t('You must select a layout.'));
  }
  if ($form_state['values']['layout'] == $display->layout) {
    form_error($form['layout'], t('You must select a different layout if you wish to change layouts.'));
  }
}