You are here

public function SchedulerHandlerFieldSchedulerCountdown::options_form in Scheduler 7

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

Overrides views_handler_field::options_form

File

./scheduler_handler_field_scheduler_countdown.inc, line 65
Display scheduled dates in 'countdown' format for use in Views.

Class

SchedulerHandlerFieldSchedulerCountdown
Field handler to display a countdown until a scheduled action.

Code

public function options_form(&$form, &$form_state) {

  // @codingStandardsIgnoreEnd
  parent::options_form($form, $form_state);
  $form['countdown_display'] = array(
    '#title' => t('Display countdown as'),
    '#type' => 'radios',
    '#options' => array(
      'smart' => t('Smart mode'),
      'seconds' => t('Seconds'),
      'minutes' => t('Minutes'),
      'hours' => t('Hours'),
      'days' => t('Days'),
      'weeks' => t('Weeks'),
    ),
    '#default_value' => $this->options['countdown_display'],
  );
  $form['units_display'] = array(
    '#title' => t('Display time units'),
    '#type' => 'radios',
    '#options' => array(
      'long' => t('Long (for example 3 days)'),
      'short' => t('Short (for example 3d)'),
      'none' => t('No units at all'),
    ),
    '#default_value' => $this->options['units_display'],
  );
}