diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index cb34fe3c6..4371aa5f4 100644 --- a/lib/Listener/BeforeTemplateRenderedListener.php +++ b/lib/Listener/BeforeTemplateRenderedListener.php @@ -17,9 +17,9 @@ class BeforeTemplateRenderedListener implements IEventListener { public function __construct( protected INavigationManager $navigationManager, - protected IURLGenerator $urlGenerator, - protected IUserSession $userSession, - protected ContextService $contextService, + protected IURLGenerator $urlGenerator, + protected IUserSession $userSession, + protected ContextService $contextService, ) { } @@ -36,25 +36,22 @@ public function handle(Event $event): void { return; } - // temporarily show all - //$contexts = $this->contextService->findForNavigation($user->getUID()); - $contexts = $this->contextService->findAll($user->getUID()); + $contexts = $this->contextService->findForNavigation($user->getUID()); foreach ($contexts as $context) { - /* temporarily, show all if ($context->getOwnerType() === Application::OWNER_TYPE_USER && $context->getOwnerId() === $user->getUID()) { - // filter out entries for owners unless it is set to be visible $skipEntry = true; foreach ($context->getSharing() as $shareInfo) { // TODO: integrate into DB query in Mapper - if (isset($shareInfo['display_mode']) && $shareInfo['display_mode'] === Application::NAV_ENTRY_MODE_ALL) { // a custom override makes it visible $skipEntry = false; break; - } elseif (!isset($shareInfo['display_mode']) && $shareInfo['display_mode_default'] === Application::NAV_ENTRY_MODE_ALL) { + } + + if (!isset($shareInfo['display_mode']) && $shareInfo['display_mode_default'] === Application::NAV_ENTRY_MODE_ALL) { // no custom override, and visible also for owner by default $skipEntry = false; break; @@ -64,7 +61,6 @@ public function handle(Event $event): void { continue; } } - */ $this->navigationManager->add(function () use ($context) { $iconRelPath = 'material/' . $context->getIcon() . '.svg';