You are here

public function weather_handler_pressure::options_form in Weather 7.3

Same name and namespace in other branches
  1. 7.2 views_handlers/weather_handler_pressure.inc \weather_handler_pressure::options_form()

Provide unit to select.

Overrides views_handler_field_numeric::options_form

File

views_handlers/weather_handler_pressure.inc, line 41
Views handler for weather module.

Class

weather_handler_pressure
Field handler to allow selection of pressure units.

Code

public function options_form(&$form, &$form_state) {
  $form['unit'] = array(
    '#title' => t('Unit for pressure display'),
    '#description' => t('Select unit for formatted pressures or display only value.'),
    '#type' => 'select',
    '#default_value' => $this->options['unit'],
    '#options' => array(
      'hpa' => t('hPa'),
      'hpa_value' => t('hPa (only value)'),
      'kpa' => t('kPa'),
      'kpa_value' => t('kPa (only value)'),
      'inhg' => t('inHg'),
      'inhg_value' => t('inHg (only value)'),
      'mmhg' => t('mmHg'),
      'mmhg_value' => t('mmHg (only value)'),
    ),
  );
  parent::options_form($form, $form_state);
}