function _imagefield_crop_widget_croparea_validate in Imagefield Crop 7
Same name and namespace in other branches
- 7.2 imagefield_crop.module \_imagefield_crop_widget_croparea_validate()
1 string reference to '_imagefield_crop_widget_croparea_validate'
File
- ./imagefield_crop.module, line 189 
- Provide a widget to crop uploaded image.
Code
function _imagefield_crop_widget_croparea_validate($element, &$form_state) {
  foreach (array(
    'x',
    'y',
  ) as $dimension) {
    $value = $element[$dimension]['#value'];
    if (!empty($value) && !is_numeric($value)) {
      form_error($element[$dimension], t('The @dimension value must be numeric.', array(
        '@dimesion' => $dimension,
      )));
      return;
    }
  }
  form_set_value($element, (int) $element['x']['#value'] . 'x' . (int) $element['y']['#value'], $form_state);
}