]> git.mjollnir.org Git - moodle.git/commitdiff
Changed the navmenu function to show only visible-mods on the
authorstronk7 <stronk7>
Wed, 23 Apr 2003 16:32:11 +0000 (16:32 +0000)
committerstronk7 <stronk7>
Wed, 23 Apr 2003 16:32:11 +0000 (16:32 +0000)
jumpmenu. Everything is showed when the user is a teacher.

lib/weblib.php

index daa467a038c89648908d1993137e074e11bdcf08..2c1fb99d391257213fa2c964a5692a592c6333bd 100644 (file)
@@ -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);