diff options
Diffstat (limited to 'plugins/CoreAdminHome/CustomLogo.php')
-rw-r--r-- | plugins/CoreAdminHome/CustomLogo.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/plugins/CoreAdminHome/CustomLogo.php b/plugins/CoreAdminHome/CustomLogo.php index 8e1dfc58dd..bc1f1da055 100644 --- a/plugins/CoreAdminHome/CustomLogo.php +++ b/plugins/CoreAdminHome/CustomLogo.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\CoreAdminHome; use Piwik\Config; use Piwik\Filesystem; +use Piwik\Option; use Piwik\SettingsPiwik; class CustomLogo @@ -42,14 +43,29 @@ class CustomLogo return $svg; } + public function isEnabled() + { + return (bool) Option::get('branding_use_custom_logo'); + } + + public function enable() + { + Option::set('branding_use_custom_logo', '1', true); + } + + public function disable() + { + Option::set('branding_use_custom_logo', '0', true); + } + public function hasSVGLogo() { - if (Config::getInstance()->branding['use_custom_logo'] == 0) { + if (!$this->isEnabled()) { /* We always have our application logo */ return true; } - if (Config::getInstance()->branding['use_custom_logo'] == 1 + if ($this->isEnabled() && file_exists(Filesystem::getPathToPiwikRoot() . '/' . CustomLogo::getPathUserSvgLogo()) ) { return true; @@ -93,7 +109,7 @@ class CustomLogo if (file_exists($pathToPiwikRoot . '/' . $themeLogo)) { $logo = $themeLogo; } - if (Config::getInstance()->branding['use_custom_logo'] == 1 + if ($this->isEnabled() && file_exists($pathToPiwikRoot . '/' . $customLogo) ) { $logo = $customLogo; |