You are here

public function contextual_range_filter_handler_argument_date_range::options_form in Views Contextual Range Filter 7

Create the options form.

Overrides views_handler_argument::options_form

File

views/contextual_range_filter_handler_argument_date_range.inc, line 36
Definition of contextual_filter_range_handler_argument_numeric_range.

Class

contextual_range_filter_handler_argument_date_range
Argument handler for arguments that are date ranges.

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['description']['#markup'] = t('Contextual date range filter values are taken from the URL.');
  $form['more']['#collapsed'] = FALSE;
  $form['relative_dates'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow relative date ranges'),
    '#description' => t('If ticked, offsets from the current date may be specified.<br/>Example: <strong>2 weeks ago--yesterday"</strong>'),
    '#default_value' => $this->options['relative_dates'],
    '#fieldset' => 'more',
  );

  // Allow passing multiple values (ranges).
  $form['break_phrase'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow multiple date ranges'),
    '#description' => t('If ticked, multiple ranges may be specified by stringing them together with plus signs.<br/>Example: <strong>19990101--20051231+20130701--20140630</strong>'),
    '#default_value' => $this->options['break_phrase'],
    '#fieldset' => 'more',
  );
  $form['not'] = array(
    '#type' => 'checkbox',
    '#title' => t('Exclude'),
    '#description' => t('Negate the range. If selected, output matching the specified date range(s) will be excluded, rather than included.'),
    '#default_value' => !empty($this->options['not']),
    '#fieldset' => 'more',
  );
}