]> source.dussan.org Git - nextcloud-server.git/commitdiff
now we have our own ocs server
authorFrank Karlitschek <karlitschek@kde.org>
Sun, 17 Apr 2011 14:04:46 +0000 (16:04 +0200)
committerFrank Karlitschek <karlitschek@kde.org>
Sun, 17 Apr 2011 14:04:46 +0000 (16:04 +0200)
lib/ocsclient.php

index 71a0b1279abea4b97321dbf4085b2adb10ee1231..994a889aecf167b62c7d0bce3a190e3b86c99fd2 100644 (file)
@@ -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);