function canvasactions_resizepercent_validate in ImageCache Actions 7
Same name and namespace in other branches
- 8 canvasactions/canvasactions.inc \canvasactions_resizepercent_validate()
Element validate handler to ensure that a positive number is specified.
Parameters
array $element: The form element to validate.
array $form_state: The form state.
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 1011
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'],
)));
}
}
}