You are here

function pagerer_preset_form_validate in Pagerer 7

Preset edit form - validation.

File

./pagerer.admin.inc, line 275
Pagerer administration

Code

function pagerer_preset_form_validate($form, &$form_state) {
  $v =& $form_state['values'];

  // Check 'Config' was invoked without selecting a theme.
  if (strpos($form_state['triggering_element']['#name'], 'config', 0) === 0) {
    $e = explode('_', $form_state['triggering_element']['#name']);
    $pane = $e[1];
    if ($v['panes']['e'][$pane]['data']['theme_name'] == 'none') {
      form_set_error('panes][e][' . $pane . '][data', t("Select a theme before clicking 'Configure'."));
    }
  }
}