registerReferenceProvider(ProfilePickerReferenceProvider::class); $context->registerEventListener(RenderReferenceEvent::class, ProfilePickerReferenceListener::class); } #[\Override] public function boot(IBootContext $context): void { $context->injectFn($this->registerNavigationEntry(...)); } /** * Registers the navigation entry for the profile app in the user settings. * Needed as the href is dynamic and thus we cannot use the appinfo/info.xml */ public function registerNavigationEntry( INavigationManager $navigationManager, IUserSession $userSession, IURLGenerator $urlGenerator, ): void { if (!$userSession->isLoggedIn()) { return; } $l = Server::get(IFactory::class)->get('profile'); // Profile $navigationManager->add([ 'type' => 'settings', 'id' => 'profile', 'order' => 1, 'href' => $urlGenerator->linkToRoute( 'profile.ProfilePage.index', ['targetUserId' => $userSession->getUser()->getUID()], ), 'name' => $l->t('View profile'), ]); } }