function _date_views_arguments in Date 5
Same name and namespace in other branches
- 5.2 date/date_views.inc \_date_views_arguments()
Views arguments for Date fields.
2 calls to _date_views_arguments()
- date_views_browser_get_views in ./
date_views.inc - Find all the views that qualify for date browser treatment
- _date_field_settings in ./
date_admin.inc - Implementation of hook_field_settings().
File
- ./
date_views.inc, line 225
Code
function _date_views_arguments($field) {
$field_types = _content_field_types();
$arguments = array();
$argument = array();
$argument['name'] = $field_types[$field['type']]['label'] . ($field['todate'] ? t(': From ') : ': ') . t($field['widget']['label']) . ' (' . $field['field_name'] . ')';
$argument['handler'] = $field['type'] == 'date' ? 'date_views_argument_range_handler' : 'date_views_timestamp_argument_range_handler';
$argument['help'] = t("Defines an argument to filter for dates within a range, in the format 'YYYY-MM-DD--YYYY-MM-DD'. Many other options can be used in arguments. See !link for other examples.", array(
'!link' => l(t('help'), 'admin/help/date'),
));
$argument['option'] = 'date_range_arg_options';
$arguments['content: ' . $field['field_name']] = $argument;
if ($field['todate']) {
$argument['name'] = $field_types[$field['type']]['label'] . t(': To ') . t($field['widget']['label']) . ' (' . $field['field_name'] . ')';
$arguments['content: to|' . $field['field_name']] = $argument;
}
return $arguments;
}