summaryrefslogtreecommitdiffstats
path: root/lib/ocsclient.php
diff options
context:
space:
mode:
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;
+ }