public function ViewPreviewFormController::submitPreview

Form submission handler for the Preview button.

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php, line 133
Contains Drupal\views_ui\ViewPreviewFormController.

Class

ViewPreviewFormController
Form controller for the Views preview form.

Namespace

Drupal\views_ui

Code

public function submitPreview($form, &$form_state) {

  // Rebuild the form with a pristine $view object.
  $view = $this->entity;

  // Attempt to load the view from temp store, otherwise create a new one.
  if (!($new_view = $this->tempStore
    ->get($view
    ->id()))) {
    $new_view = new ViewUI($view);
  }
  $form_state['build_info']['args'][0] = $new_view;
  $form_state['show_preview'] = TRUE;
  $form_state['rebuild'] = TRUE;
}