Skip to content
Snippets Groups Projects
Commit 3fb989ee authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

make class ContentModule and method readData abstract (and fix constructor...

Closes #1252

Merge request studip/studip!767
parent 7bbef588
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,13 @@ ...@@ -15,8 +15,13 @@
* @module ContentModule * @module ContentModule
* @package ELearning-Interface * @package ELearning-Interface
*/ */
class ContentModule abstract class ContentModule
{ {
/**
* Fetches data from conencted cms.
*/
abstract function readData();
var $id; var $id;
var $title; var $title;
var $module_type; var $module_type;
...@@ -41,7 +46,7 @@ class ContentModule ...@@ -41,7 +46,7 @@ class ContentModule
* @param string $module_type module-type * @param string $module_type module-type
* @param string $cms_type system-type * @param string $cms_type system-type
*/ */
function __construct($module_id = "", $module_type, $cms_type) function __construct($module_id, $module_type, $cms_type)
{ {
global $connected_cms; global $connected_cms;
......
...@@ -28,7 +28,7 @@ class Ilias3ContentModule extends ContentModule ...@@ -28,7 +28,7 @@ class Ilias3ContentModule extends ContentModule
* @param string $module_type module-type * @param string $module_type module-type
* @param string $cms_type system-type * @param string $cms_type system-type
*/ */
function __construct($module_id = "", $module_type, $cms_type) function __construct($module_id, $module_type, $cms_type)
{ {
parent::__construct($module_id, $module_type, $cms_type); parent::__construct($module_id, $module_type, $cms_type);
if ($module_id != "") if ($module_id != "")
......
...@@ -25,7 +25,7 @@ class LonCapaContentModule extends ContentModule ...@@ -25,7 +25,7 @@ class LonCapaContentModule extends ContentModule
* @param string $module_type * @param string $module_type
* @param string $cms_type * @param string $cms_type
*/ */
public function __construct($module_id = "", $module_type, $cms_type) public function __construct($module_id, $module_type, $cms_type)
{ {
$this->lcRequest = new LonCapaRequest(); $this->lcRequest = new LonCapaRequest();
$this->cmsUrl = $GLOBALS['ELEARNING_INTERFACE_MODULES'][$cms_type]['ABSOLUTE_PATH_ELEARNINGMODULES']; $this->cmsUrl = $GLOBALS['ELEARNING_INTERFACE_MODULES'][$cms_type]['ABSOLUTE_PATH_ELEARNINGMODULES'];
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/** /**
* *
* This class contains methods to handle PmWiki learning modules * This class contains methods to handle PmWiki learning modules
* *
* @author Marco Diedrich <mdiedric@uos.de> * @author Marco Diedrich <mdiedric@uos.de>
* @access public * @access public
...@@ -32,19 +32,19 @@ class PmWikiContentModule extends ContentModule ...@@ -32,19 +32,19 @@ class PmWikiContentModule extends ContentModule
/** /**
* constructor * constructor
* *
* init class. * init class.
* @access public * @access public
* @param string $module_id module-id * @param string $module_id module-id
* @param string $module_type module-type * @param string $module_type module-type
* @param string $cms_type system-type * @param string $cms_type system-type
*/ */
function __construct($module_id = "", $module_type, $cms_type) function __construct($module_id, $module_type, $cms_type)
{ {
parent::__construct($module_id, $module_type, $cms_type); parent::__construct($module_id, $module_type, $cms_type);
$this->link = $GLOBALS['connected_cms'][$this->cms_type]->ABSOLUTE_PATH_ELEARNINGMODULES.$this->id."/"; $this->link = $GLOBALS['connected_cms'][$this->cms_type]->ABSOLUTE_PATH_ELEARNINGMODULES.$this->id."/";
$this->client = WebserviceClient::instance( $this->link. '?' . $this->client = WebserviceClient::instance( $this->link. '?' .
$GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['URL_PARAMS'], $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['URL_PARAMS'],
$GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['WEBSERVICE_CLASS']); $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['WEBSERVICE_CLASS']);
} }
...@@ -98,7 +98,7 @@ class PmWikiContentModule extends ContentModule ...@@ -98,7 +98,7 @@ class PmWikiContentModule extends ContentModule
if ($authorized) if ($authorized)
{ {
return true; return true;
} else } else
{ {
# old authorization # old authorization
if (is_array($this->accepted_users) && in_array($username, $this->accepted_users)) if (is_array($this->accepted_users) && in_array($username, $this->accepted_users))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment