function views_plugin_style_watchdog_table::options_validate in Views Watchdog 6.3
Same name and namespace in other branches
- 6 views/plugins/views_plugin_style_watchdog_table.inc \views_plugin_style_watchdog_table::options_validate()
- 6.2 views/plugins/views_plugin_style_watchdog_table.inc \views_plugin_style_watchdog_table::options_validate()
- 7.3 views/plugins/views_plugin_style_watchdog_table.inc \views_plugin_style_watchdog_table::options_validate()
File
- views/
plugins/ views_plugin_style_watchdog_table.inc, line 70 - Views style plugin for the views_watchdog module.
Class
- views_plugin_style_watchdog_table
- Provides style options for watchdog tables.
Code
function options_validate(&$form, &$form_state) {
parent::options_validate($form, $form_state);
$class = str_replace('[type]', '', trim($form_state['values']['style_options']['watchdog_table_type_class']));
if (preg_match('/[^a-zA-Z0-9-]/', $class)) {
$field = $form['watchdog_table_type_class'];
form_error($field, t('CSS class name must be alphanumeric or dashes only.'));
}
$class = str_replace('[severity]', '', trim($form_state['values']['style_options']['watchdog_table_severity_class']));
if (preg_match('/[^a-zA-Z0-9-]/', $class)) {
$field = $form['watchdog_table_severity_class'];
form_error($field, t('CSS class name must be alphanumeric or dashes only.'));
}
}