$element['add_display'
][$type] =
[ '#type' => 'submit',
'#value' =>
$this->
t('Add @display',
['@display' =>
$label]),
'#limit_validation_errors' =>
[],
'#submit' =>
['::submitDisplayAdd', '::submitDelayDestination'
],
'#attributes' =>
[ 'class' =>
['add-display'
],
'data-drupal-dropdown-label' =>
$label,
],
// Allow JavaScript to remove the 'Add ' prefix from the button label when
// placing the button in an "Add" dropdown menu.
'#process' =>
array_merge(['views_ui_form_button_was_clicked'
],
$this->elementInfo->
getInfoProperty('submit', '#process',
[])),
'#values' =>
[$this->
t('Add @display',
['@display' =>
$label]),
$label],
];
} // In AJAX context, ViewUI::rebuildCurrentTab() returns this outside of form
// context, so hook_form_view_edit_form_alter() is insufficient.
// @todo remove this after
// https://www.drupal.org/project/drupal/issues/3087455 has been resolved.
$this->moduleHandler->
alter('views_ui_display_top',
$element,
$view,
$display_id);
// Because themes can implement hook_form_FORM_ID_alter() and because this
// is a workaround for hook_form_view_edit_form_alter() being insufficient,