]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10353, adding couse variable to nav bar in calendar preferences
authortoyomoyo <toyomoyo>
Mon, 15 Oct 2007 04:46:31 +0000 (04:46 +0000)
committertoyomoyo <toyomoyo>
Mon, 15 Oct 2007 04:46:31 +0000 (04:46 +0000)
calendar/export.php
calendar/lib.php
calendar/view.php

index 37a2cbf6114da59b2ccea1e71aa115bd1f0fefda..41d59c2e38670d56a9f04dad2f6837b3f71c672f 100644 (file)
@@ -9,7 +9,9 @@ $action = optional_param('action', '', PARAM_ALPHA);
 $day  = optional_param('cal_d', 0, PARAM_INT);
 $mon  = optional_param('cal_m', 0, PARAM_INT);
 $yr   = optional_param('cal_y', 0, PARAM_INT);
-$courseid = optional_param('course', 0, PARAM_INT);
+if ($courseid = optional_param('course', 0, PARAM_INT)) {
+    $course = get_record('course', 'id', $courseid); 
+}
 
 require_login();
 
@@ -24,6 +26,11 @@ $pagetitle = get_string('export', 'calendar');
 $navlinks = array();
 $now = usergetdate(time());
 
+if ($course->id != SITEID) {
+    $navlinks[] = array('name' => $course->shortname,
+                        'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
+                        'type' => 'misc');
+}
 $navlinks[] = array('name' => get_string('calendar', 'calendar'),
                     'link' =>calendar_get_link_href(CALENDAR_URL.'view.php?view=upcoming&amp;course='.$course.'&amp;',
                                                     $now['mday'], $now['mon'], $now['year']),
index e5a50b76ce898075b06d7c9ce2571d2076f4dbda..3292d70ec3886f7fa7b6c244097140cf1fbfb12f 100644 (file)
@@ -514,7 +514,11 @@ function calendar_print_event($event) {
 
     echo '</td></tr>';
     echo '<tr><td class="side">&nbsp;</td>';
-    echo '<td class="description '.$event->cssclass.'">';
+    if (isset($event->cssclass)) {
+        echo '<td class="description '.$event->cssclass.'">';
+    } else {
+        echo '<td class="description">'; 
+    }
     echo format_text($event->description, FORMAT_HTML);
     if (calendar_edit_event_allowed($event)) {
         echo '<div class="commands">';
index 506903488fccd5a7655333a278a952c42f720114..b4747e0da9a062daeb06caacfb40b43a71bde30f 100644 (file)
 
     //Link to calendar export page
     echo '<div class="bottom">';
-    print_single_button('export.php', false, get_string('exportcalendar', 'calendar'));
+    print_single_button('export.php', array('course'=>$courseid), get_string('exportcalendar', 'calendar'));
 
     if (!empty($USER->id)) {
         $authtoken = sha1($USER->username . $USER->password);