summaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
authorFrank Karlitschek <karlitschek@kde.org>2012-02-23 15:37:38 +0100
committerFrank Karlitschek <karlitschek@kde.org>2012-02-23 15:37:38 +0100
commita62e109e8cafe710f7bf47c86815e34106852285 (patch)
tree910030187a0fc24f2bb8e68ceb606f1445f7f9fe /lib/template.php
parent196d6196895e7128d9cd79ac861fdc65c7b54c09 (diff)
downloadnextcloud-server-a62e109e8cafe710f7bf47c86815e34106852285.tar.gz
nextcloud-server-a62e109e8cafe710f7bf47c86815e34106852285.zip
make the location of the 3rdparty folder flexible.
It´s automatically search in the owncloud folder and in the parent folder. override with an option in config.php is also possible
Diffstat (limited to 'lib/template.php')
-rw-r--r--lib/template.php22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/template.php b/lib/template.php
index d991759fbcd..5fe2eb7d6c7 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -346,31 +346,41 @@ class OC_Template{
// Add the core js files or the js files provided by the selected theme
foreach(OC_Util::$scripts as $script){
- if(is_file(OC::$SERVERROOT."/themes/$theme/apps/$script$fext.js" )){
+ // Is it in 3rd party?
+ if(is_file(OC::$THIRDPARTYROOT."/$script.js" )){
+ $page->append( "jsfiles", OC::$THIRDPARTYWEBROOT."/$script.js" );
+
+ // Is it in apps and overwritten by the theme?
+ }elseif(is_file(OC::$SERVERROOT."/themes/$theme/apps/$script$fext.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/themes/$theme/apps/$script$fext.js" );
}elseif(is_file(OC::$SERVERROOT."/themes/$theme/apps/$script.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/themes/$theme/apps/$script.js" );
+ // Is it part of an app?
}elseif(is_file(OC::$SERVERROOT."/apps/$script$fext.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/apps/$script$fext.js" );
}elseif(is_file(OC::$SERVERROOT."/apps/$script.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/apps/$script.js" );
+ // Is it in the owncloud root but overwritten by the theme?
}elseif(is_file(OC::$SERVERROOT."/themes/$theme/$script$fext.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/themes/$theme/$script$fext.js" );
}elseif(is_file(OC::$SERVERROOT."/themes/$theme/$script.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/themes/$theme/$script.js" );
-
+
+ // Is it in the owncloud root ?
}elseif(is_file(OC::$SERVERROOT."/$script$fext.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/$script$fext.js" );
}elseif(is_file(OC::$SERVERROOT."/$script.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/$script.js" );
+ // Is in core but overwritten by a theme?
}elseif(is_file(OC::$SERVERROOT."/themes/$theme/core/$script$fext.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/themes/$theme/core/$script$fext.js" );
}elseif(is_file(OC::$SERVERROOT."/themes/$theme/core/$script.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/themes/$theme/core/$script.js" );
+ // Is it in core?
}elseif(is_file(OC::$SERVERROOT."/core/$script$fext.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/core/$script$fext.js" );
}else{
@@ -380,14 +390,20 @@ class OC_Template{
}
// Add the css files
foreach(OC_Util::$styles as $style){
- if(is_file(OC::$SERVERROOT."/apps/$style$fext.css" )){
+ // is it in 3rdparty?
+ if(is_file(OC::$THIRDPARTYROOT."/$style.css" )){
+ $page->append( "cssfiles", OC::$THIRDPARTYWEBROOT."/$style.css" );
+ // or in apps?
+ }elseif(is_file(OC::$SERVERROOT."/apps/$style$fext.css" )){
$page->append( "cssfiles", OC::$WEBROOT."/apps/$style$fext.css" );
}elseif(is_file(OC::$SERVERROOT."/apps/$style.css" )){
$page->append( "cssfiles", OC::$WEBROOT."/apps/$style.css" );
+ // or in the owncloud root?
}elseif(is_file(OC::$SERVERROOT."/$style$fext.css" )){
$page->append( "cssfiles", OC::$WEBROOT."/$style$fext.css" );
}elseif(is_file(OC::$SERVERROOT."/$style.css" )){
$page->append( "cssfiles", OC::$WEBROOT."/$style.css" );
+ // or in core ?
}elseif(is_file(OC::$SERVERROOT."/core/$style$fext.css" )){
$page->append( "cssfiles", OC::$WEBROOT."/core/$style$fext.css" );
}else{