Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-08-18 16:32:08 +0300
committerJulius Härtl <jus@bitgrid.net>2022-08-19 12:55:10 +0300
commit57233fd99ac4cdc503c19d1738243271b54c8086 (patch)
tree7699d435c6fc4e2cb3527380bc5188ce50cb63a3 /apps/theming
parent49ddaaecbf2345673f871ca0225090b95521b3f4 (diff)
Expose core background image
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/Themes/DefaultTheme.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php
index 6fd29132a53..82bfb000e93 100644
--- a/apps/theming/lib/Themes/DefaultTheme.php
+++ b/apps/theming/lib/Themes/DefaultTheme.php
@@ -192,6 +192,8 @@ class DefaultTheme implements ITheme {
'--primary-invert-if-bright' => $this->util->invertTextColor($this->primaryColor) ? 'invert(100%)' : 'no',
'--background-invert-if-dark' => 'no',
'--background-invert-if-bright' => 'invert(100%)',
+
+ '--image-main-background' => "url('" . $this->urlGenerator->imagePath('core', 'app-background.jpg') . "')",
];
$backgroundDeleted = $this->config->getAppValue('theming', 'backgroundMime', '') === 'backgroundColor';
@@ -199,19 +201,21 @@ class DefaultTheme implements ITheme {
// let's not define the background image
if ($backgroundDeleted || $hasCustomPrimaryColour) {
$variables["--image-background-plain"] = 'true';
- }
+ }
// Register image variables only if custom-defined
foreach(['logo', 'logoheader', 'favicon', 'background'] as $image) {
if ($this->imageManager->hasImage($image)) {
+ $imageUrl = $this->imageManager->getImageUrl($image);
if ($image === 'background') {
// If background deleted is set, ignoring variable
if ($backgroundDeleted) {
continue;
- }
+ }
$variables['--image-background-size'] = 'cover';
+ $variables['--image-main-background'] = "url('" . $imageUrl . "')";
}
- $variables["--image-$image"] = "url('".$this->imageManager->getImageUrl($image)."')";
+ $variables["--image-$image"] = "url('" . $imageUrl . "')";
}
}