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
diff options
context:
space:
mode:
authorJulien Moumné <julien@piwik.org>2013-12-17 20:52:36 +0400
committerJulien Moumné <julien@piwik.org>2013-12-17 20:52:36 +0400
commit6624e27e575d6056da7881bc05e9972c50ec1128 (patch)
tree06bec63f550d16ccc8a428d40a79604496ce0985 /core/Theme.php
parent5d44202fb79a9b2aa70b00ec88fd316f83a440b0 (diff)
fixes #4373, #1640
Diffstat (limited to 'core/Theme.php')
-rw-r--r--core/Theme.php26
1 files changed, 23 insertions, 3 deletions
diff --git a/core/Theme.php b/core/Theme.php
index 699783ae46..785d37382f 100644
--- a/core/Theme.php
+++ b/core/Theme.php
@@ -10,6 +10,8 @@
*/
namespace Piwik;
+use Piwik\Plugin\Manager;
+
/**
* This class contains logic to make Themes work beautifully.
*
@@ -23,10 +25,21 @@ class Theme
/** @var \Piwik\Plugin */
private $theme;
- public function __construct()
+ /**
+ * @var Plugin $plugin
+ */
+ public function __construct($plugin = false)
+ {
+ $this->createThemeFromPlugin($plugin ? $plugin : Manager::getInstance()->getThemeEnabled());
+ }
+
+ /**
+ * @param Plugin $plugin
+ */
+ private function createThemeFromPlugin($plugin)
{
- $this->theme = \Piwik\Plugin\Manager::getInstance()->getThemeEnabled();
- $this->themeName = $this->theme->getPluginName();
+ $this->theme = $plugin;
+ $this->themeName = $plugin->getPluginName();
}
public function getStylesheet()
@@ -123,4 +136,11 @@ class Theme
return $source;
}
+ /**
+ * @return string
+ */
+ public function getThemeName()
+ {
+ return $this->themeName;
+ }
} \ No newline at end of file