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) { $enableDefaultContact = $this->config->getAppValue(Application::APP_ID, 'enableDefaultContact', 'yes'); $this->initialState->provideInitialState('enableDefaultContact', $enableDefaultContact); $this->initialState->provideInitialState( 'hasCustomDefaultContact', $this->appConfig->getValueBool(Application::APP_ID, '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; } }