You are here

public function ViewUI::submitDisplayDelete in Views (for Drupal 7) 8.3

Submit handler to delete a display from a view.

File

views_ui/lib/Drupal/views_ui/ViewUI.php, line 808
Definition of Drupal\views_ui\ViewUI.

Class

ViewUI
Stores UI related temporary settings.

Namespace

Drupal\views_ui

Code

public function submitDisplayDelete($form, &$form_state) {
  $display_id = $form_state['display_id'];

  // Mark the display for deletion.
  $this->storage->display[$display_id]['deleted'] = TRUE;
  views_ui_cache_set($this);

  // Redirect to the top-level edit page. The first remaining display will
  // become the active display.
  $form_state['redirect'] = 'admin/structure/views/view/' . $this->storage->name;
}