mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Simplify app js locating for layout pages
This commit is contained in:
parent
ea4ae857a1
commit
b46f6e4f97
1 changed files with 8 additions and 11 deletions
|
|
@ -173,18 +173,15 @@ class OC_TemplateLayout extends OC_Template {
|
|||
|
||||
}else{
|
||||
// Is it part of an app?
|
||||
$append = false;
|
||||
foreach( OC::$APPSROOTS as $apps_dir) {
|
||||
if(self::appendIfExist($files, $apps_dir['path'], OC::$WEBROOT.$apps_dir['url'], "$script$fext.js")) {
|
||||
$append = true;
|
||||
break;
|
||||
}
|
||||
elseif(self::appendIfExist($files, $apps_dir['path'], OC::$WEBROOT.$apps_dir['url'], "$script.js")) {
|
||||
$append = true;
|
||||
break;
|
||||
}
|
||||
$app = substr($script, 0, strpos($script, '/'));
|
||||
$script = substr($script, strpos($script, '/')+1);
|
||||
$app_path = OC_App::getAppPath($app);
|
||||
$app_url = OC_App::getAppWebPath($app);
|
||||
if(self::appendIfExist($files, $app_path, $app_url, "$script$fext.js")) {
|
||||
}
|
||||
if(! $append) {
|
||||
elseif(self::appendIfExist($files, $app_path, $app_url, "$script.js")) {
|
||||
}
|
||||
else {
|
||||
echo('js file not found: script:'.$script.' formfactor:'.$fext
|
||||
.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
|
||||
die();
|
||||
|
|
|
|||
Loading…
Reference in a new issue