diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-05-08 13:06:31 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-06-05 16:47:38 +0200 |
commit | d132527aa9c4baad344b11adef3a6f4a46cde3ab (patch) | |
tree | 701700d4dae0dd2c8b7a7ef7637f9f05e81fa49f /apps/theming/lib/ImageManager.php | |
parent | 9b919245f67f5511d6be7910f61d639b290eab26 (diff) | |
download | nextcloud-server-d132527aa9c4baad344b11adef3a6f4a46cde3ab.tar.gz nextcloud-server-d132527aa9c4baad344b11adef3a6f4a46cde3ab.zip |
Use svg opt out as parameter
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib/ImageManager.php')
-rw-r--r-- | apps/theming/lib/ImageManager.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php index 850cd3e69bd..77afbbe8a87 100644 --- a/apps/theming/lib/ImageManager.php +++ b/apps/theming/lib/ImageManager.php @@ -65,10 +65,10 @@ class ImageManager { $this->cacheFactory = $cacheFactory; } - public function getImageUrl(string $key): string { + public function getImageUrl(string $key, bool $useSvg = true): string { $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); try { - $this->getImage($key); + $image = $this->getImage($key, $useSvg); return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => $key ]) . '?v=' . $cacheBusterCounter; } catch (NotFoundException $e) { } @@ -83,16 +83,18 @@ class ImageManager { } } - public function getImageUrlAbsolute(string $key): string { - return $this->urlGenerator->getAbsoluteURL($this->getImageUrl($key)); + public function getImageUrlAbsolute(string $key, bool $useSvg = true): string { + return $this->urlGenerator->getAbsoluteURL($this->getImageUrl($key, $useSvg)); } /** - * @param $key + * @param string $key + * @param bool $useSvg * @return ISimpleFile * @throws NotFoundException + * @throws NotPermittedException */ - public function getImage(string $key, bool $useSvg = false): ISimpleFile { + public function getImage(string $key, bool $useSvg = true): ISimpleFile { $logo = $this->config->getAppValue('theming', $key . 'Mime', false); $folder = $this->appData->getFolder('images'); if ($logo === false || !$folder->fileExists($key)) { |