function getlocations_mapquest_settings_validate in Get Locations 7
Same name and namespace in other branches
- 7.2 modules/getlocations_mapquest/getlocations_mapquest.module \getlocations_mapquest_settings_validate()
 
Function
Return value
Returns
1 string reference to 'getlocations_mapquest_settings_validate'
- getlocations_mapquest_settings_form in modules/
getlocations_mapquest/ getlocations_mapquest.module  - Function
 
File
- modules/
getlocations_mapquest/ getlocations_mapquest.module, line 1743  - getlocations_mapquest.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
 
Code
function getlocations_mapquest_settings_validate($form, &$form_state) {
  $reset = $form_state['values']['getlocations_mapquest_paths']['reset'];
  unset($form_state['values']['getlocations_mapquest_paths']['reset']);
  if ($reset == 1) {
    $form_state['values']['getlocations_mapquest_paths'] = getlocations_mapquest_paths_get(TRUE);
  }
  elseif ($reset == 2) {
    $form_state['values']['getlocations_mapquest_paths'] = getlocations_mapquest_paths_get(FALSE, TRUE);
  }
  // css check
  if (isset($form_state['values']['getlocations_mapquest_defaults']['width'])) {
    if ($check = getlocations_dim_check($form_state['values']['getlocations_mapquest_defaults']['width'])) {
      $form_state['values']['getlocations_mapquest_defaults']['width'] = $check;
    }
    else {
      form_set_error('getlocations_mapquest_defaults][width', t('Width must be valid css'));
    }
  }
  if (isset($form_state['values']['getlocations_mapquest_defaults']['height'])) {
    if ($check = getlocations_dim_check($form_state['values']['getlocations_mapquest_defaults']['height'])) {
      $form_state['values']['getlocations_mapquest_defaults']['height'] = $check;
    }
    else {
      form_set_error('getlocations_mapquest_defaults][height', t('Height must be valid css'));
    }
  }
}