You are here

public function DisplayPluginBase::usesExposed in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::usesExposed()

Determines if this display uses exposed filters.

Overrides DisplayPluginInterface::usesExposed

5 calls to DisplayPluginBase::usesExposed()
Attachment::usesExposed in core/modules/views/src/Plugin/views/display/Attachment.php
Attachment displays only use exposed widgets if they are set to inherit the exposed filter settings of their parent display.
Block::buildOptionsForm in core/modules/views/src/Plugin/views/display/Block.php
Provide the default form for setting options.
Block::usesExposed in core/modules/views/src/Plugin/views/display/Block.php
Block views use exposed widgets only if AJAX is set.
DisplayPluginBase::preExecute in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Sets up any variables on the view prior to execution.
DisplayPluginBase::viewExposedFormBlocks in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Renders the exposed form as block.
4 methods override DisplayPluginBase::usesExposed()
Attachment::usesExposed in core/modules/views/src/Plugin/views/display/Attachment.php
Attachment displays only use exposed widgets if they are set to inherit the exposed filter settings of their parent display.
Block::usesExposed in core/modules/views/src/Plugin/views/display/Block.php
Block views use exposed widgets only if AJAX is set.
EntityReference::usesExposed in core/modules/views/src/Plugin/views/display/EntityReference.php
Determines if this display uses exposed filters.
RestExport::usesExposed in core/modules/rest/src/Plugin/views/display/RestExport.php
Determines if this display uses exposed filters.

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 247
Contains \Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
Base class for views display plugins.

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 $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;
}