You are here

public function GoogleAnalyticsNumeric::adminSummary in Google Analytics Reports 8.3

Display the filter on the administrative summary

Overrides FilterPluginBase::adminSummary

File

src/Plugin/views/filter/GoogleAnalyticsNumeric.php, line 186

Class

GoogleAnalyticsNumeric
Simple filter to handle numerics for Google Analytics.

Namespace

Drupal\google_analytics_reports\Plugin\views\filter

Code

public function adminSummary() {
  if (!empty($this->options['exposed'])) {
    return $this
      ->t('exposed');
  }
  $options = $this
    ->operatorOptions('short');
  $output = Html::escape($options[$this->operator]);
  if (in_array($this->operator, $this
    ->operatorValues(2))) {
    $output .= ' ' . $this
      ->t('@min and @max', [
      '@min' => $this->value['min'],
      '@max' => $this->value['max'],
    ]);
  }
  elseif (in_array($this->operator, $this
    ->operatorValues(1))) {
    $output .= ' ' . Html::escape($this->value['value']);
  }
  return $output;
}