Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-31 15:30:48 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-31 15:30:48 +0400
commit2d643a7c8d789a9758394075f83b0626674fb269 (patch)
treea97c382c21acadf7f6a2739ff1b194f529add464 /lib
parent817a10b465ca04148cbcb5d5a2fb1c558ad1415e (diff)
parent5403c68e7810e74579c20b3f06a2dac5cc774154 (diff)
Merge pull request #5579 from owncloud/backport_5496
backport of #5496, fixes #5421 for stable5
Diffstat (limited to 'lib')
-rw-r--r--lib/helper.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php
index e78428eebca..819b1e87f4a 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -162,17 +162,35 @@ class OC_Helper {
// 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::$SERVERROOT . "/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::$SERVERROOT . "/$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{