summaryrefslogtreecommitdiffstats
path: root/lib/ocsclient.php
diff options
context:
space:
mode:
authorFrank Karlitschek <karlitschek@kde.org>2011-04-17 16:04:46 +0200
committerFrank Karlitschek <karlitschek@kde.org>2011-04-17 16:04:46 +0200
commit5759802091d416563d27ab3540115d49e8e16b0d (patch)
treef8cd11a93561d13fdeb9df9c3bfc8f415626143d /lib/ocsclient.php
parentee4d087e72ab9a91baf0681a5d4ee6582ba4fd37 (diff)
downloadnextcloud-server-5759802091d416563d27ab3540115d49e8e16b0d.tar.gz
nextcloud-server-5759802091d416563d27ab3540115d49e8e16b0d.zip
now we have our own ocs server
Diffstat (limited to 'lib/ocsclient.php')
-rw-r--r--lib/ocsclient.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/ocsclient.php b/lib/ocsclient.php
index 71a0b1279ab..994a889aecf 100644
--- a/lib/ocsclient.php
+++ b/lib/ocsclient.php
@@ -35,16 +35,22 @@ class OC_OCSCLIENT{
* This function returns a list of all the application categories on the OCS server
*/
public static function getCategories(){
- $url='http://api.opendesktop.org/v1/content/categories';
+ $url='http://api.apps.owncloud.com/v1/content/categories';
$xml=file_get_contents($url);
$data=simplexml_load_string($xml);
- $tmp=$data->data->category;
+ $tmp=$data->data;
$cats=array();
- for($i = 0; $i < count($tmp); $i++) {
- $cats[$i]=$tmp[$i]->name;
+
+ foreach($tmp->category as $key=>$value) {
+
+ $id= (int) $value->id;
+ $name= (string) $value->name;
+ $cats[$id]=$name;
+
}
+
return $cats;
}
@@ -60,8 +66,7 @@ class OC_OCSCLIENT{
}else{
$categoriesstring=$categories;
}
- $url='http://api.opendesktop.org/v1/content/data?categories='.urlencode($categoriesstring).'&sortmode=new&page=0&pagesize=10';
-
+ $url='http://api.apps.owncloud.com/v1/content/data?categories='.urlencode($categoriesstring).'&sortmode=new&page=0&pagesize=10';
$apps=array();
$xml=file_get_contents($url);
$data=simplexml_load_string($xml);
@@ -92,7 +97,7 @@ class OC_OCSCLIENT{
* This function returns an applications from the OCS server
*/
public static function getApplication($id){
- $url='http://api.opendesktop.org/v1/content/data/'.urlencode($id);
+ $url='http://api.apps.owncloud.com/v1/content/data/'.urlencode($id);
$xml=file_get_contents($url);
$data=simplexml_load_string($xml);
@@ -121,7 +126,7 @@ class OC_OCSCLIENT{
* This function returns a list of all the knowledgebase entries from the OCS server
*/
public static function getKnownledgebaseEntries(){
- $url='http://api.opendesktop.org/v1/knowledgebase/data?page=0&pagesize=10';
+ $url='http://api.apps.owncloud.com/v1/knowledgebase/data?page=0&pagesize=10';
$kbe=array();
$xml=file_get_contents($url);