registerCapability(Capabilities::class); $context->registerDashboardWidget(CalendarWidget::class); $context->registerProfileLinkAction(AppointmentsAction::class); $context->registerReferenceProvider(ReferenceProvider::class); $context->registerEventListener(BeforeAppointmentBookedEvent::class, AppointmentBookedListener::class); $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); $context->registerEventListener(RenderReferenceEvent::class, CalendarReferenceListener::class); $context->registerEventListener(CalendarObjectCreatedEvent::class, NotifyPushListener::class); $context->registerEventListener(CalendarObjectUpdatedEvent::class, NotifyPushListener::class); $context->registerEventListener(CalendarObjectDeletedEvent::class, NotifyPushListener::class); $context->registerNotifierService(Notifier::class); $context->registerUserMigrator(Migrator::class); } /** * @inheritDoc */ #[\Override] public function boot(IBootContext $context): void { $this->addContactsMenuScript($context->getServerContainer()); } private function addContactsMenuScript(ContainerInterface $container): void { // User needs to be logged in to fetch availability -> disable the feature otherwise /** @var IUserSession $userSession */ $userSession = $container->get(IUserSession::class); if (!$userSession->isLoggedIn()) { return; } // The contacts menu/avatar is potentially shown everywhere so an event based loading // mechanism doesn't make sense here Util::addScript(self::APP_ID, 'calendar-contacts-menu'); } }