diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-11-18 15:35:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-18 15:35:34 +0100 |
commit | faee255ff47873ed2f8908c7d6b6e603ded11618 (patch) | |
tree | 87a46252211e9c0dbab91609e4115082401656ee /lib/private | |
parent | e8511660f01faeebcc692b57cabdacd97845da92 (diff) | |
parent | 2ab4d1e0a3f15af2b8f04edcf18b7fe3fc0be262 (diff) | |
download | nextcloud-server-faee255ff47873ed2f8908c7d6b6e603ded11618.tar.gz nextcloud-server-faee255ff47873ed2f8908c7d6b6e603ded11618.zip |
Merge pull request #840 from nextcloud/theming-icon-endpoint
Add dynamic icon creation
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Server.php | 3 | ||||
-rw-r--r-- | lib/private/URLGenerator.php | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index c6755357a1d..c6cfa018be5 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -703,7 +703,8 @@ class Server extends ServerContainer implements IServerContainer { $c->getL10N('theming'), $c->getURLGenerator(), new \OC_Defaults(), - $c->getLazyRootFolder() + $c->getLazyRootFolder(), + $c->getMemCacheFactory() ); } return new \OC_Defaults(); diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 93517dc9f7e..bdf7bdafae3 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -157,7 +157,15 @@ class URLGenerator implements IURLGenerator { // Check if the app is in the app folder $path = ''; - if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) { + if(\OCP\App::isEnabled('theming') && $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(\OCP\App::isEnabled('theming') && $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 (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") && file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.png")) { |