You are here

public function Natural::adminSummary in Views Natural Sort 8.2

Display whether or not the sort order is ascending or descending

Overrides SortPluginBase::adminSummary

File

src/Plugin/views/sort/Natural.php, line 96

Class

Natural
Sort plugin used to allow Natural Sorting.

Namespace

Drupal\views_natural_sort\Plugin\views\sort

Code

public function adminSummary() {
  if (!empty($this->options['exposed'])) {
    return $this
      ->t('Exposed');
  }
  $label = parent::adminSummary();
  switch ($this->options['order']) {
    case 'NASC':
      return $this
        ->t('natural asc');
    case 'NDESC':
      return $this
        ->t('natural asc');
    default:
      return $label;
  }
}