Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert changes to getLogo method prior to moving the code to separate…
… getEmailLogo method
  • Loading branch information
brueckner committed May 31, 2021
commit 5d98dacc8d5cf62fdaf05a93dd6ef6df16877fd5
23 changes: 6 additions & 17 deletions apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,8 @@ public function getColorPrimary() {
* @param bool $useSvg Whether to point to the SVG image or a fallback
* @return string
*/
public function getLogo($useSvg = true, $emailLogo = false): string {
$logoKey = $emailLogo ? 'emailLogo' : 'logo';
$logo = $this->config->getAppValue('theming', $logoKey . 'Mime', '');
$cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0');
public function getLogo($useSvg = true): string {
$logo = $this->config->getAppValue('theming', 'logoMime', '');

// short cut to avoid setting up the filesystem just to check if the logo is there
//
Expand All @@ -237,24 +235,15 @@ public function getLogo($useSvg = true, $emailLogo = false): string {
$logoExists = true;
} else {
try {
$this->imageManager->getImage($logoKey, $useSvg);
$this->imageManager->getImage('logo', $useSvg);
$logoExists = true;
} catch (\Exception $e) {
$logoExists = false;
}

if (!$logoExists) {
try {
$logoKey = 'logo';
$logo = $this->config->getAppValue('theming', $logoKey . 'Mime', '');
$this->imageManager->getImage($logoKey, $useSvg);
$logoExists = true;
} catch (\Exception $e) {
$logoExists = false;
}
}
}

$cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0');

if (!$logo || !$logoExists) {
if ($useSvg) {
$logo = $this->urlGenerator->imagePath('core', 'logo/logo.svg');
Expand All @@ -264,7 +253,7 @@ public function getLogo($useSvg = true, $emailLogo = false): string {
return $logo . '?v=' . $cacheBusterCounter;
}

return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => $logoKey, 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]);
return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]);
}

/**
Expand Down