public function SearchApiViewsHandlerFilterNumeric::admin_summary in Search API 7
Display the filter on the administrative summary
Overrides SearchApiViewsHandlerFilter::admin_summary
File
- contrib/
search_api_views/ includes/ handler_filter_numeric.inc, line 172 - Contains SearchApiViewsHandlerFilterNumeric.
Class
- SearchApiViewsHandlerFilterNumeric
- Views filter handler class for handling numeric and "string" fields.
Code
public function admin_summary() {
if (!empty($this->options['exposed'])) {
return t('exposed');
}
if ($this->operator === 'empty') {
return t('is empty');
}
if ($this->operator === 'not empty') {
return t('is not empty');
}
if (in_array($this->operator, array(
'between',
'not between',
), TRUE)) {
// This is of course wrong for translation purposes, but copied from
// views_handler_filter_numeric::admin_summary() so probably still better
// to re-use this than to do it correctly.
$operator = $this->operator === 'between' ? t('between') : t('not between');
$vars = array(
'@min' => (string) $this->value['min'],
'@max' => (string) $this->value['max'],
);
return $operator . ' ' . t('@min and @max', $vars);
}
return check_plain((string) $this->operator) . ' ' . check_plain((string) $this->value['value']);
}