public function ViewEditFormController::submitDisplayUndoDelete

Submit handler to add a restore a removed display to a view.

File

drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php, line 528
Contains Drupal\views_ui\ViewEditFormController.

Class

ViewEditFormController
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

public function submitDisplayUndoDelete($form, &$form_state) {
  $view = $this
    ->getEntity($form_state);

  // Create the new display
  $id = $form_state['display_id'];
  $displays = $view
    ->get('display');
  $displays[$id]['deleted'] = FALSE;
  $view
    ->set('display', $displays);

  // Store in cache
  views_ui_cache_set($view);

  // Redirect to the top-level edit page.
  $form_state['redirect'] = 'admin/structure/views/view/' . $view
    ->get('name') . '/edit/' . $id;
}