public function ViewUI::submitDisplayAdd in Views (for Drupal 7) 8.3
Submit handler to add a display to a view.
File
- views_ui/
lib/ Drupal/ views_ui/ ViewUI.php, line 770 - Definition of Drupal\views_ui\ViewUI.
Class
- ViewUI
- Stores UI related temporary settings.
Namespace
Drupal\views_uiCode
public function submitDisplayAdd($form, &$form_state) {
// Create the new display.
$parents = $form_state['triggering_element']['#parents'];
$display_type = array_pop($parents);
$display_id = $this->storage
->addDisplay($display_type);
// A new display got added so the asterisks symbol should appear on the new
// display.
$this->current_display = $display_id;
views_ui_cache_set($this);
// Redirect to the new display's edit page.
$form_state['redirect'] = 'admin/structure/views/view/' . $this->storage->name . '/edit/' . $display_id;
}