]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes. :-}
authormoodler <moodler>
Sat, 13 Mar 2004 10:56:38 +0000 (10:56 +0000)
committermoodler <moodler>
Sat, 13 Mar 2004 10:56:38 +0000 (10:56 +0000)
mod/forum/index.php

index ed3405d184a5a1985d886795c6c2f41a0266387c..e82ace35845ebf3b62e0d7e4ee6dec88a81f59eb 100644 (file)
 
         if ($learningforums) {           // Copy "full" data into this complete array
             foreach ($learningforums as $learningforum) {
-                $forum[$learningforum->id] = $learningforum;
+                $forums[$learningforum->id] = $learningforum;
             }
         }
 
         foreach ($forums as $forum) {
+            if (!isset($forum->visible)) {
+                $forum->visible = true;
+            }
             switch ($forum->type) {
                 case "news":
                 case "social":
                     }
                     break;
                 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;
-                    }
+                        if (isset($forum->coursemodule)) {
+                            unset($learningforums[$forum->coursemodule]);
+                        }
+                    } 
                     break;
             }
         }