diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-04-19 16:08:43 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-04-26 14:21:51 +0200 |
commit | b46f6e4f9792f652666fa8ccbb83eaa0dbb6a1ce (patch) | |
tree | 9e990d90b98021595fcb3ce6a9fc6dcafda88bfd /lib/templatelayout.php | |
parent | ea4ae857a1713038f5f0d888f434633222345480 (diff) | |
download | nextcloud-server-b46f6e4f9792f652666fa8ccbb83eaa0dbb6a1ce.tar.gz nextcloud-server-b46f6e4f9792f652666fa8ccbb83eaa0dbb6a1ce.zip |
Simplify app js locating for layout pages
Diffstat (limited to 'lib/templatelayout.php')
-rw-r--r-- | lib/templatelayout.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 92837658a5f..686a38a7386 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -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")) { + } + elseif(self::appendIfExist($files, $app_path, $app_url, "$script.js")) { } - if(! $append) { + else { echo('js file not found: script:'.$script.' formfactor:'.$fext .' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT); die(); |