diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2020-10-20 13:36:41 +0300 |
---|---|---|
committer | npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com> | 2020-11-13 09:51:26 +0300 |
commit | f5ef2d7d5897bb490f2a10792760f809a68e4c00 (patch) | |
tree | 04dcf6c646b10405a799e6d793137052fd848e02 /apps/theming/lib | |
parent | 35be4fdb019da658a824f41dc4bf0f415c032cb8 (diff) |
override default dashboard background with theming one
fix getAppValue default value in theming app
fix cacheBuster value injection
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r-- | apps/theming/lib/Capabilities.php | 6 | ||||
-rw-r--r-- | apps/theming/lib/ImageManager.php | 4 | ||||
-rw-r--r-- | apps/theming/lib/Service/JSDataService.php | 2 | ||||
-rw-r--r-- | apps/theming/lib/ThemingDefaults.php | 6 | ||||
-rw-r--r-- | apps/theming/lib/Util.php | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php index d10002c9dea..f0c4d266362 100644 --- a/apps/theming/lib/Capabilities.php +++ b/apps/theming/lib/Capabilities.php @@ -69,7 +69,7 @@ class Capabilities implements IPublicCapability { * @return array */ public function getCapabilities() { - $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', false); + $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', ''); $color = $this->theming->getColorPrimary(); return [ 'theming' => [ @@ -82,10 +82,10 @@ class Capabilities implements IPublicCapability { 'color-element-bright' => $this->util->elementColor($color), 'color-element-dark' => $this->util->elementColor($color, false), 'logo' => $this->url->getAbsoluteURL($this->theming->getLogo()), - 'background' => $backgroundLogo === 'backgroundColor' || ($backgroundLogo === false && $this->theming->getColorPrimary() !== '#0082c9') ? + 'background' => $backgroundLogo === 'backgroundColor' || ($backgroundLogo === '' && $this->theming->getColorPrimary() !== '#0082c9') ? $this->theming->getColorPrimary() : $this->url->getAbsoluteURL($this->theming->getBackground()), - 'background-plain' => $backgroundLogo === 'backgroundColor' || ($backgroundLogo === false && $this->theming->getColorPrimary() !== '#0082c9'), + 'background-plain' => $backgroundLogo === 'backgroundColor' || ($backgroundLogo === '' && $this->theming->getColorPrimary() !== '#0082c9'), 'background-default' => !$this->util->isBackgroundThemed(), 'logoheader' => $this->url->getAbsoluteURL($this->theming->getLogo()), 'favicon' => $this->url->getAbsoluteURL($this->theming->getLogo()), diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php index 469480d1e10..d3b5f6130e7 100644 --- a/apps/theming/lib/ImageManager.php +++ b/apps/theming/lib/ImageManager.php @@ -101,9 +101,9 @@ class ImageManager { * @throws NotPermittedException */ public function getImage(string $key, bool $useSvg = true): ISimpleFile { - $logo = $this->config->getAppValue('theming', $key . 'Mime', false); + $logo = $this->config->getAppValue('theming', $key . 'Mime', ''); $folder = $this->appData->getFolder('images'); - if ($logo === false || !$folder->fileExists($key)) { + if ($logo === '' || !$folder->fileExists($key)) { throw new NotFoundException(); } if (!$useSvg && $this->shouldReplaceIcons()) { diff --git a/apps/theming/lib/Service/JSDataService.php b/apps/theming/lib/Service/JSDataService.php index 89c4cd9c027..d87d11a0fe0 100644 --- a/apps/theming/lib/Service/JSDataService.php +++ b/apps/theming/lib/Service/JSDataService.php @@ -59,7 +59,7 @@ class JSDataService implements \JsonSerializable { 'imprintUrl' => $this->themingDefaults->getImprintUrl(), 'privacyUrl' => $this->themingDefaults->getPrivacyUrl(), 'inverted' => $this->util->invertTextColor($this->themingDefaults->getColorPrimary()), - 'cacheBuster' => $this->appConfig->getAppValue(Application::class, 'cachebuster', '0'), + 'cacheBuster' => $this->appConfig->getAppValue(Application::APP_ID, 'cachebuster', '0'), ]; } } diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 01af4d1b177..f47e4ae294d 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -223,7 +223,7 @@ class ThemingDefaults extends \OC_Defaults { * @return string */ public function getLogo($useSvg = true): string { - $logo = $this->config->getAppValue('theming', 'logoMime', false); + $logo = $this->config->getAppValue('theming', 'logoMime', ''); // short cut to avoid setting up the filesystem just to check if the logo is there // @@ -309,13 +309,13 @@ class ThemingDefaults extends \OC_Defaults { $variables['image-login-background'] = "url('".$this->imageManager->getImageUrl('background')."')"; $variables['image-login-plain'] = 'false'; - if ($this->config->getAppValue('theming', 'color', null) !== null) { + if ($this->config->getAppValue('theming', 'color', '') !== '') { $variables['color-primary'] = $this->getColorPrimary(); $variables['color-primary-text'] = $this->getTextColorPrimary(); $variables['color-primary-element'] = $this->util->elementColor($this->getColorPrimary()); } - if ($this->config->getAppValue('theming', 'backgroundMime', null) === 'backgroundColor') { + if ($this->config->getAppValue('theming', 'backgroundMime', '') === 'backgroundColor') { $variables['image-login-plain'] = 'true'; } diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php index 3addda91422..e757d100a1b 100644 --- a/apps/theming/lib/Util.php +++ b/apps/theming/lib/Util.php @@ -249,7 +249,7 @@ class Util { } public function isBackgroundThemed() { - $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime',false); + $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', ''); $backgroundExists = true; try { |