1 date_views_filter_handler_simple.inc | date_views_filter_handler_simple::admin_summary() |
Display the filter on the administrative summary
Overrides views_handler_filter_numeric::admin_summary
File
- core/
modules/ date/ views/ date_views_filter_handler_simple.inc, line 527 - A standard Views filter for a single date field, using Date API form selectors and sql handling.
Class
- date_views_filter_handler_simple
- @file A standard Views filter for a single date field, using Date API form selectors and sql handling.
Code
function admin_summary() {
$parts = $this->date_handler->date_parts();
$widget_options = $this->widget_options();
// If the filter is exposed, display the granularity.
if ($this->options['exposed']) {
return t('<strong>Exposed</strong> @widget @format', array('@format' => $parts[$this->date_handler->granularity], '@widget' => $widget_options[$this->options['form_type']]));
}
// If not exposed, display the value.
$output = '';
if (in_array($this->operator, $this->operator_values(2))) {
$min = check_plain(!empty($this->options['default_date']) ? $this->options['default_date'] : $this->options['value']['min']);
$max = check_plain(!empty($this->options['default_to_date']) ? $this->options['default_to_date'] : $this->options['value']['max']);
$output .= t('@min and @max', array('@min' => $min, '@max' => $max));
}
else {
$output .= check_plain(!empty($this->options['default_date']) ? $this->options['default_date'] : $this->options['value']['value']);
}
return $output;
}