You are here

function gmap_plugin_style_gmap::options_validate in GMap Module 6

Same name and namespace in other branches
  1. 6.2 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::options_validate()
  2. 7.2 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::options_validate()
  3. 7 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::options_validate()

Validate the options form.

File

./gmap_plugin_style_gmap.inc, line 430
GMap style plugin.

Class

gmap_plugin_style_gmap
Style plugin to render a map.

Code

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

  // Check if highlight color is a valid hex color
  if (!preg_match('/^#[a-f0-9]{6}$/i', $form_state['values']['style_options']['highlight_nodearg_color'])) {
    form_error($form['highlight_nodearg_color'], t('Highlight colour must be a valid hex code in the form #FF0000.'));
  }
}