aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller/ViewController.php
diff options
context:
space:
mode:
authorPawel Boguslawski <pawel.boguslawski@ib.pl>2025-01-16 14:47:14 +0100
committerAndy Scherzinger <info@andy-scherzinger.de>2025-01-27 16:08:53 +0100
commitc7bcfbf8649c01af19bf516b46b16d1fcf0eba5d (patch)
tree9e474030a4e6d924d608ab8450983914bb89b9c4 /apps/files/lib/Controller/ViewController.php
parentb70654aeed6bec4befd65641717a6d167d6ddbd0 (diff)
downloadnextcloud-server-c7bcfbf8649c01af19bf516b46b16d1fcf0eba5d.tar.gz
nextcloud-server-c7bcfbf8649c01af19bf516b46b16d1fcf0eba5d.zip
fix: Hide "Create templates folder" option if templates are disabled in configuration
When both `skeletondirectory` and `templatedirectory` are set to empty strings in configuration, templates folder creation should be disabled and no Create templates folder option should be present in new folder menu. Related: https://github.com/nextcloud/server/issues/39266 Related: https://github.com/nextcloud/server/issues/46455 Author-Change-Id: IB#1156403 Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl> Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Diffstat (limited to 'apps/files/lib/Controller/ViewController.php')
-rw-r--r--apps/files/lib/Controller/ViewController.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index 4dd9f4141e2..2c242040731 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -194,6 +194,7 @@ class ViewController extends Controller {
$this->eventDispatcher->dispatchTyped(new LoadViewer());
}
+ $this->initialState->provideInitialState('templates_enabled', ($this->config->getSystemValueString('skeletondirectory', '') !== '') || ($this->config->getSystemValueString('templatedirectory', '') !== ''));
$this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : false);
$this->initialState->provideInitialState('templates', $this->templateManager->listCreators());