aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2022-07-01 15:02:02 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2022-07-01 15:02:02 +0000
commit3fb989eebb7db40284cd8d9b023b1b2758260fd8 (patch)
tree16da384180723cc4fa7b9d498858c3376e9c84a7 /lib
parent7bbef588b396afb78375612ff70e6940b9f07670 (diff)
make class ContentModule and method readData abstract (and fix constructor...
Closes #1252 Merge request studip/studip!767
Diffstat (limited to 'lib')
-rw-r--r--lib/elearning/ContentModule.class.php9
-rw-r--r--lib/elearning/Ilias3ContentModule.class.php2
-rw-r--r--lib/elearning/LonCapaContentModule.class.php2
-rw-r--r--lib/elearning/PmWikiContentModule.class.php14
4 files changed, 16 insertions, 11 deletions
diff --git a/lib/elearning/ContentModule.class.php b/lib/elearning/ContentModule.class.php
index 64ce29b..1b2921b 100644
--- a/lib/elearning/ContentModule.class.php
+++ b/lib/elearning/ContentModule.class.php
@@ -15,8 +15,13 @@
* @module ContentModule
* @package ELearning-Interface
*/
-class ContentModule
+abstract class ContentModule
{
+ /**
+ * Fetches data from conencted cms.
+ */
+ abstract function readData();
+
var $id;
var $title;
var $module_type;
@@ -41,7 +46,7 @@ class ContentModule
* @param string $module_type module-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;
diff --git a/lib/elearning/Ilias3ContentModule.class.php b/lib/elearning/Ilias3ContentModule.class.php
index 1304c6c..95b2f8f 100644
--- a/lib/elearning/Ilias3ContentModule.class.php
+++ b/lib/elearning/Ilias3ContentModule.class.php
@@ -28,7 +28,7 @@ class Ilias3ContentModule extends ContentModule
* @param string $module_type module-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);
if ($module_id != "")
diff --git a/lib/elearning/LonCapaContentModule.class.php b/lib/elearning/LonCapaContentModule.class.php
index 70976cc..0f16cd0 100644
--- a/lib/elearning/LonCapaContentModule.class.php
+++ b/lib/elearning/LonCapaContentModule.class.php
@@ -25,7 +25,7 @@ class LonCapaContentModule extends ContentModule
* @param string $module_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->cmsUrl = $GLOBALS['ELEARNING_INTERFACE_MODULES'][$cms_type]['ABSOLUTE_PATH_ELEARNINGMODULES'];
diff --git a/lib/elearning/PmWikiContentModule.class.php b/lib/elearning/PmWikiContentModule.class.php
index e16756a..061dbd3 100644
--- a/lib/elearning/PmWikiContentModule.class.php
+++ b/lib/elearning/PmWikiContentModule.class.php
@@ -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>
* @access public
@@ -32,19 +32,19 @@ class PmWikiContentModule extends ContentModule
/**
* constructor
*
- * init class.
+ * init class.
* @access public
* @param string $module_id module-id
* @param string $module_type module-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);
$this->link = $GLOBALS['connected_cms'][$this->cms_type]->ABSOLUTE_PATH_ELEARNINGMODULES.$this->id."/";
- $this->client = WebserviceClient::instance( $this->link. '?' .
- $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['URL_PARAMS'],
+ $this->client = WebserviceClient::instance( $this->link. '?' .
+ $GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['URL_PARAMS'],
$GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_type]['WEBSERVICE_CLASS']);
}
@@ -98,7 +98,7 @@ class PmWikiContentModule extends ContentModule
if ($authorized)
{
return true;
- } else
+ } else
{
# old authorization
if (is_array($this->accepted_users) && in_array($username, $this->accepted_users))