Skip to content
Snippets Groups Projects
Commit 4e957743 authored by Tatiana Kiseleva's avatar Tatiana Kiseleva Committed by Sascha Eggenberger
Browse files

Issue #3310619 by kiseleva.t: Use admin toolbar menu depth from settings if enabled

parent 03d3126c
Branches
Tags
No related merge requests found
......@@ -46,7 +46,9 @@ class GinToolbar implements TrustedCallbackInterface {
->onlyEnabledLinks();
if (\Drupal::moduleHandler()->moduleExists('admin_toolbar')) {
$parameters->setMaxDepth(4);
$admin_toolbar_settings = \Drupal::config('admin_toolbar.settings');
$max_depth = $admin_toolbar_settings->get('menu_depth') ?? 4;
$parameters->setMaxDepth($max_depth);
}
$tree = $menu_tree->load('admin', $parameters);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment