You are here

function imagefield_focus_widget_validate in ImageField Focus 7

Same name and namespace in other branches
  1. 6 imagefield_focus.module \imagefield_focus_widget_validate()

Element #element_validate callback function.

1 string reference to 'imagefield_focus_widget_validate'
imagefield_focus_widget_image_image_process in ./imagefield_focus.module
Element #process callback function; process widget type image_image.

File

./imagefield_focus.module, line 211

Code

function imagefield_focus_widget_validate($element, &$form_state, $form) {
  foreach (array(
    'focus_rect',
    'crop_rect',
  ) as $key) {
    if (isset($element['#value'][$key])) {
      $value = trim($element['#value'][$key]);
      if (strlen($value) > 0 && !imagefield_focus_parse($value)) {
        form_error($element[$key], t('The specified rectangle value is invalid.'));
      }
    }
  }
}