Conditions | 9 |
Paths | 3 |
Total Lines | 28 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function onNavigationConfigure(ConfigureMenuEvent $event) |
||
34 | { |
||
35 | foreach ((array) $this->settings->getSettings(SettingsProvider::DATA_PATH) as $setting) { |
||
36 | if (!$this->state->isEntityEnabled($setting['name'])) { |
||
37 | continue; |
||
38 | } |
||
39 | |||
40 | foreach ($setting['navigation_items'] as $item) { |
||
41 | $navigateArray = explode('.', $item); |
||
42 | $menu = $event->getMenu(); |
||
43 | |||
44 | if ($menu->getName() !== $navigateArray[0]) { |
||
45 | continue; |
||
46 | } |
||
47 | |||
48 | $navigateArrayCount = count($navigateArray); |
||
49 | for ($i = 1; $i < $navigateArrayCount; $i++) { |
||
50 | if ($menu->getChild($navigateArray[$i])) { |
||
51 | /** redefinition of variable $menu */ |
||
52 | $menu = $menu->getChild($navigateArray[$i]); |
||
53 | } |
||
54 | if ($menu && !$menu->isDisplayed()) { |
||
55 | $menu->setDisplay(true); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 | } |
||
61 | } |
||
62 |