// Add a div to show the selected items
$form['selected'
] =
[ '#type' => 'item',
'#markup' => '<span class="views-ui-view-title">' .
$this->
t('Selected:'
) . '</span> ' . '<div class="views-selected-options"></div>',
'#theme_wrappers' =>
['form_element', 'views_ui_container'
],
'#attributes' =>
[ 'class' =>
['container-inline', 'views-add-form-selected', 'views-offset-bottom'
],
'data-drupal-views-offset' => 'bottom',
],
];
$view->
getStandardButtons($form,
$form_state, 'views_ui_add_handler_form',
$this->
t('Add and configure @types',
['@types' =>
$ltitle]));
// Remove the default submit function.
$form['actions'
]['submit'
]['#submit'
] =
array_filter($form['actions'
]['submit'
]['#submit'
],
function D
$var) { return !
(is_array($var) &&
isset($var[1
]) &&
$var[1
] == 'standardSubmit'
);
});
$form['actions'
]['submit'
]['#submit'
][] =
[$view, 'submitItemAdd'
];
return $form;
}}