function _element_validate_integer_positive in Content Construction Kit (CCK) 6.2
Same name and namespace in other branches
- 6.3 includes/content.admin.inc \_element_validate_integer_positive()
Helper form element validator : integer > 0.
4 string references to '_element_validate_integer_positive'
- nodereference_widget_settings in modules/
nodereference/ nodereference.module - Implementation of hook_widget_settings().
- text_field_settings in modules/
text/ text.module - Implementation of hook_field_settings().
- text_widget_settings in modules/
text/ text.module - Implementation of hook_widget_settings().
- userreference_widget_settings in modules/
userreference/ userreference.module - Implementation of hook_widget_settings().
File
- includes/
content.admin.inc, line 1900 - Administrative interface for content type creation.
Code
function _element_validate_integer_positive($element, &$form_state) {
$value = $element['#value'];
if ($value !== '' && (!is_numeric($value) || intval($value) != $value || $value <= 0)) {
form_error($element, t('%name must be a positive integer.', array(
'%name' => $element['#title'],
)));
}
}