diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-23 14:44:43 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-23 14:44:43 -0700 |
commit | db70b18c1d042bac1a9bca50c383654d728ff0c8 (patch) | |
tree | df8ae3dcc3ba583cbef473b06d03f0f956e923a4 | |
parent | 535bc7b6641eb56eae7ec8a5fd20ad092ed05f44 (diff) | |
parent | 0bf034da968d63b90e6fce4796d4a9a1b04eed23 (diff) | |
download | nextcloud-server-db70b18c1d042bac1a9bca50c383654d728ff0c8.tar.gz nextcloud-server-db70b18c1d042bac1a9bca50c383654d728ff0c8.zip |
Merge pull request #5496 from owncloud/prefer_png_from_theme_over_core_svg
prefer logo png from theme over svg from core
-rw-r--r-- | lib/private/urlgenerator.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php index 5c1d9d825b6..1ec10fe5688 100644 --- a/lib/private/urlgenerator.php +++ b/lib/private/urlgenerator.php @@ -81,17 +81,35 @@ class URLGenerator implements IURLGenerator { // Read the selected theme from the config file $theme = \OC_Util::getTheme(); + //if a theme has a png but not an svg always use the png + $basename = substr(basename($image),0,-4); + // Check if the app is in the app folder if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) { return \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")) { + return \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$basename.png"; } elseif (file_exists(\OC_App::getAppPath($app) . "/img/$image")) { return \OC_App::getAppWebPath($app) . "/img/$image"; + } elseif (!file_exists(\OC_App::getAppPath($app) . "/img/$basename.svg") + && file_exists(\OC_App::getAppPath($app) . "/img/$basename.png")) { + return \OC_App::getAppPath($app) . "/img/$basename.png"; } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$image")) { return \OC::$WEBROOT . "/themes/$theme/$app/img/$image"; + } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$basename.svg") + && file_exists(\OC::$WEBROOT . "/themes/$theme/$app/img/$basename.png"))) { + return \OC::$WEBROOT . "/themes/$theme/$app/img/$basename.png"; } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/$app/img/$image")) { return \OC::$WEBROOT . "/$app/img/$image"; + } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT . "/$app/img/$basename.svg") + && file_exists(\OC::$WEBROOT . "/$app/img/$basename.png"))) { + return \OC::$WEBROOT . "/$app/img/$basename.png"; } elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$image")) { return \OC::$WEBROOT . "/themes/$theme/core/img/$image"; + } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.svg") + && file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.png")) { + return \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png"; } elseif (file_exists(\OC::$SERVERROOT . "/core/img/$image")) { return \OC::$WEBROOT . "/core/img/$image"; } else { |