Some fixes. :-}

This commit is contained in:
moodler 2004-03-13 10:56:38 +00:00
parent 3e0d46ec36
commit a0a4a3c964

View file

@ -61,11 +61,14 @@
if ($learningforums) { // Copy "full" data into this complete array if ($learningforums) { // Copy "full" data into this complete array
foreach ($learningforums as $learningforum) { foreach ($learningforums as $learningforum) {
$forum[$learningforum->id] = $learningforum; $forums[$learningforum->id] = $learningforum;
} }
} }
foreach ($forums as $forum) { foreach ($forums as $forum) {
if (!isset($forum->visible)) {
$forum->visible = true;
}
switch ($forum->type) { switch ($forum->type) {
case "news": case "news":
case "social": case "social":
@ -81,8 +84,11 @@
} }
break; break;
default: default:
if (!$course->category) { // On site level all forums are general forums if (!$course->category or empty($forum->section)) { // Site level or section 0
$generalforums[] = $forum; $generalforums[] = $forum;
if (isset($forum->coursemodule)) {
unset($learningforums[$forum->coursemodule]);
}
} }
break; break;
} }