]> source.dussan.org Git - nextcloud-server.git/commitdiff
properly load css and js files for apps
authorRobin Appelman <icewind1991@gmail.com>
Fri, 22 Apr 2011 15:14:49 +0000 (17:14 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sat, 23 Apr 2011 00:28:12 +0000 (02:28 +0200)
lib/template.php

index dd1943ae7f57cc695821f519f334b4c03d8c8de4..cdd8f2fb32f49de9c6499d5a679855e914b5417d 100644 (file)
@@ -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