echo format_text($event->description, FORMAT_HTML);
if (calendar_edit_event_allowed($event)) {
echo '<div class="commands">';
+ $calendarcourseid = '';
+ if (!empty($event->calendarcourseid)) {
+ $calendarcourseid = '&course='.$event->calendarcourseid;
+ }
if (empty($event->cmid)) {
- $editlink = CALENDAR_URL.'event.php?action=edit&id='.$event->id;
- $deletelink = CALENDAR_URL.'event.php?action=delete&id='.$event->id;
+ $editlink = CALENDAR_URL.'event.php?action=edit&id='.$event->id.$calendarcourseid;
+ $deletelink = CALENDAR_URL.'event.php?action=delete&id='.$event->id.$calendarcourseid;
} else {
$editlink = $CFG->wwwroot.'/course/mod.php?update='.$event->cmid.'&return=true&sesskey='.$USER->sesskey;
$deletelink = $CFG->wwwroot.'/course/mod.php?delete='.$event->cmid.'&sesskey='.$USER->sesskey;;
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'index.php?', 0, $nextmonth, $nextyear, $accesshide=true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'index.php?', 0, $prevmonth, $prevyear, true);
$content .= "\n".'<div class="calendar-controls">'. $prevlink;
- $content .= '<span class="hide"> | </span><span class="current"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month&', 1, $data['m'], $data['y']).'">'.userdate($time, get_string('strftimemonthyear')).'</a></span>';
+ $content .= '<span class="hide"> | </span><span class="current"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month'.$courseid.'&', 1, $data['m'], $data['y']).'">'.userdate($time, get_string('strftimemonthyear')).'</a></span>';
$content .= '<span class="hide"> | </span>'. $nextlink ."\n";
$content .= "<span class=\"clearer\"><!-- --></span></div>\n";
break;
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'view.php?id='.$data['id'].'&', 0, $nextmonth, $nextyear, $accesshide=true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'view.php?id='.$data['id'].'&', 0, $prevmonth, $prevyear, true);
$content .= "\n".'<div class="calendar-controls">'. $prevlink;
- $content .= '<span class="hide"> | </span><span class="current"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month&course='.$data['id'].'&', 1, $data['m'], $data['y']).'">'.userdate($time, get_string('strftimemonthyear')).'</a></span>';
+ $content .= '<span class="hide"> | </span><span class="current"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month'.$courseid.'&', 1, $data['m'], $data['y']).'">'.userdate($time, get_string('strftimemonthyear')).'</a></span>';
$content .= '<span class="hide"> | </span>'. $nextlink ."\n";
$content .= "<span class=\"clearer\"><!-- --></span></div>\n";
break;