From: stronk7 Date: Wed, 23 Apr 2003 16:32:11 +0000 (+0000) Subject: Changed the navmenu function to show only visible-mods on the X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cf055081efe3390eb2fbec1757401f448991904f;p=moodle.git Changed the navmenu function to show only visible-mods on the jumpmenu. Everything is showed when the user is a teacher. --- diff --git a/lib/weblib.php b/lib/weblib.php index daa467a038..2c1fb99d39 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -995,15 +995,18 @@ function navmenu($course, $cm=NULL) { $menu[] = "-------------- $strsection $mod->section --------------"; } $section = $mod->section; - $url = "$mod->mod/view.php?id=$mod->cm"; - if ($cm == $mod->cm) { - $selected = $url; - } - $mod->name = urldecode($mod->name); - if (strlen($mod->name) > 55) { - $mod->name = substr($mod->name, 0, 50)."..."; + //Only add visible or teacher mods to jumpmenu + if ($mod->visible or isteacher($course->id)) { + $url = "$mod->mod/view.php?id=$mod->cm"; + if ($cm == $mod->cm) { + $selected = $url; + } + $mod->name = urldecode($mod->name); + if (strlen($mod->name) > 55) { + $mod->name = substr($mod->name, 0, 50)."..."; + } + $menu[$url] = $mod->name; } - $menu[$url] = $mod->name; } return popup_form("$CFG->wwwroot/mod/", $menu, "navmenu", $selected, get_string("jumpto"), "", "", true);