summaryrefslogtreecommitdiffstats
path: root/lib/ocsclient.php
diff options
context:
space:
mode:
authorFrank Karlitschek <karlitschek@kde.org>2011-04-17 00:53:10 +0200
committerFrank Karlitschek <karlitschek@kde.org>2011-04-17 00:53:10 +0200
commitca04b33abebce8ac21b561882761b4467302639d (patch)
treee9c6cc5f8e228fdd0cbca4a277e2419d587d005e /lib/ocsclient.php
parent7de3ecfe5f5e7eebe88b5eb7027abfa0c73898cd (diff)
downloadnextcloud-server-ca04b33abebce8ac21b561882761b4467302639d.tar.gz
nextcloud-server-ca04b33abebce8ac21b561882761b4467302639d.zip
first step on online ocs knowledgebase integration
Diffstat (limited to 'lib/ocsclient.php')
-rw-r--r--lib/ocsclient.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/ocsclient.php b/lib/ocsclient.php
index 921bd5489a2..9f6a79e7479 100644
--- a/lib/ocsclient.php
+++ b/lib/ocsclient.php
@@ -114,6 +114,29 @@ class OC_OCSCLIENT{
return $app;
}
+ /**
+ * @brief Get all the knowledgebase entries from the OCS server
+ * @returns array with q and a data
+ *
+ * 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';
+
+ $kbe=array();
+ $xml=file_get_contents($url);
+ $data=simplexml_load_string($xml);
+
+ $tmp=$data->data->content;
+ for($i = 0; $i < count($tmp); $i++) {
+ $kb=array();
+ $kb['id']=$tmp[$i]->id;
+ $kb['name']=$tmp[$i]->name;
+ $kb['description']=$tmp[$i]->description;
+ $kbe[]=$kb;
+ }
+ return $kb;
+ }