diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-05-17 13:16:44 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-05-17 13:16:44 +0200 |
commit | 81847c01b014bf609e7d5597b2d81efe5973b0a5 (patch) | |
tree | a766babda21f14dd6fa8eeb8871ef75afe64dd01 /apps/theming/lib | |
parent | 443cbdc73931c0deec5bc01634ec9b512486d769 (diff) | |
download | nextcloud-server-81847c01b014bf609e7d5597b2d81efe5973b0a5.tar.gz nextcloud-server-81847c01b014bf609e7d5597b2d81efe5973b0a5.zip |
Return color when theming uses no background image
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r-- | apps/theming/lib/Capabilities.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php index 2a9e9a3c6cf..6e098940ff1 100644 --- a/apps/theming/lib/Capabilities.php +++ b/apps/theming/lib/Capabilities.php @@ -24,6 +24,7 @@ namespace OCA\Theming; use OCP\Capabilities\ICapability; +use OCP\IConfig; use OCP\IURLGenerator; /** @@ -36,17 +37,21 @@ class Capabilities implements ICapability { /** @var ThemingDefaults */ protected $theming; - /** @var IURLGenerator */ protected $url; + /** @var IConfig */ + protected $config; + /** * @param ThemingDefaults $theming * @param IURLGenerator $url + * @param IConfig $config */ - public function __construct(ThemingDefaults $theming, IURLGenerator $url) { + public function __construct(ThemingDefaults $theming, IURLGenerator $url, IConfig $config) { $this->theming = $theming; $this->url = $url; + $this->config = $config; } /** @@ -55,6 +60,8 @@ class Capabilities implements ICapability { * @return array */ public function getCapabilities() { + $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', false); + return [ 'theming' => [ 'name' => $this->theming->getName(), @@ -62,7 +69,9 @@ class Capabilities implements ICapability { 'slogan' => $this->theming->getSlogan(), 'color' => $this->theming->getColorPrimary(), 'logo' => $this->url->getAbsoluteURL($this->theming->getLogo()), - 'background' => $this->url->getAbsoluteURL($this->theming->getBackground()), + 'background' => $backgroundLogo === 'backgroundColor' ? + $this->theming->getColorPrimary() : + $this->url->getAbsoluteURL($this->theming->getBackground()), ], ]; } |