function _quotes_block_configuration_validate in Quotes 5
Same name and namespace in other branches
- 6 quotes.module \_quotes_block_configuration_validate()
- 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.
File
- ./
quotes.module, line 1813
Code
function _quotes_block_configuration_validate($form_id, $form_values) {
if (trim($form_values['nid_filter']) && !preg_match('<^(\\d+[,\\s]*)+$>', trim($form_values['nid_filter']))) {
form_set_error('nid_filter', t('Please enter valid node IDs.'));
}
$interval = $form_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.'));
}
}