function claro_views_ui_display_top_alter

Same name in other branches
  1. 9 core/themes/claro/claro.theme \claro_views_ui_display_top_alter()
  2. 10 core/themes/claro/claro.theme \claro_views_ui_display_top_alter()
  3. 11.x 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

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';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.