]> source.dussan.org Git - nextcloud-server.git/commitdiff
first step on online ocs knowledgebase integration
authorFrank Karlitschek <karlitschek@kde.org>
Sat, 16 Apr 2011 22:53:10 +0000 (00:53 +0200)
committerFrank Karlitschek <karlitschek@kde.org>
Sat, 16 Apr 2011 22:53:10 +0000 (00:53 +0200)
help/index.php
help/templates/index.php
lib/ocsclient.php
plugins/publiclink/plugin.xml [deleted file]

index dafbd05cf333be72368e12cff888b47e7e29d2a6..fe20c1c4ab5aa6d244f1592e5732c66a6d307cbb 100644 (file)
@@ -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();
 
 ?>
index 19b0fa8e7fa26bde6fb3ac5ae3362e712f3ff49a..89674e018741f1e4b07bcb1c1ce9cd55541205a2 100644 (file)
@@ -1 +1,17 @@
-This is self-explanatory. Why are you here?
+<?php
+/*
+ * Template for settings page
+ */
+?>
+<h1>Help</h1>
+
+<table cellspacing="0">
+       <tbody>
+               <?php foreach($_["kbe"] as $kb): ?>
+                       <tr>
+                               <td width="1"><?php if($kb["preview"] <> "") { echo('<a href="'.OC_HELPER::linkTo( "help", "index.php" ).'?id='.$kb['id'].'"><img class="preview" border="0" src="'.$kb["preview"].'" /></a>'); } ?> </a></td>
+                               <td class="name"><a href="<?php echo(OC_HELPER::linkTo( "help", "index.php" ).'?id='.$kb['id']); ?>" title=""><?php echo $kb["name"]; ?></a><br /><?php  echo('<span class="type">'.$kb['description'].'</span>'); ?></td>
+                       </tr>
+               <?php endforeach; ?>
+       </tbody>
+</table>
index 921bd5489a208341fd4946f2836b96f8edc2c9f2..9f6a79e74794d570010052150d9bf7c70aa712f8 100644 (file)
@@ -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 (executable)
index 75abed6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-<plugin version="1.0">
-       <info>
-               <id>publiclink</id>
-               <name>Simple file sharing by creating a public link to a file</name>
-               <version>0.1</version>
-               <licence>AGPL</licence>
-               <author>Robin Appelman</author>
-               <require>1.1</require>
-       </info>
-       <runtime>
-               <include>lib_public.php</include>
-       </runtime>
-       <install>
-               <database>db_structure.xml</database>
-       </install>
-</plugin>