You are here

function _quotes_block_configuration_validate in Quotes 7

Same name and namespace in other branches
  1. 5 quotes.module \_quotes_block_configuration_validate()
  2. 6 quotes.module \_quotes_block_configuration_validate()

Validates that changes made on the block configuration screen are valid.

Parameters

array $form: The form that was submitted.

array $form_state: The array specifying the form values.

1 string reference to '_quotes_block_configuration_validate'
quotes_form_alter in ./quotes.module
Implements hook_form_alter().

File

./quotes.module, line 1482
The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.

Code

function _quotes_block_configuration_validate($form, &$form_state) {
  if (trim($form_state['values']['nid_filter']) && !preg_match('<^(\\d+[,\\s]*)+$>', trim($form_state['values']['nid_filter']))) {
    form_set_error('nid_filter', t('Please enter valid node IDs.'));
  }
  $interval = $form_state['values']['cron_interval'];
  if ($interval != '' && (!preg_match('<^\\d+$>', $interval) || $interval < 1 || $interval > 999)) {
    form_set_error('cron_interval', t('The update interval must be between 1 and 999.'));
  }
}