public function ViewEditFormController::submitDisplayEnable

Submit handler to enable a disabled display.

File

drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php, line 546
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
    ->getEntity($form_state);
  $id = $form_state['display_id'];

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

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