diff --git a/core/PluginsManager.php b/core/PluginsManager.php index bbfec52d9a6be0fd2f8020931825c8d01218992e..e61b7195fce8700d4d1aba564bd90a9aa98568e2 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -282,13 +282,21 @@ class PluginsManager return; } + // Only one theme enabled at a time + $themeAlreadyEnabled = $this->getThemeEnabled(); + if($themeAlreadyEnabled) { + $plugin = $this->loadPlugin($pluginName); + if($plugin->isTheme()) { + $plugins = $this->deactivatePlugin( $themeAlreadyEnabled, $plugins ); + } + } + + // Load plugin $plugin = $this->loadPlugin($pluginName); if ($plugin === null) { return; } - $this->installPluginIfNecessary($plugin); - $plugin->activate(); // we add the plugin to the list of activated plugins @@ -297,12 +305,6 @@ class PluginsManager } $plugins = array_unique($plugins); - // Only one theme enabled at a time - $themeAlreadyEnabled = $this->getThemeEnabled(); - if($plugin->isTheme() - && $themeAlreadyEnabled) { - $plugins = $this->deactivatePlugin( $themeAlreadyEnabled, $plugins ); - } // the config file will automatically be saved with the new plugin $this->updatePluginsConfig($plugins); diff --git a/plugins/PleineLune/plugin.piwik.json b/plugins/PleineLune/plugin.piwik.json index a05e6aad75e9e6faa8a769df21d62ab4f2a34fc9..d0718e1737df0c46fdd25ea297f6a31e03850342 100644 --- a/plugins/PleineLune/plugin.piwik.json +++ b/plugins/PleineLune/plugin.piwik.json @@ -1,5 +1,5 @@ { "name": "PleineLune", - "description": "A dark theme for Piwik, ideal to view your analytics reports before sunrise!", + "description": "A dark theme for Piwik, ideal to view your analytics reports before sunrise.", "theme": true } \ No newline at end of file