diff --git a/composer/composer/autoload_classmap.php b/composer/composer/autoload_classmap.php index daa77de7338..c602abf082c 100644 --- a/composer/composer/autoload_classmap.php +++ b/composer/composer/autoload_classmap.php @@ -9,6 +9,7 @@ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'OCA\\Text\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', 'OCA\\Text\\Command\\ResetDocument' => $baseDir . '/../lib/Command/ResetDocument.php', + 'OCA\\Text\\ConfigLexicon' => $baseDir . '/../lib/ConfigLexicon.php', 'OCA\\Text\\Controller\\AttachmentController' => $baseDir . '/../lib/Controller/AttachmentController.php', 'OCA\\Text\\Controller\\ISessionAwareController' => $baseDir . '/../lib/Controller/ISessionAwareController.php', 'OCA\\Text\\Controller\\NavigationController' => $baseDir . '/../lib/Controller/NavigationController.php', diff --git a/composer/composer/autoload_static.php b/composer/composer/autoload_static.php index ef2fa93317e..255d55aac46 100644 --- a/composer/composer/autoload_static.php +++ b/composer/composer/autoload_static.php @@ -24,6 +24,7 @@ class ComposerStaticInitText 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'OCA\\Text\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', 'OCA\\Text\\Command\\ResetDocument' => __DIR__ . '/..' . '/../lib/Command/ResetDocument.php', + 'OCA\\Text\\ConfigLexicon' => __DIR__ . '/..' . '/../lib/ConfigLexicon.php', 'OCA\\Text\\Controller\\AttachmentController' => __DIR__ . '/..' . '/../lib/Controller/AttachmentController.php', 'OCA\\Text\\Controller\\ISessionAwareController' => __DIR__ . '/..' . '/../lib/Controller/ISessionAwareController.php', 'OCA\\Text\\Controller\\NavigationController' => __DIR__ . '/..' . '/../lib/Controller/NavigationController.php', diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 8b069b3823f..d8ad0de0897 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -49,6 +49,8 @@ public function __construct(array $params = []) { } public function register(IRegistrationContext $context): void { + $context->registerConfigLexicon(\OCA\Text\ConfigLexicon::class); + $context->registerEventListener(RegisterDirectEditorEvent::class, RegisterDirectEditorEventListener::class); $context->registerEventListener(LoadViewer::class, LoadViewerListener::class); $context->registerEventListener(LoadAdditionalScriptsEvent::class, FilesLoadAdditionalScriptsListener::class); diff --git a/lib/ConfigLexicon.php b/lib/ConfigLexicon.php new file mode 100644 index 00000000000..8a7a5a48ba7 --- /dev/null +++ b/lib/ConfigLexicon.php @@ -0,0 +1,80 @@ +appConfig->getValueString(Application::APP_NAME, 'open_read_only_enabled', '0') === '1'; + return $this->appConfig->getValueBool(Application::APP_NAME, 'open_read_only_enabled'); } public function isRichEditingEnabled(): bool { - return ($this->appConfig->getValueString(Application::APP_NAME, 'rich_editing_enabled', '1') === '1'); + return $this->appConfig->getValueBool(Application::APP_NAME, 'rich_editing_enabled', true); } public function isRichWorkspaceAvailable(): bool { if ($this->config->getSystemValueBool('enable_non-accessible_features', true) === false) { return false; } - return $this->appConfig->getValueString(Application::APP_NAME, 'workspace_available', '1') === '1'; + return $this->appConfig->getValueBool(Application::APP_NAME, 'workspace_available', true); } public function isRichWorkspaceEnabledForUser(?string $userId): bool {