core/modules/shortcut/shortcut.module | 56 ++++++++++++++++------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index a932954117..29c389b9ec 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -411,40 +411,36 @@ function shortcut_toolbar() { if ($user->hasPermission('access shortcuts')) { $shortcut_set = shortcut_current_displayed_set(); - // @todo Use a cache context to vary this for users that have links and - // those who don't. - if (TRUE || !empty($links) || !empty($configure_link)) { - - $items['shortcuts'] += [ - '#type' => 'toolbar_item', - 'tab' => [ - '#type' => 'link', - '#title' => t('Shortcuts'), - '#url' => $shortcut_set->toUrl('collection'), - '#attributes' => [ - 'title' => t('Shortcuts'), - 'class' => ['toolbar-icon', 'toolbar-icon-shortcut'], - ], + + $items['shortcuts'] += [ + '#type' => 'toolbar_item', + 'tab' => [ + '#type' => 'link', + '#title' => t('Shortcuts'), + '#url' => $shortcut_set->toUrl('collection'), + '#attributes' => [ + 'title' => t('Shortcuts'), + 'class' => ['toolbar-icon', 'toolbar-icon-shortcut'], ], - 'tray' => [ - '#heading' => t('User-defined shortcuts'), - 'children' => [ - '#lazy_builder' => ['shortcut_toolbar_lazybuilder_links', []], - '#create_placeholder' => TRUE, - '#cache' => [ - 'keys' => ['shortcut_set_toolbar_links'], - 'contexts' => ['user'], - ], + ], + 'tray' => [ + '#heading' => t('User-defined shortcuts'), + 'children' => [ + '#lazy_builder' => ['shortcut_toolbar_lazybuilder_links', []], + '#create_placeholder' => TRUE, + '#cache' => [ + 'keys' => ['shortcut_set_toolbar_links'], + 'contexts' => ['user'], ], ], - '#weight' => -10, - '#attached' => [ - 'library' => [ - 'shortcut/drupal.shortcut', - ], + ], + '#weight' => -10, + '#attached' => [ + 'library' => [ + 'shortcut/drupal.shortcut', ], - ]; - } + ], + ]; } return $items;