summaryrefslogtreecommitdiffstats
path: root/lib/app.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/app.php')
-rw-r--r--lib/app.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/app.php b/lib/app.php
index 411c08cbe5b..9c7b7e75dcd 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -136,7 +136,6 @@ class OC_App{
* This function returns all data it got via register().
*/
public static function get(){
- // TODO: write function
return OC_App::$apps;
}
@@ -242,7 +241,7 @@ class OC_App{
if(is_file($appid)){
$file=$appid;
}else{
- $file='apps/'.$appid.'/appinfo/info.xml';
+ $file=OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/info.xml';
if(!is_file($file)){
return array();
}
@@ -332,4 +331,18 @@ class OC_App{
public static function registerPersonal($app,$page){
self::$personalForms[]='apps/'.$app.'/'.$page.'.php';
}
+
+ /**
+ * get a list of all apps in the apps folder
+ */
+ public static function getAllApps(){
+ $apps=array();
+ $dh=opendir(OC::$SERVERROOT.'/apps');
+ while($file=readdir($dh)){
+ if(is_file(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/app.php')){
+ $apps[]=$file;
+ }
+ }
+ return $apps;
+ }
}