// Always allow a display to be deleted.
$build['top'
]['actions'
]['delete'
] =
[ '#type' => 'submit',
'#value' =>
$this->
t('Delete @display_title',
['@display_title' =>
$display_title]),
'#limit_validation_errors' =>
[],
'#submit' =>
['::submitDisplayDelete', '::submitDelayDestination'
],
'#prefix' => '<li class="delete">',
"#suffix" => '</li>',
];
foreach (Views::
fetchPluginNames('display', NULL,
[$view->
get('storage'
)->
get('base_table'
)]) as $type =>
$label) { if ($type ==
$display['display_plugin'
]) { continue;
} $build['top'
]['actions'
]['duplicate_as'
][$type] =
[ '#type' => 'submit',
'#value' =>
$this->
t('Duplicate as @type',
['@type' =>
$label]),
'#limit_validation_errors' =>
[],
'#submit' =>
['::submitDuplicateDisplayAsType', '::submitDelayDestination'
],
'#prefix' => '<li class="duplicate">',
'#suffix' => '</li>',
];