appManager->isEnabledForUser('calendar'); $contactsEnabled = $this->appManager->isEnabledForUser('contacts'); $this->initialState->provideInitialState('calendarEnabled', $calendarEnabled); $this->initialState->provideInitialState('contactsEnabled', $contactsEnabled); if ($calendarEnabled) { $enableDefaultEvent = $this->exampleEventService->shouldCreateExampleEvent(); $this->initialState->provideInitialState('create_example_event', $enableDefaultEvent); $this->initialState->provideInitialState( 'has_custom_example_event', $this->exampleEventService->hasCustomExampleEvent(), ); } if ($contactsEnabled) { $this->initialState->provideInitialState( 'enableDefaultContact', $this->exampleContactService->isDefaultContactEnabled(), ); $this->initialState->provideInitialState( 'hasCustomDefaultContact', $this->appConfig->getAppValueBool('hasCustomDefaultContact'), ); } return new TemplateResponse(Application::APP_ID, 'settings-example-content'); } public function getSection(): ?string { if (!$this->appManager->isEnabledForUser('contacts') && !$this->appManager->isEnabledForUser('calendar')) { return null; } return 'groupware'; } public function getPriority(): int { return 10; } }