public function DisplayPluginBase::usesExposed

Determine if this display uses exposed filters, so the view will know whether or not to build them.

5 calls to DisplayPluginBase::usesExposed()
4 methods override DisplayPluginBase::usesExposed()

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 201
Contains Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Namespace

Drupal\views\Plugin\views\display

Code

public function usesExposed() {
  if (!isset($this->has_exposed)) {
    foreach ($this->handlers as $type => $value) {
      foreach ($this->view->{$type} as $id => $handler) {
        if ($handler
          ->canExpose() && $handler
          ->isExposed()) {

          // one is all we need; if we find it, return true.
          $this->has_exposed = TRUE;
          return TRUE;
        }
      }
    }
    $pager = $this
      ->getPlugin('pager');
    if (isset($pager) && $pager
      ->usesExposed()) {
      $this->has_exposed = TRUE;
      return TRUE;
    }
    $this->has_exposed = FALSE;
  }
  return $this->has_exposed;
}