You are here

function views_plugin_style_watchdog_table::options_validate in Views Watchdog 7.3

Same name and namespace in other branches
  1. 6.3 views/plugins/views_plugin_style_watchdog_table.inc \views_plugin_style_watchdog_table::options_validate()
  2. 6 views/plugins/views_plugin_style_watchdog_table.inc \views_plugin_style_watchdog_table::options_validate()
  3. 6.2 views/plugins/views_plugin_style_watchdog_table.inc \views_plugin_style_watchdog_table::options_validate()

Validate the options form.

Overrides views_plugin_style::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.'));
  }
}