* @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; } }