You are here

function canvasactions_resizepercent_validate in ImageCache Actions 8

Same name and namespace in other branches
  1. 7 canvasactions/canvasactions.inc \canvasactions_resizepercent_validate()

Element validate handler to ensure that a positive number is specified.

1 string reference to 'canvasactions_resizepercent_validate'
canvasactions_resizepercent_form in canvasactions/canvasactions.inc
Image effect form callback for the resize percent effect.

File

canvasactions/canvasactions.inc, line 1005

Code

function canvasactions_resizepercent_validate($element, &$form_state) {
  element_validate_number($element, $form_state);
  if (!form_get_error($element)) {
    if ($element['#value'] != '' && (double) $element['#value'] <= 0) {
      form_error($element, t('!name must be a positive number.', array(
        '!name' => $element['#title'],
      )));
    }
  }
}