From: toyomoyo Date: Mon, 15 Oct 2007 04:46:31 +0000 (+0000) Subject: MDL-10353, adding couse variable to nav bar in calendar preferences X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9ba76792cab29b8aead6f6ed260925565fa9d2b2;p=moodle.git MDL-10353, adding couse variable to nav bar in calendar preferences --- diff --git a/calendar/export.php b/calendar/export.php index 37a2cbf611..41d59c2e38 100644 --- a/calendar/export.php +++ b/calendar/export.php @@ -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&course='.$course.'&', $now['mday'], $now['mon'], $now['year']), diff --git a/calendar/lib.php b/calendar/lib.php index e5a50b76ce..3292d70ec3 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -514,7 +514,11 @@ function calendar_print_event($event) { echo ''; echo ' '; - echo ''; + if (isset($event->cssclass)) { + echo ''; + } else { + echo ''; + } echo format_text($event->description, FORMAT_HTML); if (calendar_edit_event_allowed($event)) { echo '
'; diff --git a/calendar/view.php b/calendar/view.php index 506903488f..b4747e0da9 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -165,7 +165,7 @@ //Link to calendar export page echo '
'; - 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);