You are here

function views_plugin_display::uses_exposed in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 plugins/views_plugin_display.inc \views_plugin_display::uses_exposed()
  2. 7.3 plugins/views_plugin_display.inc \views_plugin_display::uses_exposed()

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

4 calls to views_plugin_display::uses_exposed()
views_plugin_display::pre_execute in plugins/views_plugin_display.inc
Set up any variables on the view prior to execution. These are separated from execute because they are extremely common and unlikely to be overridden on an individual display.
views_plugin_display::view_special_blocks in plugins/views_plugin_display.inc
Render any special blocks provided for this display.
views_plugin_display_attachment::uses_exposed in plugins/views_plugin_display_attachment.inc
Attachment displays only use exposed widgets if they are set to inherit the exposed filter settings of their parent display.
views_plugin_display_block::uses_exposed in plugins/views_plugin_display_block.inc
Block views use exposed widgets only if AJAX is set.
2 methods override views_plugin_display::uses_exposed()
views_plugin_display_attachment::uses_exposed in plugins/views_plugin_display_attachment.inc
Attachment displays only use exposed widgets if they are set to inherit the exposed filter settings of their parent display.
views_plugin_display_block::uses_exposed in plugins/views_plugin_display_block.inc
Block views use exposed widgets only if AJAX is set.

File

plugins/views_plugin_display.inc, line 230
Contains the base display plugin.

Class

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

Code

function uses_exposed() {
  if (!isset($this->has_exposed)) {
    foreach ($this->handlers as $type => $value) {
      foreach ($this->view->{$type} as $id => $handler) {
        if ($handler
          ->can_expose() && $handler
          ->is_exposed()) {

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