diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-04-16 09:46:58 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-04-16 09:46:58 +0200 |
commit | f36f453dd293a847978186ad7c920b14c4914373 (patch) | |
tree | 731a102697b21aa163b634d0d01be245dfcc5b64 /lib | |
parent | f1015c88faf8ce418c5e0f983756d71403044210 (diff) | |
download | nextcloud-server-f36f453dd293a847978186ad7c920b14c4914373.tar.gz nextcloud-server-f36f453dd293a847978186ad7c920b14c4914373.zip |
apps are now stored in /apps
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.php | 13 | ||||
-rw-r--r-- | lib/helper.php | 11 | ||||
-rw-r--r-- | lib/template.php | 8 |
3 files changed, 27 insertions, 5 deletions
diff --git a/lib/app.php b/lib/app.php index 3827afb5d15..4a7c2b3a963 100644 --- a/lib/app.php +++ b/lib/app.php @@ -49,12 +49,17 @@ class OC_APP{ return true; } - // Get all appinfo - $dir = opendir( $SERVERROOT ); + // Our very own core apps are hardcoded + foreach( array( "admin", "files", "log", "settings" ) as $app ){ + oc_require( "$app/appinfo/app.php" ); + } + + // The rest comes here + $dir = opendir( "$SERVERROOT/apps" ); while( false !== ( $filename = readdir( $dir ))){ if( substr( $filename, 0, 1 ) != '.' ){ - if( file_exists( "$SERVERROOT/$filename/appinfo/app.php" )){ - oc_require( "$filename/appinfo/app.php" ); + if( file_exists( "$SERVERROOT/apps/$filename/appinfo/app.php" )){ + oc_require( "apps/$filename/appinfo/app.php" ); } } } diff --git a/lib/helper.php b/lib/helper.php index a10697c3933..982da7b6cc3 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -35,6 +35,12 @@ class OC_HELPER { */ public static function linkTo( $app, $file ){ global $WEBROOT; + global $SERVERROOT; + + // Check if the app is in the app folder + if( file_exists( "$SERVERROOT/apps/$app/$file" )){ + return "$WEBROOT/apps/$app/$file"; + } return "$WEBROOT/$app/$file"; } @@ -47,7 +53,12 @@ class OC_HELPER { * Returns the path to the image. */ public static function imagePath( $app, $image ){ + global $SERVERROOT; global $WEBROOT; + // Check if the app is in the app folder + if( file_exists( "$SERVERROOT/apps/img/$app/$file" )){ + return "$WEBROOT/apps/img/$app/$file"; + } return "$WEBROOT/$app/img/$image"; } diff --git a/lib/template.php b/lib/template.php index 12a32c1f052..80bb4317d92 100644 --- a/lib/template.php +++ b/lib/template.php @@ -96,7 +96,13 @@ class OC_TEMPLATE{ // Get the right template folder $template = "$SERVERROOT/templates/"; if( $app != "core" && $app != "" ){ - $template = "$SERVERROOT/$app/templates/"; + // Check if the app is in the app folder + if( "$SERVERROOT/apps/$app/templates/" ){ + $template = "$SERVERROOT/apps/$app/templates/"; + } + else{ + $template = "$SERVERROOT/$app/templates/"; + } } // Templates have the ending .php |