diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-09-11 15:03:47 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-09-12 09:22:57 +0200 |
commit | b49ab065b783b3ec041ca395739d747d20e2e187 (patch) | |
tree | daa0369e10cd7959258337d9048aac404711101a /lib/private/URLGenerator.php | |
parent | 88731848c609a454aa90a533e7361bca5f4e66b8 (diff) | |
download | nextcloud-server-b49ab065b783b3ec041ca395739d747d20e2e187.tar.gz nextcloud-server-b49ab065b783b3ec041ca395739d747d20e2e187.zip |
Move theming related imagePath logic to ThemingDefaults
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/URLGenerator.php')
-rw-r--r-- | lib/private/URLGenerator.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 9c73ba4cbc7..ee75f8b21bb 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -166,6 +166,11 @@ 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'); + $themingImagePath = false; + if($themingEnabled) { + $themingImagePath = \OC::$server->getThemingDefaults()->replaceImagePath($app, $image); + } + if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) { $path = \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$image"; } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.svg") @@ -181,14 +186,8 @@ class URLGenerator implements IURLGenerator { } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.svg") && file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.png")) { $path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png"; - } elseif($themingEnabled && $image === "favicon.ico" && \OC::$server->getThemingDefaults()->shouldReplaceIcons()) { - $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); - if($app==="") { $app = "core"; } - $path = $this->linkToRoute('theming.Icon.getFavicon', [ 'app' => $app ]) . '?v='. $cacheBusterValue; - } elseif($themingEnabled && $image === "favicon-touch.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($themingEnabled && $themingImagePath) { + $path = $themingImagePath; } elseif ($appPath && file_exists($appPath . "/img/$image")) { $path = \OC_App::getAppWebPath($app) . "/img/$image"; } elseif ($appPath && !file_exists($appPath . "/img/$basename.svg") |