File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1717 */
1818class GetUserNavigationListener
1919{
20-
20+ /**
21+ * @var RouterInterface
22+ */
2123 private $ _routerInterface ;
2224
25+ /**
26+ * GetUserNavigationListener constructor.
27+ * @param RouterInterface $_routerInterface
28+ */
2329 public function __construct (RouterInterface $ _routerInterface )
2430 {
2531 $ this ->_routerInterface = $ _routerInterface ;
@@ -32,12 +38,16 @@ public function __construct(RouterInterface $_routerInterface)
3238 */
3339 public function __invoke (array $ modules , bool $ showAll ): array
3440 {
35- $ modules ['agentur1601com ' ]['modules ' ]['core ' ] = [
36- 'label ' => 'Unterstützen ' ,
37- 'title ' => 'The core bundle ' ,
38- 'class ' => 'agentur1601com ' ,
39- 'href ' => $ this ->_routerInterface ->generate ('agentur1601com_core_backend ' ),
40- ];
41+ $ user = \Contao \BackendUser::getInstance ();
42+
43+ if ($ user ->hasAccess (['core ' ], 'modules ' )) {
44+ $ modules ['agentur1601com ' ]['modules ' ]['core ' ] = [
45+ 'label ' => 'Unterstützen ' ,
46+ 'title ' => 'The core bundle ' ,
47+ 'class ' => 'agentur1601com ' ,
48+ 'href ' => $ this ->_routerInterface ->generate ('agentur1601com_core_backend ' ),
49+ ];
50+ }
4151
4252 return $ modules ;
4353 }
Original file line number Diff line number Diff line change 1414// Hook for backend menu entry
1515$ GLOBALS ['TL_HOOKS ' ]['getUserNavigation ' ][] = ['Agentur1601com \\CoreBundle \\EventListener \\GetUserNavigationListener ' , '__invoke ' ];
1616
17+
1718// Load backend style sheet
1819if (TL_MODE == "BE " ) {
1920 $ GLOBALS ['TL_CSS ' ][] = '/bundles/agentur1601comcore/css/be_core_style.css ' ;
20- }
21+ }
You can’t perform that action at this time.
0 commit comments