1 date_views_filter_handler.inc date_views_filter_handler::extra_options_form(&$form, &$form_state)

Provide a form for setting options.

Overrides date_views_filter_handler_simple::extra_options_form

File

core/modules/date/views/date_views_filter_handler.inc, line 85
A flexible, configurable date filter. This filter combines multiple date filters into a single filter where all fields are controlled by the same date and can be combined with either AND or OR.

Class

date_views_filter_handler
@file A flexible, configurable date filter. This filter combines multiple date filters into a single filter where all fields are controlled by the same date and can be combined with either AND or OR.

Code

function extra_options_form(&$form, &$form_state) {
  parent::extra_options_form($form, $form_state);

  $fields = date_views_fields($this->base_table);
  $options = array();
  foreach ($fields['name'] as $name => $field) {
    $options[$name] = $field['label'];
  }

  $form['date_fields'] = array(
    '#title' => t('Date field(s)'),
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => $this->options['date_fields'],
    '#multiple' => FALSE,
    '#description' => t('Select date field(s) to filter.'),
    '#required' => TRUE,
  );
  $form['date_method'] = array(
    '#title' => t('Method'),
    '#type' => 'radios',
    '#options' => array('OR' => t('OR'), 'AND' => t('AND')),
    '#default_value' => $this->options['date_method'],
    '#description' => t('Method of handling multiple date fields in the same query. Return items that have any matching date field (date = field_1 OR field_2), or only those with matches in all selected date fields (date = field_1 AND field_2).'),
  );
}