Theme image for favicon-fb.png

Fixes https://github.com/nextcloud/server/issues/5322

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-06-09 21:12:37 +02:00
parent 5722afc1d7
commit 26fe83aad8
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 8 additions and 4 deletions

View File

@ -159,13 +159,17 @@ class URLGenerator implements IURLGenerator {
// Check if the app is in the app folder
$path = '';
$themingEnabled = $this->config->getSystemValue('installed', false) && \OCP\App::isEnabled('theming') && \OC_App::isAppLoaded('theming');
if($themingEnabled && $image === "favicon.ico" && \OC::$server->getThemingDefaults()->shouldReplaceIcons()) {
if($themingEnabled && $image === 'favicon.ico' && \OC::$server->getThemingDefaults()->shouldReplaceIcons()) {
$cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
if($app==="") { $app = "core"; }
if($app === '') { $app = 'core'; }
$path = $this->linkToRoute('theming.Icon.getFavicon', [ 'app' => $app ]) . '?v='. $cacheBusterValue;
} elseif($themingEnabled && $image === "favicon-touch.png" && \OC::$server->getThemingDefaults()->shouldReplaceIcons()) {
} elseif($themingEnabled && $image === 'favicon-touch.png' && \OC::$server->getThemingDefaults()->shouldReplaceIcons()) {
$cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
if($app==="") { $app = "core"; }
if($app === '') { $app = 'core'; }
$path = $this->linkToRoute('theming.Icon.getTouchIcon', [ 'app' => $app ]) . '?v='. $cacheBusterValue;
} elseif($themingEnabled && $image === 'favicon-fb.png' && \OC::$server->getThemingDefaults()->shouldReplaceIcons()) {
$cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
if($app === '') { $app = 'core'; }
$path = $this->linkToRoute('theming.Icon.getTouchIcon', [ 'app' => $app ]) . '?v='. $cacheBusterValue;
} elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) {
$path = \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$image";