You are here

function date_api_filter_handler::extra_options_form in Date 6

Same name and namespace in other branches
  1. 6.2 includes/date_api_filter_handler.inc \date_api_filter_handler::extra_options_form()

File

./date_api.views.inc, line 559
Defines date-related Views data and plugins:

Class

date_api_filter_handler
A flexible, configurable date filter.

Code

function extra_options_form(&$form, &$form_state) {
  $form['adjustment_field'] = array(
    '#type' => 'radios',
    '#title' => t('Filter type'),
    '#default_value' => $this->options['adjustment_field'],
    '#options' => array(
      0 => t('Date only'),
      1 => t('Both date and adjustment'),
      2 => t('Adjustment only'),
    ),
    '#description' => t('Choose a date to filter on, or use an adjustment field for a value like \'+1 day\'. When you use both date and adjustment, the adjustment will be added to the date. When the adjustment field is used with no date field, the adjustment will be made to the current date.'),
  );
  $form['granularity'] = $this->date_handler
    ->granularity_form($this->options['granularity']);
  $form['granularity']['#description'] = '<p>' . t('Select a granularity for the date filter. For instance, selecting \'day\' will create a filter where you can select the year, month, and day. You will be able to choose a specific value, all values, or \'now\' for each date part in the filter.') . '</p>';
  if (!$this->date_handler
    ->has_tz_support()) {
    $form['granularity']['#description'] .= '<p>' . t('This database does not appear to have native timezone support. Filtering using hour, minute, or second granularity is likely to return incorrect results at least some of the time on systems without native timezone support, so it is recommended to set the granularity to no more than \'day\'.') . '</p>';
  }
}