aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-12-18 16:30:51 +0100
committerLouis Chemineau <louis@chmn.me>2023-12-19 10:21:13 +0100
commita39b3a3d84e5f10672972a642e4512ee94dd54d5 (patch)
treebeb84555f1bfab0c93848d12a2d2224cfd4825e2 /lib
parentbfee3167b33f3452e81caa4828f43c2f9dec71e9 (diff)
downloadnextcloud-server-a39b3a3d84e5f10672972a642e4512ee94dd54d5.tar.gz
nextcloud-server-a39b3a3d84e5f10672972a642e4512ee94dd54d5.zip
Add global accessibility switch
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Template/JSConfigHelper.php3
-rw-r--r--lib/private/TemplateLayout.php4
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index 057caaaf2fe..8cba93f1f4e 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -179,7 +179,8 @@ class JSConfigHelper {
'sharing.maxAutocompleteResults' => max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)),
'sharing.minSearchStringLength' => $this->config->getSystemValueInt('sharing.minSearchStringLength', 0),
'version' => implode('.', Util::getVersion()),
- 'versionstring' => \OC_Util::getVersionString()
+ 'versionstring' => \OC_Util::getVersionString(),
+ 'enable_non-accessible_features' => $this->config->getSystemValueBool('enable_non-accessible_features', true),
];
$array = [
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 13ac3c5ef48..96d0ae3e517 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -108,8 +108,8 @@ class TemplateLayout extends \OC_Template {
$this->initialState->provideInitialState('core', 'active-app', $this->navigationManager->getActiveEntry());
$this->initialState->provideInitialState('core', 'apps', $this->navigationManager->getAll());
-
- if ($this->config->getSystemValueBool('unified_search.enabled', false)) {
+
+ if ($this->config->getSystemValueBool('unified_search.enabled', false) || !$this->config->getSystemValueBool('enable_non-accessible_features', true)) {
$this->initialState->provideInitialState('unified-search', 'limit-default', (int)$this->config->getAppValue('core', 'unified-search.limit-default', (string)SearchQuery::LIMIT_DEFAULT));
$this->initialState->provideInitialState('unified-search', 'min-search-length', (int)$this->config->getAppValue('core', 'unified-search.min-search-length', (string)1));
$this->initialState->provideInitialState('unified-search', 'live-search', $this->config->getAppValue('core', 'unified-search.live-search', 'yes') === 'yes');