upgrades core to 8.4.2
This commit is contained in:
@@ -149,7 +149,7 @@ function toolbar_toolbar() {
|
||||
],
|
||||
],
|
||||
'#wrapper_attributes' => [
|
||||
'class' => ['hidden', 'home-toolbar-tab'],
|
||||
'class' => ['home-toolbar-tab'],
|
||||
],
|
||||
'#attached' => [
|
||||
'library' => [
|
||||
@@ -276,6 +276,18 @@ function toolbar_menu_navigation_links(array $tree) {
|
||||
return $tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_HOOK() for HTML document templates.
|
||||
*/
|
||||
function toolbar_preprocess_html(&$variables) {
|
||||
if (!\Drupal::currentUser()->hasPermission('access toolbar')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$variables['attributes'] = new Attribute($variables['attributes']);
|
||||
$variables['attributes']->addClass(['toolbar-tray-open', 'toolbar-horizontal', 'toolbar-fixed', 'toolbar-loading']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rendered subtree of each top-level toolbar link.
|
||||
*
|
||||
@@ -333,7 +345,7 @@ function _toolbar_do_get_rendered_subtrees(array $data) {
|
||||
// Many routes have dots as route name, while some special ones like <front>
|
||||
// have <> characters in them.
|
||||
$url = $link->getUrlObject();
|
||||
$id = str_replace(['.', '<', '>'], ['-', '', '' ], $url->isRouted() ? $url->getRouteName() : $url->getUri());
|
||||
$id = str_replace(['.', '<', '>'], ['-', '', ''], $url->isRouted() ? $url->getRouteName() : $url->getUri());
|
||||
|
||||
$subtrees[$id] = $output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user