diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-04-22 17:14:49 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-04-23 02:28:12 +0200 |
commit | 3e47ce3cef71306921f05fce9bdf19cceaf1c2a8 (patch) | |
tree | 108c91f74ea1d96b88fde20bf3b005974e5e0c3c | |
parent | bd034da8f84b8ffac9467c894bcb91757c572a09 (diff) | |
download | nextcloud-server-3e47ce3cef71306921f05fce9bdf19cceaf1c2a8.tar.gz nextcloud-server-3e47ce3cef71306921f05fce9bdf19cceaf1c2a8.zip |
properly load css and js files for apps
-rw-r--r-- | lib/template.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/template.php b/lib/template.php index dd1943ae7f5..cdd8f2fb32f 100644 --- a/lib/template.php +++ b/lib/template.php @@ -181,6 +181,7 @@ class OC_TEMPLATE{ { // global Data we need global $WEBROOT; + global $SERVERROOT; $data = $this->_fetch(); if( $this->renderas ) @@ -211,10 +212,18 @@ class OC_TEMPLATE{ // Add the css and js files foreach(OC_UTIL::$scripts as $script){ - $page->append( "jsfiles", "$WEBROOT/$script.js" ); + if(is_file("$SERVERROOT/apps/$script.js" )){ + $page->append( "jsfiles", "$WEBROOT/apps/$script.js" ); + }else{ + $page->append( "jsfiles", "$WEBROOT/$script.js" ); + } } foreach(OC_UTIL::$styles as $style){ - $page->append( "cssfiles", "$WEBROOT/$style.css" ); + if(is_file("$SERVERROOT/apps/$style.js" )){ + $page->append( "cssfiles", "$WEBROOT/apps/$style.css" ); + }else{ + $page->append( "cssfiles", "$WEBROOT/$style.css" ); + } } // Add css files and js files |