You are here

function getlocations_plugin_style_map::options_validate in Get Locations 6

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

Validate the options form.

File

./getlocations_plugin_style_map.inc, line 253
Contains the getlocations style plugin.

Class

getlocations_plugin_style_map
Getlocations style plugin to render rows as icons on a map.

Code

function options_validate(&$form, &$form_state) {
  $list = array(
    'Map',
    'Satellite',
    'Hybrid',
    'Physical',
  );
  $found = FALSE;
  foreach ($list as $maptype) {
    if ($form_state['values']['maptype'] == $maptype && $form_state['values']['baselayers'][$maptype]) {
      $found = TRUE;
      break;
    }
  }
  if (!$found) {

    // force a setting
    $form_state['values']['maptype'] = 'Map';
    $form_state['values']['baselayers']['Map'] = 1;
  }
}