summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-08 14:51:55 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-05-08 14:51:55 +0200
commit099234cf12c4d1ec2d1942ed506f463b28ef738c (patch)
tree371d6475df8e76f1c1ce62d983f2059cad4b7eae /apps/theming/lib
parent6acae94a021a6e961a00fe2c33e5468461e65893 (diff)
downloadnextcloud-server-099234cf12c4d1ec2d1942ed506f463b28ef738c.tar.gz
nextcloud-server-099234cf12c4d1ec2d1942ed506f463b28ef738c.zip
Add function to request SVG or regular fallback image
Fixes https://github.com/nextcloud/server/issues/4647 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/ThemingDefaults.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 9509fc11077..0824a36ccdc 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -129,9 +129,10 @@ class ThemingDefaults extends \OC_Defaults {
/**
* Themed logo url
*
+ * @param bool $useSvg Whether to point to the SVG image or a fallback
* @return string
*/
- public function getLogo() {
+ public function getLogo($useSvg = true) {
$logo = $this->config->getAppValue('theming', 'logoMime', false);
$logoExists = true;
@@ -144,7 +145,12 @@ class ThemingDefaults extends \OC_Defaults {
$cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0');
if(!$logo || !$logoExists) {
- return $this->urlGenerator->imagePath('core','logo.svg') . '?v=' . $cacheBusterCounter;
+ if($useSvg) {
+ $logo = $this->urlGenerator->imagePath('core', 'logo.svg');
+ } else {
+ $logo = $this->urlGenerator->imagePath('core', 'logo.png');
+ }
+ return $logo . '?v=' . $cacheBusterCounter;
}
return $this->urlGenerator->linkToRoute('theming.Theming.getLogo') . '?v=' . $cacheBusterCounter;