public function date_views_filter_handler_simple::admin_summary in Date 7.3
Same name and namespace in other branches
- 8 date_views/includes/date_views_filter_handler_simple.inc \date_views_filter_handler_simple::admin_summary()
- 7.2 date_views/includes/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
1 method overrides date_views_filter_handler_simple::admin_summary()
- date_views_filter_handler::admin_summary in date_views/
includes/ date_views_filter_handler.inc - Display the filter on the administrative summary.
File
- date_views/
includes/ date_views_filter_handler_simple.inc, line 657 - A standard Views filter for a single date field.
Class
- date_views_filter_handler_simple
- A standard Views filter for a single date field.
Code
public 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;
}