mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
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:
parent
009cc72698
commit
ca189cecf8
1 changed files with 9 additions and 1 deletions
|
@ -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";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue