public function ViewEditFormController::submitDisplayEnable

Submit handler to enable a disabled display.

File

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

Class

ViewEditFormController
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

public function submitDisplayEnable($form, &$form_state) {
  $view = $this->entity;
  $id = $form_state['display_id'];

  // setOption doesn't work because this would might affect upper displays
  $view
    ->get('executable')->displayHandlers
    ->get($id)
    ->setOption('enabled', TRUE);

  // Store in cache
  $view
    ->cacheSet();

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