You are here

function _quotes_block_configuration_validate in Quotes 6

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

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

Parameters

$form_id: The string specifying the form ID of the form that was submitted.

$form_values: The array specifying the form values.

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

File

./quotes.module, line 1109
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.'));
  }
}