You are here

function views_handler_filter_field_partial_date_year::admin_summary in Partial Date 7

Display the filter on the administrative summary.

Overrides views_handler_filter_numeric::admin_summary

File

includes/partial_date.views.year_period_handler.inc, line 246

Class

views_handler_filter_field_partial_date_year
TODO: This is a placeholder to eventually provide a exposed list filter based on the field approximate year values.

Code

function admin_summary() {
  if (!empty($this->options['exposed'])) {
    return t('exposed');
  }
  $options = $this
    ->operator_options('short');
  $output = check_plain($options[$this->operator]);
  if (in_array($this->operator, $this
    ->operator_values(2))) {
    $output .= ' ' . t('@min and @max', array(
      '@min' => $this->value['min'],
      '@max' => $this->value['max'],
    ));
  }
  elseif (in_array($this->operator, $this
    ->operator_values(1))) {
    $output .= ' ' . check_plain($this->value['value']);
  }
  return $output;
}