From bc5bf18eedb3c3afd4c9266b5c4a0738f467d54f Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind1991@gmail.com>
Date: Thu, 11 Aug 2011 15:11:06 +0200
Subject: [PATCH] bit of work on app management

---
 admin/apps.php    | 15 +++++++++++++--
 lib/ocsclient.php | 16 ++++++++--------
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/admin/apps.php b/admin/apps.php
index 07e93728a3..c74f903291 100644
--- a/admin/apps.php
+++ b/admin/apps.php
@@ -45,8 +45,19 @@ foreach($registeredApps as $app){
 	}
 }
 
-$categories=OC_OCSClient::getCategories();
-// print_r($categories);
+$categories=array_keys(OC_OCSClient::getCategories());
+$externalApps=OC_OCSClient::getApplications($categories);
+foreach($externalApps as $app){
+	$apps[]=array(
+		'name'=>$app['name'],
+		'id'=>$app['id'],
+		'active'=>false,
+		'description'=>$app['description'],
+		'author'=>$app['personid'],
+	);
+}
+
+
 
 $tmpl = new OC_Template( "admin", "apps", "user" );
 $tmpl->assign('apps',$apps);
diff --git a/lib/ocsclient.php b/lib/ocsclient.php
index 2d85e71509..1df9e21e60 100644
--- a/lib/ocsclient.php
+++ b/lib/ocsclient.php
@@ -80,15 +80,15 @@ class OC_OCSClient{
 		$tmp=$data->data->content;
 		for($i = 0; $i < count($tmp); $i++) {
 			$app=array();
-			$app['id']=$tmp[$i]->id;
-			$app['name']=$tmp[$i]->name;
-			$app['type']=$tmp[$i]->typeid;
-			$app['typename']=$tmp[$i]->typename;
-			$app['personid']=$tmp[$i]->personid;
-			$app['detailpage']=$tmp[$i]->detailpage;
-			$app['preview']=$tmp[$i]->smallpreviewpic1;
+			$app['id']=(string)$tmp[$i]->id;
+			$app['name']=(string)$tmp[$i]->name;
+			$app['type']=(string)$tmp[$i]->typeid;
+			$app['typename']=(string)$tmp[$i]->typename;
+			$app['personid']=(string)$tmp[$i]->personid;
+			$app['detailpage']=(string)$tmp[$i]->detailpage;
+			$app['preview']=(string)$tmp[$i]->smallpreviewpic1;
 			$app['changed']=strtotime($tmp[$i]->changed);
-			$app['description']=$tmp[$i]->description;
+			$app['description']=(string)$tmp[$i]->description;
 	
 			$apps[]=$app;
 		} 
-- 
GitLab