Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-02-23 13:00:17 +0300
committerJulius Härtl <jus@bitgrid.net>2022-02-23 13:00:17 +0300
commit314245585b5118b1084169a41e405b8e9fdc860c (patch)
treeca13326fdb8a0e68dc56908d6dbac4806ec0a03a
parentadf5a760a04b50ec4e538f7b2c9a7d8549ef4cae (diff)
Allow to configure the default if rich workspaces are enabled for usersenh/noid/workspace-default-setting
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--README.md6
-rw-r--r--lib/Listeners/FilesLoadAdditionalScriptsListener.php4
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 6149da14f..df83ff16b 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,12 @@ The rich workspaces in the file list can be disabled either by the users in the
occ config:app:set text workspace_available --value=0
```
+The default availability of the rich workspace feature can be adjusted through the following option, which would make the feature disabled by default, but users could still enable it individually:
+
+```bash
+occ config:app:set text workspace_default_enable --value=0
+```
+
## 🏗 Development setup
diff --git a/lib/Listeners/FilesLoadAdditionalScriptsListener.php b/lib/Listeners/FilesLoadAdditionalScriptsListener.php
index 855202f10..e56a790b1 100644
--- a/lib/Listeners/FilesLoadAdditionalScriptsListener.php
+++ b/lib/Listeners/FilesLoadAdditionalScriptsListener.php
@@ -63,10 +63,12 @@ class FilesLoadAdditionalScriptsListener implements IEventListener {
'workspace_available',
$this->config->getAppValue(Application::APP_NAME, 'workspace_available', '1') === '1'
);
+
+ $workspaceDefault = $this->config->getAppValue(Application::APP_NAME, 'workspace_default_enable', '1') === '1';
$this->initialStateService->provideInitialState(
Application::APP_NAME,
'workspace_enabled',
- $this->config->getUserValue($this->userSession->getUser()->getUID(), Application::APP_NAME, 'workspace_enabled', '1') === '1'
+ $this->config->getUserValue($this->userSession->getUser()->getUID(), Application::APP_NAME, 'workspace_enabled', $workspaceDefault) === '1'
);
}
}