aboutsummaryrefslogtreecommitdiff
path: root/lib/elearning/PmWikiConnectedCMS.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/elearning/PmWikiConnectedCMS.php')
-rw-r--r--lib/elearning/PmWikiConnectedCMS.php86
1 files changed, 86 insertions, 0 deletions
diff --git a/lib/elearning/PmWikiConnectedCMS.php b/lib/elearning/PmWikiConnectedCMS.php
new file mode 100644
index 0000000..d890126
--- /dev/null
+++ b/lib/elearning/PmWikiConnectedCMS.php
@@ -0,0 +1,86 @@
+<?php
+# Lifter002: TODO
+# Lifter007: TODO
+# Lifter003: TODO
+# Lifter010: TODO
+
+/*
+ * PmWikiConnectedCMS.php - Provides search capabilities
+ * to search WikiFarm
+ *
+ * Copyright (C) 2006 - Marco Diedrich (mdiedric@uos.de)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+require_once 'clients/xml_rpc_webservice_client.php';
+require_once 'clients/soap_webservice_client.php';
+require_once 'clients/webservice_client.php';
+
+/**
+* main-class for connection to PmWiki
+*
+* This class contains the main methods of the elearning-interface to connect to PmWiki. Extends ConnectedCMS.
+*
+* @author Marco Diedrich <mdiedric@uos.de>
+* @access public
+* @modulegroup elearning_interface_modules
+* @module PmWikiConnectedCMS
+* @package ELearning-Interface
+*/
+
+class PmWikiConnectedCMS extends ConnectedCMS
+{
+ public $client;
+ public $api_key;
+ public $field_script;
+
+ function __construct($cms)
+ {
+ parent::__construct($cms);
+ $this->client = WebserviceClient::instance( $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['ABSOLUTE_PATH_SOAP'] .
+ '?' . $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['URL_PARAMS'],
+ $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['WEBSERVICE_CLASS']);
+
+ $this->api_key = $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['soap_data']['api-key'];
+ }
+
+ function init($cms)
+ {
+ parent::init($cms);
+ $this->field_script = $GLOBALS['ELEARNING_INTERFACE_MODULES'][$cms]["field_script"];
+ }
+
+ /**
+ * search for content modules
+ *
+ * returns found content modules
+ * @param string $key keyword
+ * @return array list of content modules
+ */
+ public function searchContentModules($key)
+ {
+ $fields_found = $this->client->call("search_content_modules", [
+ $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['soap_data']['api-key'],
+ $key
+ ]);
+
+ $result = [];
+ foreach ($fields_found as $field) {
+ $result[$field['field_id']] = [
+ 'ref_id' => $field['field_id'],
+ 'type' => $field['field_type'],
+ 'obj_id' => null,
+ 'create_date' => $field['create_date'],
+ 'last_update' => $field['change_date'],
+ 'title' => $field['field_title'],
+ 'description' => $field['field_description'],
+ ];
+ }
+ return $result;
+ }
+
+}