From ca189cecf8145fd737e018daa74d89ab80718999 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 27 Apr 2004 16:29:21 +0000 Subject: [PATCH] Now, in topics format, every course can decide about how to display hidden topics (collapsed or invisible) Small change to navmenu() to support it --- lib/weblib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index 8cb41db88c..8d9110c7f3 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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"; -- 2.39.5