diff --git a/lib/classes/Seminar.class.php b/lib/classes/Seminar.class.php index c843bea744b4289664e6fd1f65a5f09fc24addd0..099f1518e11c02aea03446c2e464a33eeb340c8f 100644 --- a/lib/classes/Seminar.class.php +++ b/lib/classes/Seminar.class.php @@ -2346,9 +2346,9 @@ class Seminar public function getSlotModule($slot) { $module = 'Core' . ucfirst($slot); - if ($this->course->isToolActive($module)) { - return PluginEngine::getPlugin($module);; - } + if ($this->course->isToolActive($module)) { + return PluginEngine::getPlugin($module); + } } /** diff --git a/lib/raumzeit/Issue.class.php b/lib/raumzeit/Issue.class.php index 50f1555bab6131b98db5c64d25f504c782775f15..51b6cc0bfb8decee7b30fcd2e5257e4db6d6e5a6 100644 --- a/lib/raumzeit/Issue.class.php +++ b/lib/raumzeit/Issue.class.php @@ -147,12 +147,10 @@ class Issue { if ($this->hasForum) { $sem = Seminar::getInstance($this->seminar_id); - $forum_slot = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$sem->status]['class']]->getSlotModule('forum'); - - foreach (PluginEngine::getPlugins('ForumModule') as $plugin) { - if (get_class($plugin) == $forum_slot) { - $plugin->setThreadForIssue($this->issue_id, $this->title, $this->description); - } + $forum_module = $sem->getSlotModule('forum'); + + if ($forum_module instanceof ForumModule) { + $forum_module->setThreadForIssue($this->issue_id, $this->title, $this->description); } } @@ -205,12 +203,10 @@ class Issue { // check, if there is a forums-connection $sem = Seminar::getInstance($this->seminar_id); - $forum_slot = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$sem->status]['class']]->getSlotModule('forum'); - - foreach (PluginEngine::getPlugins('ForumModule') as $plugin) { - if (get_class($plugin) == $forum_slot) { - $this->hasForum = $plugin->getLinkToThread($this->issue_id) ? true : false; - } + $forum_module = $sem->getSlotModule('forum'); + + if ($forum_module instanceof ForumModule) { + $this->hasForum = $forum_module->getLinkToThread($this->issue_id) ? true : false; } $this->readSingleDates(); @@ -249,16 +245,13 @@ class Issue { // find the ForumModule which takes the role of the CoreForum in the current Seminar $sem = Seminar::getInstance($this->seminar_id); - $forum_slot = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$sem->status]['class']]->getSlotModule('forum'); - - foreach (PluginEngine::getPlugins('ForumModule') as $plugin) { - if (get_class($plugin) == $forum_slot) { - - // only link if there is none yet - if (!$plugin->getLinkToThread($this->issue_id)) { - $plugin->setThreadForIssue($this->issue_id, $this->title, $this->description); - $this->messages[] = sprintf(_("Ordner im Forum für das Thema \"%s\" angelegt."), $this->toString()); - } + $forum_module = $sem->getSlotModule('forum'); + + if ($forum_module instanceof ForumModule) { + // only link if there is none yet + if (!$forum_module->getLinkToThread($this->issue_id)) { + $forum_module->setThreadForIssue($this->issue_id, $this->title, $this->description); + $this->messages[] = sprintf(_("Ordner im Forum für das Thema \"%s\" angelegt."), $this->toString()); } } } @@ -277,4 +270,4 @@ class Issue { function isIssue($issue_id) { return IssueDB::isIssue($issue_id); } -} \ No newline at end of file +}