summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-06-14 19:58:31 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-06-16 11:16:28 +0000
commit53c0790e8f0d6085455ccb23ffb0c0cf9e193930 (patch)
treed95e46996140fc8b9913cc3e210e672850f2dbff /apps/theming/lib
parenta499cab938b06b4cbd3d8a1bd65683b5a9272612 (diff)
downloadnextcloud-server-53c0790e8f0d6085455ccb23ffb0c0cf9e193930.tar.gz
nextcloud-server-53c0790e8f0d6085455ccb23ffb0c0cf9e193930.zip
generate user themed favicon and touchicon
Signed-off-by: Simon L <szaimen@e.mail.de>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Controller/IconController.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php
index 08ee71ac660..1b16293a7f3 100644
--- a/apps/theming/lib/Controller/IconController.php
+++ b/apps/theming/lib/Controller/IconController.php
@@ -120,14 +120,15 @@ class IconController extends Controller {
} catch (NotFoundException $e) {
}
if ($iconFile === null && $this->imageManager->shouldReplaceIcons()) {
+ $color = $this->themingDefaults->getColorPrimary();
try {
- $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app);
+ $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app . $color);
} catch (NotFoundException $exception) {
$icon = $this->iconBuilder->getFavicon($app);
if ($icon === false || $icon === '') {
return new NotFoundResponse();
}
- $iconFile = $this->imageManager->setCachedImage('favIcon-' . $app, $icon);
+ $iconFile = $this->imageManager->setCachedImage('favIcon-' . $app . $color, $icon);
}
$response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/x-icon']);
}
@@ -157,14 +158,15 @@ class IconController extends Controller {
} catch (NotFoundException $e) {
}
if ($this->imageManager->shouldReplaceIcons()) {
+ $color = $this->themingDefaults->getColorPrimary();
try {
- $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app);
+ $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app . $color);
} catch (NotFoundException $exception) {
$icon = $this->iconBuilder->getTouchIcon($app);
if ($icon === false || $icon === '') {
return new NotFoundResponse();
}
- $iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app, $icon);
+ $iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app . $color, $icon);
}
$response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/png']);
}