You are here

public function DisplayPluginBase::viewSpecialBlocks in Views (for Drupal 7) 8.3

Render any special blocks provided for this display.

File

lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 2664
Definition of 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 viewSpecialBlocks($type) {
  if ($type == '-exp') {

    // avoid interfering with the admin forms.
    if (arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'views') {
      return;
    }
    $this->view
      ->initHandlers();
    if ($this
      ->usesExposed() && $this
      ->getOption('exposed_block')) {
      $exposed_form = $this
        ->getPlugin('exposed_form');
      return array(
        'content' => $exposed_form
          ->render_exposed_form(TRUE),
      );
    }
  }
}