You are here

function staticmap_ctools_export_ui_form_validate in Static Map 7

Validate handler for export UI form.

Parameters

array $form: Drupal form.

array $form_state: Drupal form state.

1 string reference to 'staticmap_ctools_export_ui_form_validate'
staticmap_ctools_export_ui.inc in plugins/export_ui/staticmap_ctools_export_ui.inc

File

./staticmap.module, line 542
SiteMap module.

Code

function staticmap_ctools_export_ui_form_validate(&$form, &$form_state) {
  if (!preg_match('#^[0-9]*x[0-9]*$#', $form_state['values']['mapsize'])) {
    form_error($form['mapsize'], t('Map size must be [width]x[height]'));
  }
  if ($form_state['op'] == 'add' && staticmap_preset_exists($form_state['values']['name'])) {
    form_error($form['name'], t('A preset name <em>@name</em> already exists!', array(
      '@name' => check_plain($form_state['values']['name']),
    )));
  }
}