You are here

function ExposedFormPluginBase::reset_form in Views (for Drupal 7) 8.3

1 call to ExposedFormPluginBase::reset_form()
ExposedFormPluginBase::exposed_form_submit in lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php
This function is executed when exposed form is submited.

File

lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php, line 293
Definition of Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase.

Class

ExposedFormPluginBase
The base plugin to handle exposed filter forms.

Namespace

Drupal\views\Plugin\views\exposed_form

Code

function reset_form(&$form, &$form_state) {

  // _SESSION is not defined for users who are not logged in.
  // If filters are not overridden, store the 'remember' settings on the
  // default display. If they are, store them on this display. This way,
  // multiple displays in the same view can share the same filters and
  // remember settings.
  $display_id = $this->view->display_handler
    ->isDefaulted('filters') ? 'default' : $this->view->current_display;
  if (isset($_SESSION['views'][$this->view->storage->name][$display_id])) {
    unset($_SESSION['views'][$this->view->storage->name][$display_id]);
  }

  // Set the form to allow redirect.
  if (empty($this->view->live_preview)) {
    $form_state['no_redirect'] = FALSE;
  }
  else {
    $form_state['rebuild'] = TRUE;
    $this->view->exposed_data = array();
  }
  $form_state['values'] = array();
}