You are here

function mostpopular_blocks_validate_count in Drupal Most Popular 7

1 string reference to 'mostpopular_blocks_validate_count'
mostpopular_form_block_admin_configure_alter in ./mostpopular.blocks.inc
Implements form_FORM_ID_alter().

File

./mostpopular.blocks.inc, line 172
Provides an admin GUI for configuring most popular blocks.

Code

function mostpopular_blocks_validate_count($element, &$form_state) {
  $value = $element['#value'];
  if (!is_numeric($value)) {
    form_error($element, t('This must be a valid integer.'));
  }
  $value = (int) $value;
  if ($value <= 0) {
    form_error($element, t('This must be a positive integer.'));
  }
}