diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-05-04 09:57:29 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-05-04 13:02:49 +0200 |
commit | 74461a9479cdc37691fa3f7500013fcdbfc61898 (patch) | |
tree | 60dba9c0546aa3d111477cc4638ea3504335a171 /apps/theming/lib | |
parent | c6ebb0d7863e8f218202ac6c6b27783ad6c16448 (diff) | |
download | nextcloud-server-74461a9479cdc37691fa3f7500013fcdbfc61898.tar.gz nextcloud-server-74461a9479cdc37691fa3f7500013fcdbfc61898.zip |
fix(theming): ensure image background is not defined if admin disabled it
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r-- | apps/theming/lib/Themes/CommonThemeTrait.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/apps/theming/lib/Themes/CommonThemeTrait.php b/apps/theming/lib/Themes/CommonThemeTrait.php index e4afa892089..cd721026923 100644 --- a/apps/theming/lib/Themes/CommonThemeTrait.php +++ b/apps/theming/lib/Themes/CommonThemeTrait.php @@ -95,15 +95,6 @@ trait CommonThemeTrait { $variables['--image-background-default'] = "url('" . $this->themingDefaults->getBackground() . "')"; $variables['--color-background-plain'] = $this->defaultPrimaryColor; - // If primary as background has been request or if we have a custom primary colour - // let's not define the background image - if ($backgroundDeleted) { - $variables['--color-background-plain'] = $this->defaultPrimaryColor; - $variables['--image-background-plain'] = 'yes'; - // If no background image is set, we need to check against the shown primary colour - $variables['--background-image-invert-if-bright'] = $isDefaultPrimaryBright ? 'invert(100%)' : 'no'; - } - // Register image variables only if custom-defined foreach (ImageManager::SUPPORTED_IMAGE_KEYS as $image) { if ($this->imageManager->hasImage($image)) { @@ -113,8 +104,18 @@ trait CommonThemeTrait { } } + // If primary as background has been request or if we have a custom primary colour + // let's not define the background image + if ($backgroundDeleted) { + $variables['--color-background-plain'] = $this->defaultPrimaryColor; + $variables['--image-background-plain'] = 'yes'; + $variables['--image-background'] = 'no'; + // If no background image is set, we need to check against the shown primary colour + $variables['--background-image-invert-if-bright'] = $isDefaultPrimaryBright ? 'invert(100%)' : 'no'; + } + if ($hasCustomLogoHeader) { - $variables["--image-logoheader-custom"] = 'true'; + $variables['--image-logoheader-custom'] = 'true'; } return $variables; |