diff options
author | Frank Karlitschek <karlitschek@kde.org> | 2012-02-26 18:26:41 +0100 |
---|---|---|
committer | Frank Karlitschek <karlitschek@kde.org> | 2012-02-26 18:26:41 +0100 |
commit | ab96fa67c886d8ba2a4e930930f8e7a7b95e9cfa (patch) | |
tree | fac73ffb45fb63ec648b5d372f01b69931add004 /lib/template.php | |
parent | 8148480cfe2ca263f493d042866a809a45ee05af (diff) | |
download | nextcloud-server-ab96fa67c886d8ba2a4e930930f8e7a7b95e9cfa.tar.gz nextcloud-server-ab96fa67c886d8ba2a4e930930f8e7a7b95e9cfa.zip |
first part of the abstraction work of the apps folder. more to come
Diffstat (limited to 'lib/template.php')
-rw-r--r-- | lib/template.php | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/lib/template.php b/lib/template.php index 5fe2eb7d6c7..148e400d4e8 100644 --- a/lib/template.php +++ b/lib/template.php @@ -170,39 +170,39 @@ class OC_Template{ // Check if it is a app template or not. if( $app != "" ){ - // Check if the app is in the app folder or in the root - if( file_exists( OC::$SERVERROOT."/apps/$app/templates/" )){ - // Check if the template is overwritten by the selected theme - if( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name$fext.php" )){ - $template = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name$fext.php"; - $path = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"; - }elseif( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name.php" )){ - $template = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name.php"; - $path = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"; - }elseif( OC::$SERVERROOT."/apps/$app/templates/"."$name$fext.php" ){ - $template = OC::$SERVERROOT."/apps/$app/templates/"."$name$fext.php"; - $path = OC::$SERVERROOT."/apps/$app/templates/"; - }else{ - $template = OC::$SERVERROOT."/apps/$app/templates/"."$name.php"; - $path = OC::$SERVERROOT."/apps/$app/templates/"; - } - }else{ - // Check if the template is overwritten by the selected theme - if( file_exists( OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name$fext.php" )){ - $template = OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name$fext.php"; - $path = OC::$SERVERROOT."/themes/$theme/$app/templates/"; - }elseif( file_exists( OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name.php" )){ - $template = OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name.php"; - $path = OC::$SERVERROOT."/themes/$theme/$app/templates/"; - }elseif( file_exists( OC::$SERVERROOT."/$app/templates/"."$name$fext.php" )){ - $template = OC::$SERVERROOT."/$app/templates/"."$name$fext.php"; - $path = OC::$SERVERROOT."/$app/templates/"; - }else{ - $template = OC::$SERVERROOT."/$app/templates/"."$name.php"; - $path = OC::$SERVERROOT."/$app/templates/"; - } - - } + // Check if the app is in the app folder or in the root + if( file_exists( OC::$APPSROOT."/apps/$app/templates/" )){ + // Check if the template is overwritten by the selected theme + if( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name$fext.php" )){ + $template = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name$fext.php"; + $path = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"; + }elseif( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name.php" )){ + $template = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"."$name.php"; + $path = OC::$SERVERROOT."/themes/$theme/apps/$app/templates/"; + }elseif( OC::$APPSROOT."/apps/$app/templates/"."$name$fext.php" ){ + $template = OC::$APPSROOT."/apps/$app/templates/"."$name$fext.php"; + $path = OC::$APPSROOT."/apps/$app/templates/"; + }else{ + $template = OC::$APPSROOT."/apps/$app/templates/"."$name.php"; + $path = OC::$APPSROOT."/apps/$app/templates/"; + } + }else{ + // Check if the template is overwritten by the selected theme + if( file_exists( OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name$fext.php" )){ + $template = OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name$fext.php"; + $path = OC::$SERVERROOT."/themes/$theme/$app/templates/"; + }elseif( file_exists( OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name.php" )){ + $template = OC::$SERVERROOT."/themes/$theme/$app/templates/"."$name.php"; + $path = OC::$SERVERROOT."/themes/$theme/$app/templates/"; + }elseif( file_exists( OC::$SERVERROOT."/$app/templates/"."$name$fext.php" )){ + $template = OC::$SERVERROOT."/$app/templates/"."$name$fext.php"; + $path = OC::$SERVERROOT."/$app/templates/"; + }else{ + $template = OC::$SERVERROOT."/$app/templates/"."$name.php"; + $path = OC::$SERVERROOT."/$app/templates/"; + } + + } }else{ // Check if the template is overwritten by the selected theme if( file_exists( OC::$SERVERROOT."/themes/$theme/core/templates/"."$name$fext.php" )){ @@ -357,10 +357,10 @@ class OC_Template{ $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" ); + }elseif(is_file(OC::$APPSROOT."/apps/$script$fext.js" )){ + $page->append( "jsfiles", OC::$APPSWEBROOT."/apps/$script$fext.js" ); + }elseif(is_file(OC::$APPSROOT."/apps/$script.js" )){ + $page->append( "jsfiles", OC::$APPSWEBROOT."/apps/$script.js" ); // Is it in the owncloud root but overwritten by the theme? }elseif(is_file(OC::$SERVERROOT."/themes/$theme/$script$fext.js" )){ @@ -394,10 +394,10 @@ class OC_Template{ 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" ); + }elseif(is_file(OC::$APPSROOT."/apps/$style$fext.css" )){ + $page->append( "cssfiles", OC::$APPSWEBROOT."/apps/$style$fext.css" ); + }elseif(is_file(OC::$APPSROOT."/apps/$style.css" )){ + $page->append( "cssfiles", OC::$APPSWEBROOT."/apps/$style.css" ); // or in the owncloud root? }elseif(is_file(OC::$SERVERROOT."/$style$fext.css" )){ $page->append( "cssfiles", OC::$WEBROOT."/$style$fext.css" ); |