MDL-10353, adding couse variable to nav bar in calendar preferences

This commit is contained in:
toyomoyo
2007-10-15 04:46:05 +00:00
parent 8241c5e324
commit bee3222be8
4 changed files with 20 additions and 8 deletions
+13 -5
View 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,11 +26,17 @@ $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.'&',
'link' =>calendar_get_link_href(CALENDAR_URL.'view.php?view=upcoming&course='.$courseid.'&',
$now['mday'], $now['mon'], $now['year']),
'type' => 'misc');
$navlinks[] = array('name' => $pagetitle, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
if(!checkdate($mon, $day, $yr)) {
@@ -105,13 +113,13 @@ list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
$getvars = 'cal_d='.$day.'&cal_m='.$mon.'&cal_y='.$yr; // For filtering
echo '<div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $course, 'm' => $prevmon, 'y' => $prevyr));
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $course, 'm' => $mon, 'y' => $yr));
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $mon, 'y' => $yr));
echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $course, 'm' => $nextmon, 'y' => $nextyr));
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $nextmon, 'y' => $nextyr));
echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
echo '</div>';
+5 -1
View 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">';
+1 -1
View File
@@ -64,7 +64,7 @@
'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
'type' => 'misc');
}
$navlinks[] = array('name' => $strpreferences, 'link' => 'view.php', 'type' => 'misc');
$navlinks[] = array('name' => $strpreferences, 'link' => 'null', 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$site->shortname: $strcalendar: $strpreferences", $strcalendar, $navigation,
+1 -1
View File
@@ -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);