You are here

function views_handler_field_watchdog_severity::options_form in Views Watchdog 7.3

Same name and namespace in other branches
  1. 6.3 views/handlers/views_handler_field_watchdog_severity.inc \views_handler_field_watchdog_severity::options_form()
  2. 6 views/handlers/views_handler_field_watchdog_severity.inc \views_handler_field_watchdog_severity::options_form()
  3. 6.2 views/handlers/views_handler_field_watchdog_severity.inc \views_handler_field_watchdog_severity::options_form()

Default options form provides the label widget that all fields should have.

Overrides views_handler_field::options_form

File

views/handlers/views_handler_field_watchdog_severity.inc, line 30
Views field handler for the views_watchdog module.

Class

views_handler_field_watchdog_severity
Provides severity display options for the watchdog entry.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['watchdog_severity_icon'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display severity level as icon'),
    '#default_value' => !empty($this->options['watchdog_severity_icon']),
  );
  foreach (_views_watchdog_get_severity() as $key => $value) {
    $form['watchdog_severity_icon_' . $value['arg']] = array(
      '#type' => 'textfield',
      '#title' => $value['title'],
      '#description' => t('The path to the image file you would like to use as icon.'),
      '#default_value' => !empty($this->options['watchdog_severity_icon_' . $value['arg']]) ? $this->options['watchdog_severity_icon_' . $value['arg']] : $value['icon'],
      '#process' => array(
        'ctools_dependent_process',
      ),
      '#dependency' => array(
        'edit-options-watchdog-severity-icon' => array(
          1,
        ),
      ),
    );
  }
}