apps are now stored in /apps

This commit is contained in:
Jakob Sack 2011-04-16 09:46:58 +02:00
parent f1015c88fa
commit f36f453dd2
7 changed files with 28 additions and 21 deletions

1
apps/.gitkeep Normal file
View File

@ -0,0 +1 @@

Binary file not shown.

16
bin/jquery-1.5.min.js vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -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" );
}
}
}

View File

@ -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";
}

View File

@ -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