Merge pull request #24766 from owncloud/mmccarn-patch-2
Update imagePath to prefer theme, then app, then core images
This commit is contained in:
commit
862d8f43e5
|
@ -159,28 +159,31 @@ class URLGenerator implements IURLGenerator {
|
|||
} elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.svg")
|
||||
&& file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.png")) {
|
||||
$path = \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$basename.png";
|
||||
} elseif ($appPath && file_exists($appPath . "/img/$image")) {
|
||||
$path = \OC_App::getAppWebPath($app) . "/img/$image";
|
||||
} elseif ($appPath && !file_exists($appPath . "/img/$basename.svg")
|
||||
&& file_exists($appPath . "/img/$basename.png")) {
|
||||
$path = \OC_App::getAppWebPath($app) . "/img/$basename.png";
|
||||
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$image")) {
|
||||
$path = \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"))) {
|
||||
$path = \OC::$WEBROOT . "/themes/$theme/$app/img/$basename.png";
|
||||
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/$app/img/$image")) {
|
||||
$path = \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"))) {
|
||||
$path = \OC::$WEBROOT . "/$app/img/$basename.png";
|
||||
} elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$image")) {
|
||||
$path = \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")) {
|
||||
$path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png";
|
||||
} elseif ($appPath && file_exists($appPath . "/img/$image")) {
|
||||
$path = \OC_App::getAppWebPath($app) . "/img/$image";
|
||||
} elseif ($appPath && !file_exists($appPath . "/img/$basename.svg")
|
||||
&& file_exists($appPath . "/img/$basename.png")) {
|
||||
$path = \OC_App::getAppWebPath($app) . "/img/$basename.png";
|
||||
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/$app/img/$image")) {
|
||||
$path = \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"))) {
|
||||
$path = \OC::$WEBROOT . "/$app/img/$basename.png";
|
||||
} elseif (file_exists(\OC::$SERVERROOT . "/core/img/$image")) {
|
||||
$path = \OC::$WEBROOT . "/core/img/$image";
|
||||
} elseif (!file_exists(\OC::$SERVERROOT . "/core/img/$basename.svg")
|
||||
&& file_exists(\OC::$SERVERROOT . "/core/img/$basename.png")) {
|
||||
$path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png";
|
||||
}
|
||||
|
||||
if($path !== '') {
|
||||
|
|
Loading…
Reference in New Issue