public function ViewEditFormController::submitDisplayDisable

Submit handler to disable display.

File

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

Class

ViewEditFormController
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

public function submitDisplayDisable($form, &$form_state) {
  $view = $this
    ->getEntity($form_state);
  $id = $form_state['display_id'];
  $view
    ->get('executable')->displayHandlers[$id]
    ->setOption('enabled', FALSE);

  // 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;
}