You are here

function views_plugin_style_watchdog_table::options_validate in Views Watchdog 6

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.2 views/plugins/views_plugin_style_watchdog_table.inc \views_plugin_style_watchdog_table::options_validate()
  3. 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 50
Views callbacks for the "Views watchdog" module.

Class

views_plugin_style_watchdog_table

Code

function options_validate(&$form, &$form_state) {
  parent::options_validate($form, $form_state);
  foreach (views_watchdog_get_severity() as $key => $value) {
    $class = trim($form_state['values']['style_options']['watchdog_table_severity_' . $value['arg']]);
    $field = $form['watchdog_table_severity_' . $value['arg']];
    if (preg_match('/[^a-zA-Z0-9-]/', $class)) {
      form_error($field, t('CSS class name must be alphanumeric or dashes only.'));
    }
  }
}