From: Frank Karlitschek Date: Sat, 16 Apr 2011 22:53:10 +0000 (+0200) Subject: first step on online ocs knowledgebase integration X-Git-Tag: v3.0~267^2~558^2~110 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca04b33abebce8ac21b561882761b4467302639d;p=nextcloud-server.git first step on online ocs knowledgebase integration --- diff --git a/help/index.php b/help/index.php index dafbd05cf33..fe20c1c4ab5 100644 --- a/help/index.php +++ b/help/index.php @@ -8,27 +8,12 @@ if( !OC_USER::isLoggedIn()){ } OC_APP::setActiveNavigationEntry( "help" ); -$settings = array(); -// Do the work ... -if( $_POST["submit"] ) -{ - if( $_POST["newpassword"] != $_POST["newpasswordconfirm"] ){ - // Say "Passwords not equal" - } - else{ - if( OC_USER::checkPassword( $_SESSION["username"], $_POST["password"] )){ - // Set password - OC_USER::setPassord( $_SESSION["username"], $_POST["newpassword"] ); - } - else{ - // Say "old password bad" - } - } -} +$kbe=OC_OCSCLIENT::getKnownledgebaseEntries(); + $tmpl = new OC_TEMPLATE( "help", "index", "user" ); -$tmpl->assign( "settings", $settings ); +$tmpl->assign( "kbe", $kbe ); $tmpl->printPage(); ?> diff --git a/help/templates/index.php b/help/templates/index.php index 19b0fa8e7fa..89674e01874 100644 --- a/help/templates/index.php +++ b/help/templates/index.php @@ -1 +1,17 @@ -This is self-explanatory. Why are you here? + +

Help

+ + + + + + + + + + +
"") { echo(''); } ?> " title="">
'.$kb['description'].''); ?>
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; + } diff --git a/plugins/publiclink/plugin.xml b/plugins/publiclink/plugin.xml deleted file mode 100755 index 75abed6cf08..00000000000 --- a/plugins/publiclink/plugin.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - publiclink - Simple file sharing by creating a public link to a file - 0.1 - AGPL - Robin Appelman - 1.1 - - - lib_public.php - - - db_structure.xml - -