You are here

public function HandlerBase::showExposeForm in Views (for Drupal 7) 8.3

Shortcut to display the exposed options form.

2 calls to HandlerBase::showExposeForm()
FilterPluginBase::buildOptionsForm in lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
Provide the basic form which calls through to subforms. If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.
SortPluginBase::buildOptionsForm in lib/Drupal/views/Plugin/views/sort/SortPluginBase.php
Basic options for all sort criteria

File

lib/Drupal/views/Plugin/views/HandlerBase.php, line 442
Definition of Drupal\views\Plugin\views\HandlerBase.

Class

HandlerBase

Namespace

Drupal\views\Plugin\views

Code

public function showExposeForm(&$form, &$form_state) {
  if (empty($this->options['exposed'])) {
    return;
  }
  $this
    ->buildExposeForm($form, $form_state);

  // When we click the expose button, we add new gadgets to the form but they
  // have no data in $_POST so their defaults get wiped out. This prevents
  // these defaults from getting wiped out. This setting will only be TRUE
  // during a 2nd pass rerender.
  if (!empty($form_state['force_expose_options'])) {
    foreach (element_children($form['expose']) as $id) {
      if (isset($form['expose'][$id]['#default_value']) && !isset($form['expose'][$id]['#value'])) {
        $form['expose'][$id]['#value'] = $form['expose'][$id]['#default_value'];
      }
    }
  }
}