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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2021-01-20 01:38:35 +0300
committerGitHub <noreply@github.com>2021-01-20 01:38:35 +0300
commitf5057ca78105400e60d92fd912fc36569af36765 (patch)
tree875de1c3558d7832010e24bbf99e3b3bc853efa9 /core
parent8e344bd42c5986d524a6147699f2319dc4e45ee1 (diff)
Show site selector as text only when only one site is available (#16972)
* Show site selector as text only when only one site is available * updates expected UI files * hide site selector from header when there is only one website overall
Diffstat (limited to 'core')
-rw-r--r--core/Plugin/Controller.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php
index 5fa9b290c8..3188c0eafb 100644
--- a/core/Plugin/Controller.php
+++ b/core/Plugin/Controller.php
@@ -751,7 +751,11 @@ abstract class Controller
$pluginManager = Plugin\Manager::getInstance();
$view->relativePluginWebDirs = (object) $pluginManager->getWebRootDirectoriesForCustomPluginDirs();
- $view->isMultiSitesEnabled = Manager::getInstance()->isPluginActivated('MultiSites');
+ $view->isMultiSitesEnabled = $pluginManager->isPluginActivated('MultiSites');
+ $view->isSingleSite = Access::doAsSuperUser(function() {
+ $allSites = Request::processRequest('SitesManager.getAllSitesId', [], []);
+ return count($allSites) === 1;
+ });
if (isset($this->site) && is_object($this->site) && $this->site instanceof Site) {
$view->siteName = $this->site->getName();