@ -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::$SERVER ROOT."/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::$SERVER ROOT."/apps/$app/templates/"."$name$fext.php" ){
$template = OC::$SERVER ROOT."/apps/$app/templates/"."$name$fext.php";
$path = OC::$SERVER ROOT."/apps/$app/templates/";
}else{
$template = OC::$SERVER ROOT."/apps/$app/templates/"."$name.php";
$path = OC::$SERVER ROOT."/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::$APPS ROOT."/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::$APPS ROOT."/apps/$app/templates/"."$name$fext.php" ){
$template = OC::$APPS ROOT."/apps/$app/templates/"."$name$fext.php";
$path = OC::$APPS ROOT."/apps/$app/templates/";
}else{
$template = OC::$APPS ROOT."/apps/$app/templates/"."$name.php";
$path = OC::$APPS ROOT."/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::$SERVER ROOT."/apps/$script$fext.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/apps/$script$fext.js" );
}elseif(is_file(OC::$SERVER ROOT."/apps/$script.js" )){
$page->append( "jsfiles", OC::$WEBROOT."/apps/$script.js" );
}elseif(is_file(OC::$APP SROOT."/apps/$script$fext.js" )){
$page->append( "jsfiles", OC::$APPS WEBROOT."/apps/$script$fext.js" );
}elseif(is_file(OC::$APP SROOT."/apps/$script.js" )){
$page->append( "jsfiles", OC::$APPS 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" )){
@ -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::$SERVER ROOT."/apps/$style$fext.css" )){
$page->append( "cssfiles", OC::$WEBROOT."/apps/$style$fext.css" );
}elseif(is_file(OC::$SERVER ROOT."/apps/$style.css" )){
$page->append( "cssfiles", OC::$WEBROOT."/apps/$style.css" );
}elseif(is_file(OC::$APP SROOT."/apps/$style$fext.css" )){
$page->append( "cssfiles", OC::$APPS WEBROOT."/apps/$style$fext.css" );
}elseif(is_file(OC::$APP SROOT."/apps/$style.css" )){
$page->append( "cssfiles", OC::$APPS 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" );