1 date_views_argument_handler.inc | date_views_argument_handler::options_form(&$form, &$form_state) |
Add a form element to select date_fields for this argument.
Overrides date_views_argument_handler_simple::options_form
File
- core/
modules/ date/ views/ date_views_argument_handler.inc, line 46 - Date API views argument handler. This argument combines multiple date arguments into a single argument where all fields are controlled by the same date and can be combined with either AND or OR.
Class
Code
function options_form(&$form, &$form_state) {
parent::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' => TRUE,
'#description' => t("Select one or more date fields to filter with this argument."),
);
$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). '),
);
$form['date_group'] = array(
'#type' => 'hidden',
'#value' => $this->options['date_group'],
);
}