function coloractions_validate_scale_0_1 in ImageCache Actions 8
Same name and namespace in other branches
- 7 coloractions/imagecache_coloractions.module \coloractions_validate_scale_0_1()
Form element validation handler for elements that should contain a number between 0 and 1.
1 string reference to 'coloractions_validate_scale_0_1'
- coloractions_adjustlevels_form_helper in coloractions/
imagecache_coloractions.module - Helper function to create the form for the color level adjustment effect.
File
- coloractions/
imagecache_coloractions.module, line 944
Code
function coloractions_validate_scale_0_1($element) {
$value = $element['#value'];
if ($value != '' && (!is_numeric($value) || (double) $value > 1.0 || (double) $value < 0.0)) {
form_error($element, t('%name must be a value between 0 and 1.', array(
'%name' => $element['#title'],
)));
}
}