function claro_views_ui_display_top_alter in Drupal 8
Same name and namespace in other branches
- 9 core/themes/claro/claro.theme \claro_views_ui_display_top_alter()
Implements hook_views_ui_display_top_alter().
File
- core/
themes/ claro/ claro.theme, line 542 - Functions to support theming in the Claro theme.
Code
function claro_views_ui_display_top_alter(&$element) {
// @todo remove this after https://www.drupal.org/node/3051605 has been
// solved.
$element['tabs']['#prefix'] = preg_replace('/(class="(.+\\s)?)tabs(\\s.+"|")/', '$1views-tabs$3', $element['tabs']['#prefix']);
$element['tabs']['#prefix'] = preg_replace('/(class="(.+\\s)?)secondary(\\s.+"|")/', '$1views-tabs--secondary$3', $element['tabs']['#prefix']);
foreach (Element::children($element['tabs']) as $tab) {
$element['tabs'][$tab]['#theme'] = 'menu_local_task__views_ui';
}
// Change top extra actions to use the small dropbutton variant.
// @todo Revisit after https://www.drupal.org/node/3057581 is added.
if (!empty($element['extra_actions'])) {
$element['extra_actions']['#dropbutton_type'] = 'small';
}
}