You are here

function _mailhandler_element_validate_integer_positive in Mailhandler 6.2

Helper form element validator: integer > 0.

1 string reference to '_mailhandler_element_validate_integer_positive'
mailhandler_mailbox_ui::edit_form in plugins/ctools/export_ui/mailhandler_mailbox_ui.class.php
Implementation of ctools_export_ui::edit_form().

File

./mailhandler.module, line 307
Retrieves email for posting as nodes and comments.

Code

function _mailhandler_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'],
    )));
  }
}