]> git.mjollnir.org Git - moodle.git/commitdiff
JUmp menu from week to week
authormoodler <moodler>
Sat, 14 Jun 2003 12:17:13 +0000 (12:17 +0000)
committermoodler <moodler>
Sat, 14 Jun 2003 12:17:13 +0000 (12:17 +0000)
course/format/weeks.php

index 741fd9076a38d27e16905f1e6e408c5ea90a5661..9c9f71909885c6e3eadaadd472fd2ce1230644d0 100644 (file)
@@ -23,6 +23,7 @@
     $stradd          = get_string("add");
     $stractivities   = get_string("activities");
     $strshowallweeks = get_string("showallweeks");
+    $strweek         = get_string("week");
     if (isediting($course->id)) {
         $strstudents = moodle_strtolower($course->students);
         $strweekhide = get_string("weekhide", "", $strstudents);
     $timenow = time();
     $weekdate = $course->startdate;    // this should be 0:00 Monday of that week
     $section = 1;
+    $sectionmenu = array();
     $weekofseconds = 604800;
     $course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
 
         $endweekday = userdate($weekdate+518400, $strftimedateshort);
 
         if (!empty($displaysection) and $displaysection != $section) {  // Check this week is visible
+            $sectionmenu["week=$section"] = s("$strweek $section |     $weekday - $endweekday");
             $section++;
             $weekdate = $nextweekdate;
             continue;
         $weekdate = $nextweekdate;
     }
     echo "</table>";
+
+    if (!empty($sectionmenu)) {
+        echo "<center>";
+        echo popup_form("$CFG->wwwroot/course/view.php?id=$course->id&", $sectionmenu, 
+                   "sectionmenu", "", get_string("jumpto"), "", "", true);
+        echo "</center>";
+    }
     
     if (!empty($news) or !empty($course->showrecent)) {
         echo "</td><td width=210>";