]> git.mjollnir.org Git - moodle.git/commitdiff
Now, in topics format, every course can decide about how to
authorstronk7 <stronk7>
Tue, 27 Apr 2004 16:29:21 +0000 (16:29 +0000)
committerstronk7 <stronk7>
Tue, 27 Apr 2004 16:29:21 +0000 (16:29 +0000)
display hidden topics (collapsed or invisible)
Small change to navmenu() to support it

lib/weblib.php

index 8cb41db88c25a111443b7d4571f22f84e8144b49..8d9110c7f3cd2f8487fab2579a4aaebaccac0f68 100644 (file)
@@ -1789,14 +1789,22 @@ function navmenu($course, $cm=NULL, $targetwindow="self") {
     $logslink = NULL;
     $flag = false;
 
+    $sectionrecs = get_records("course_sections","course","$course->id","section","section,visible");
+
     foreach ($modinfo as $mod) {
         if ($mod->mod == "label") {
             continue;
         }
+
         if ($mod->section > 0 and $section <> $mod->section) {
-            $menu[] = "-------------- $strsection $mod->section --------------";
+            //Only add if visible or collapsed or teacher or course format = weeks
+            if ($sectionrecs[$mod->section]->visible or $course->hiddentopics == 0 or $isteacher or $course->format == 'weeks') {
+                $menu[] = "-------------- $strsection $mod->section --------------";
+            }
         }
+
         $section = $mod->section;
+
         //Only add visible or teacher mods to jumpmenu
         if ($mod->visible or $isteacher) {
             $url = "$mod->mod/view.php?id=$mod->cm";