]> git.mjollnir.org Git - moodle.git/commitdiff
The filters are back with a vengeance in event.php! Coupled with the breadcrumb
authordefacer <defacer>
Mon, 24 May 2004 12:12:41 +0000 (12:12 +0000)
committerdefacer <defacer>
Mon, 24 May 2004 12:12:41 +0000 (12:12 +0000)
course mirroring, everything works like a charm now! :-)

calendar/event.php
calendar/lib.php
calendar/set.php

index 32574790036f5ed6c29da1d3e8af04684d30a26e..397a98ae5eb5d3fd239e6914d41a3fabf6c5c2a2 100644 (file)
@@ -52,6 +52,7 @@
 
     require_variable($_REQUEST['action']);
     optional_variable($_REQUEST['id']);
+    optional_variable($_REQUEST['type'], 'select');
     $_REQUEST['id'] = intval($_REQUEST['id']); // Always a good idea, against SQL injections
 
     if(!$site = get_site()) {
     // START: Last column (3-month display)
     echo '<td style="vertical-align: top; width: 180px;">';
 
-    // [pj] There is a whole class of problems with minimonths in event.php, which
-    // was why there were no minimonths before... I fixed them as best I could for now.
-
-    // These were left out, and the whole thing was simply broken
     $defaultcourses = calendar_get_default_courses();
     echo calendar_overlib_html();
     calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses);
     print_side_block_start(get_string('monthlyview', 'calendar'), '', 'sideblockmain');
     list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
     list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
-    // This is also broken; set.php doesn't know how to redirect back to event.php
-    // echo calendar_filter_controls('event');
+
+    echo calendar_filter_controls('event', 'action='.$_REQUEST['action'].'&amp;type='.$_REQUEST['type'].'&amp;id='.$_REQUEST['id']);
     echo '<p>';
     echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr));
     echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
index 8216cc4e850f07aa0fdbc1b41e97bb39ac9d9b15..11bba721c6aa5b4482e24eff94d04d2c88e89d1e 100644 (file)
@@ -611,11 +611,10 @@ function calendar_filter_controls($type, $vars = NULL, $course = NULL) {
     $getvars = '';
 
     switch($type) {
+        case 'event':
         case 'upcoming':
-            $getvars = '&amp;from=upcoming';
-        break;
         case 'day':
-            $getvars = '&amp;from=day';
+            $getvars = '&amp;from='.$type;
         break;
         case 'course':
             $getvars = '&amp;from=course&amp;id='.$_GET['id'];
index 0358712e9967dd24c88f50bf54a7201201dc00c4..3989bdb2fe540a69cc3bdfe0512b81cf2179427e 100644 (file)
     }
 
     switch($_GET['from']) {
+        case 'event':
+            redirect(CALENDAR_URL.'event.php?action='.$_GET['action'].'&type='.$_GET['type'].'&id='.intval($_GET['id']));
+        break;
         case 'month':
-        redirect($CFG->wwwroot.'/calendar/view.php?view=month&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
+            redirect(CALENDAR_URL.'view.php?view=month&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
         break;
         case 'upcoming':
-        redirect($CFG->wwwroot.'/calendar/view.php?view=upcoming');
+            redirect(CALENDAR_URL.'view.php?view=upcoming');
         break;
         case 'day':
-        redirect($CFG->wwwroot.'/calendar/view.php?view=day&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
+            redirect(CALENDAR_URL.'view.php?view=day&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
         break;
         case 'course':
-        redirect($CFG->wwwroot.'/course/view.php?id='.intval($_GET['id']));
+            redirect(CALENDAR_URL.'view.php?id='.intval($_GET['id']));
         break;
         default: