Skip to content

Commit

Permalink
MDL-10353, adding couse variable to nav bar in calendar preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
toyomoyo committed Oct 15, 2007
1 parent 9458576 commit 9ba7679
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion calendar/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
$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();

Expand All @@ -24,6 +26,11 @@
$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']),
Expand Down
6 changes: 5 additions & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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">';
Expand Down
2 changes: 1 addition & 1 deletion calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@

//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);
Expand Down

0 comments on commit 9ba7679

Please sign in to comment.