Now, in topics format, every course can decide about how to

display hidden topics (collapsed or invisible)
Small change to navmenu() to support it
This commit is contained in:
stronk7 2004-04-27 16:29:21 +00:00
parent 009cc72698
commit ca189cecf8

View file

@ -1789,14 +1789,22 @@ function navmenu($course, $cm=NULL, $targetwindow="self") {
$logslink = NULL; $logslink = NULL;
$flag = false; $flag = false;
$sectionrecs = get_records("course_sections","course","$course->id","section","section,visible");
foreach ($modinfo as $mod) { foreach ($modinfo as $mod) {
if ($mod->mod == "label") { if ($mod->mod == "label") {
continue; continue;
} }
if ($mod->section > 0 and $section <> $mod->section) { 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; $section = $mod->section;
//Only add visible or teacher mods to jumpmenu //Only add visible or teacher mods to jumpmenu
if ($mod->visible or $isteacher) { if ($mod->visible or $isteacher) {
$url = "$mod->mod/view.php?id=$mod->cm"; $url = "$mod->mod/view.php?id=$mod->cm";