Skip to content
Snippets Groups Projects
Commit d61bce5a authored by Elmar Ludwig's avatar Elmar Ludwig Committed by Jan-Hendrik Willms
Browse files

remove call to undefined method, fixes #211

parent 45026209
No related branches found
No related tags found
No related merge requests found
...@@ -2346,9 +2346,9 @@ class Seminar ...@@ -2346,9 +2346,9 @@ class Seminar
public function getSlotModule($slot) public function getSlotModule($slot)
{ {
$module = 'Core' . ucfirst($slot); $module = 'Core' . ucfirst($slot);
if ($this->course->isToolActive($module)) { if ($this->course->isToolActive($module)) {
return PluginEngine::getPlugin($module);; return PluginEngine::getPlugin($module);
} }
} }
/** /**
......
...@@ -147,12 +147,10 @@ class Issue { ...@@ -147,12 +147,10 @@ class Issue {
if ($this->hasForum) { if ($this->hasForum) {
$sem = Seminar::getInstance($this->seminar_id); $sem = Seminar::getInstance($this->seminar_id);
$forum_slot = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$sem->status]['class']]->getSlotModule('forum'); $forum_module = $sem->getSlotModule('forum');
foreach (PluginEngine::getPlugins('ForumModule') as $plugin) { if ($forum_module instanceof ForumModule) {
if (get_class($plugin) == $forum_slot) { $forum_module->setThreadForIssue($this->issue_id, $this->title, $this->description);
$plugin->setThreadForIssue($this->issue_id, $this->title, $this->description);
}
} }
} }
...@@ -205,12 +203,10 @@ class Issue { ...@@ -205,12 +203,10 @@ class Issue {
// check, if there is a forums-connection // check, if there is a forums-connection
$sem = Seminar::getInstance($this->seminar_id); $sem = Seminar::getInstance($this->seminar_id);
$forum_slot = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$sem->status]['class']]->getSlotModule('forum'); $forum_module = $sem->getSlotModule('forum');
foreach (PluginEngine::getPlugins('ForumModule') as $plugin) { if ($forum_module instanceof ForumModule) {
if (get_class($plugin) == $forum_slot) { $this->hasForum = $forum_module->getLinkToThread($this->issue_id) ? true : false;
$this->hasForum = $plugin->getLinkToThread($this->issue_id) ? true : false;
}
} }
$this->readSingleDates(); $this->readSingleDates();
...@@ -249,16 +245,13 @@ class Issue { ...@@ -249,16 +245,13 @@ class Issue {
// find the ForumModule which takes the role of the CoreForum in the current Seminar // find the ForumModule which takes the role of the CoreForum in the current Seminar
$sem = Seminar::getInstance($this->seminar_id); $sem = Seminar::getInstance($this->seminar_id);
$forum_slot = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$sem->status]['class']]->getSlotModule('forum'); $forum_module = $sem->getSlotModule('forum');
foreach (PluginEngine::getPlugins('ForumModule') as $plugin) { if ($forum_module instanceof ForumModule) {
if (get_class($plugin) == $forum_slot) { // only link if there is none yet
if (!$forum_module->getLinkToThread($this->issue_id)) {
// only link if there is none yet $forum_module->setThreadForIssue($this->issue_id, $this->title, $this->description);
if (!$plugin->getLinkToThread($this->issue_id)) { $this->messages[] = sprintf(_("Ordner im Forum für das Thema \"%s\" angelegt."), $this->toString());
$plugin->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 { ...@@ -277,4 +270,4 @@ class Issue {
function isIssue($issue_id) { function isIssue($issue_id) {
return IssueDB::isIssue($issue_id); return IssueDB::isIssue($issue_id);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment