function ultimate_cron_function_settings_form_validate in Ultimate Cron 6
Same name and namespace in other branches
- 8 ultimate_cron.admin.inc \ultimate_cron_function_settings_form_validate()
- 7 ultimate_cron.admin.inc \ultimate_cron_function_settings_form_validate()
Validate handler for function settings.
File
- ./
ultimate_cron.admin.inc, line 217
Code
function ultimate_cron_function_settings_form_validate($form, &$form_state) {
$conf =& $form_state['values']['general'];
$conf['rules'] = trim($conf['rules']);
$conf['rules'] = $conf['rules'] ? explode(';', $conf['rules']) : array();
if ($conf['rules']) {
foreach ($conf['rules'] as &$rule) {
$rule = trim($rule);
if (!ultimate_cron_validate_rule($rule)) {
form_set_error('rules', t('Invalid rule.'));
}
}
}
else {
unset($conf['rules']);
}
}