You are here

public function weather_handler_temperature::options_form in Weather 7.3

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

Provide unit to select.

Overrides views_handler_field_numeric::options_form

File

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

Class

weather_handler_temperature
Field handler to allow selection of temperature units.

Code

public function options_form(&$form, &$form_state) {
  $form['unit'] = array(
    '#title' => t('Unit for temperature display'),
    '#description' => t('Select unit for formatted temperatures or display only value.'),
    '#type' => 'select',
    '#default_value' => $this->options['unit'],
    '#options' => array(
      'celsius' => t('Celsius'),
      'celsius_value' => t('Celsius (only value)'),
      'fahrenheit' => t('Fahrenheit'),
      'fahrenheit_value' => t('Fahrenheit (only value)'),
      'celsiusfahrenheit' => t('Celsius / Fahrenheit'),
      'fahrenheitcelsius' => t('Fahrenheit / Celsius'),
    ),
  );
  parent::options_form($form, $form_state);
}