From c7bcfbf8649c01af19bf516b46b16d1fcf0eba5d Mon Sep 17 00:00:00 2001 From: Pawel Boguslawski Date: Thu, 16 Jan 2025 14:47:14 +0100 Subject: 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 Signed-off-by: Andy Scherzinger --- apps/files/lib/Controller/ViewController.php | 1 + 1 file changed, 1 insertion(+) (limited to 'apps/files/lib/Controller/ViewController.php') 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()); -- cgit v1.2.3