You are here

function getlocations_mapquest_plugin_style::options_validate in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_mapquest/views/getlocations_mapquest_plugin_style.inc \getlocations_mapquest_plugin_style::options_validate()

Validate the options form.

Overrides views_plugin_style::options_validate

File

modules/getlocations_mapquest/views/getlocations_mapquest_plugin_style.inc, line 450
getlocations_mapquest_plugin_style.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Class

getlocations_mapquest_plugin_style
@file getlocations_mapquest_plugin_style.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

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

  // css check
  if (isset($form_state['values']['style_options']['width'])) {
    if ($check = getlocations_dim_check($form_state['values']['style_options']['width'])) {
      $form_state['values']['style_options']['width'] = $check;
    }
    else {
      form_set_error('style_options][width', t('Width must be valid css'));
    }
  }
  if (isset($form_state['values']['style_options']['height'])) {
    if ($check = getlocations_dim_check($form_state['values']['style_options']['height'])) {
      $form_state['values']['style_options']['height'] = $check;
    }
    else {
      form_set_error('style_options][height', t('Height must be valid css'));
    }
  }

  // latlong
  if (isset($form_state['values']['style_options']['latlong'])) {
    if ($latlon = getlocations_latlon_check($form_state['values']['style_options']['latlong'])) {
      $form_state['values']['style_options']['latlong'] = $latlon;
    }
    else {
      form_set_error('style_options][latlong', t('Map coordinates must be expressed as a decimal latitude and longitude, separated by a comma.'));
    }
  }
}