diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-02-23 13:00:17 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-02-23 13:00:17 +0300 |
commit | 314245585b5118b1084169a41e405b8e9fdc860c (patch) | |
tree | ca13326fdb8a0e68dc56908d6dbac4806ec0a03a | |
parent | adf5a760a04b50ec4e538f7b2c9a7d8549ef4cae (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.md | 6 | ||||
-rw-r--r-- | lib/Listeners/FilesLoadAdditionalScriptsListener.php | 4 |
2 files changed, 9 insertions, 1 deletions
@@ -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' ); } } |