function search_log_admin_settings_validate in Search Log 7
Same name and namespace in other branches
- 6 search_log.admin.inc \search_log_admin_settings_validate()
Validate admin settings.
1 string reference to 'search_log_admin_settings_validate'
- search_log_admin_settings in ./
search_log.admin.inc - Display admin settings.
File
- ./
search_log.admin.inc, line 77 - Admin page callbacks file for the search_log module.
Code
function search_log_admin_settings_validate($form, &$form_state) {
if (!preg_match('/^[0-9]+$/', $form_state['values']['search_log_cron'])) {
form_set_error('search_log_cron', t('The number of days must be a number 0 or greater.'));
}
$any_enabled = FALSE;
foreach ($form_state['values']['search_log_modules_enabled'] as $module => $enabled) {
if ($enabled) {
$any_enabled = TRUE;
break;
}
}
if (!$any_enabled) {
form_set_value($form['logging']['search_log_modules_enabled'], NULL, $form_state);
}
}