diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php index 115d017244cc9..72bf5bec26cbb 100644 --- a/blocks/section_links/block_section_links.php +++ b/blocks/section_links/block_section_links.php @@ -33,10 +33,12 @@ function get_content() { if ($this->course->format == 'weeks') { $highlight = ceil((time()-$this->course->startdate)/604800); $linktext = get_string('jumptocurrentweek', 'block_section_links'); + $sectionname = 'week'; } else if ($this->course->format == 'topics') { $highlight = $this->course->marker; $linktext = get_string('jumptocurrenttopic', 'block_section_links'); + $sectionname = 'topic'; } $inc = 1; if ($this->course->numsections > 22) { @@ -47,7 +49,7 @@ function get_content() { } $courseid = $this->course->id; if ($display = get_field('course_display', 'display', 'course', $courseid, 'userid', $USER->id)) { - $link = "$CFG->wwwroot/course/view.php?id=$courseid&topic="; + $link = "$CFG->wwwroot/course/view.php?id=$courseid&$sectionname="; } else { $link = '#'; }