mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-10353, adding couse variable to nav bar in calendar preferences
This commit is contained in:
parent
9458576640
commit
9ba76792ca
3 changed files with 14 additions and 3 deletions
|
@ -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']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue