Permalink
Browse files

Added navmenu in more places

  • Loading branch information...
1 parent 3e50a13 commit dfc9ba9bbe307bc0ea30dcdb17e8715df2f2b2fa moodler committed Nov 10, 2002
View
8 lib/moodlelib.php
@@ -387,7 +387,7 @@ function update_module_button($moduleid, $courseid, $string) {
}
-function navmenu($course, $cm) {
+function navmenu($course, $cm=NULL) {
// Given a course and a (current) coursemodule
// This function returns a small popup menu with all the
// course activity modules in it, as a navigation menu
@@ -396,6 +396,10 @@ function navmenu($course, $cm) {
global $CFG;
+ if ($cm) {
+ $cm = $cm->id;
+ }
+
if ($course->format == 'weeks') {
$strsection = get_string("week");
} else {
@@ -413,7 +417,7 @@ function navmenu($course, $cm) {
}
$section = $mod->section;
$url = "$mod->mod/view.php?id=$mod->cm";
- if ($cm->id == $mod->cm) {
+ if ($cm == $mod->cm) {
$selected = $url;
}
$mod->name = urldecode($mod->name);
View
2 mod/assignment/index.php
@@ -25,7 +25,7 @@
$strsubmitted = get_string("submitted", "assignment");
- print_header("$course->shortname: $strassignments", "$course->fullname", "$navigation $strassignments", "");
+ print_header("$course->shortname: $strassignments", "$course->fullname", "$navigation $strassignments", "", "", true, "", navmenu($course));
if (! $assignments = get_all_instances_in_course("assignment", $course->id, "cw.section ASC")) {
notice("There are no assignments", "../../course/view.php?id=$course->id");
View
2 mod/choice/index.php
@@ -21,7 +21,7 @@
$strchoices = get_string("modulenameplural", "choice");
print_header("$course->shortname: $strchoices", "$course->fullname",
- "$navigation $strchoices", "");
+ "$navigation $strchoices", "", "", true, "", navmenu($course));
if (! $choices = get_all_instances_in_course("choice", $course->id, "cw.section ASC")) {
View
6 mod/forum/discuss.php
@@ -22,6 +22,10 @@
notify("Bad forum ID stored in this discussion");
}
+ if (!$cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
+ notify("Bad coursemodule for this discussion");
+ }
+
if ($course->category) {
require_login($course->id);
}
@@ -57,7 +61,7 @@
if ($course->category) {
print_header("$course->shortname: $discussion->name", "$course->fullname",
"<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> ->
- $navmiddle -> $navtail", "", "", true);
+ $navmiddle -> $navtail", "", "", true, "", navmenu($course, $cm));
} else {
print_header("$course->shortname: $discussion->name", "$course->fullname",
"$navmiddle -> $navtail", "", "", true);
View
3 mod/forum/index.php
@@ -28,7 +28,8 @@
if ($course->category) {
print_header("$course->shortname: $strforums", "$course->fullname",
- "<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> -> $strforums");
+ "<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> -> $strforums",
+ "", "", true, "", navmenu($course));
} else {
print_header("$course->shortname: $strforums", "$course->fullname", "$strforums");
}
View
5 mod/forum/post.php
@@ -250,6 +250,7 @@
require_login($course->id);
+
if ($post->discussion) {
if (! $toppost = get_record_sql("SELECT * FROM forum_posts
WHERE discussion='$post->discussion'
@@ -277,10 +278,12 @@
$navmiddle = "<A HREF=\"../forum/index.php?id=$course->id\">$strforums</A> -> <A HREF=\"view.php?f=$forum->id\">$forum->name</A>";
+ $cm = get_coursemodule_from_instance("forum", $forum->id, $course->id);
+
if ($course->category) {
print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname",
"<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> ->
- $navmiddle -> $navtail", "$forumstart");
+ $navmiddle -> $navtail", "$forumstart", "", true, "", navmenu($course, $cm));
} else {
print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname",
"$navmiddle -> $navtail", "");
View
3 mod/journal/index.php
@@ -25,7 +25,8 @@
$strquestion = get_string("question");
$stranswer = get_string("answer");
- print_header("$course->shortname: $strjournals", "$course->fullname", "$navigation $strjournals", "");
+ print_header("$course->shortname: $strjournals", "$course->fullname", "$navigation $strjournals",
+ "", "", true, "", navmenu($course));
if (! $journals = get_all_instances_in_course("journal", $course->id, "cw.section ASC")) {
View
3 mod/quiz/index.php
@@ -25,7 +25,8 @@
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
}
- print_header("$course->shortname: $strquizzes", "$course->fullname", "$navigation $strquizzes");
+ print_header("$course->shortname: $strquizzes", "$course->fullname", "$navigation $strquizzes",
+ "", "", true, "", navmenu($course));
// Get all the appropriate data
View
3 mod/resource/index.php
@@ -23,7 +23,8 @@
$strsummary = get_string("summary");
$strlastmodified = get_string("lastmodified");
- print_header("$course->shortname: $strresources", "$course->fullname", "$navigation $strresources");
+ print_header("$course->shortname: $strresources", "$course->fullname", "$navigation $strresources",
+ "", "", true, "", navmenu($course));
if ($course->format == "weeks" or $course->format == "topics") {
$sortorder = "cw.section ASC";
View
3 mod/survey/index.php
@@ -25,7 +25,8 @@
$strdone = get_string("done", "survey");
$strnotdone = get_string("notdone", "survey");
- print_header("$course->shortname: $strsurveys", "$course->fullname", "$navigation $strsurveys", "");
+ print_header("$course->shortname: $strsurveys", "$course->fullname", "$navigation $strsurveys",
+ "", "", true, "", navmenu($course));
if (! $surveys = get_all_instances_in_course("survey", $course->id, "cw.section ASC")) {
notice("There are no surveys.", "../../course/view.php?id=$course->id");

0 comments on commit dfc9ba9

Please sign in to comment.