From f1020d0dd253c8b75b40158a6444d1a9893bd2e9 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Sat, 29 May 2004 10:40:07 +0000 Subject: [PATCH] section links now preserve focused view, see http://moodle.org/mod/forum/discuss.php?d=7648#37555 --- blocks/section_links/block_section_links.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php index 57349ee9d6..eb5879ae0c 100644 --- a/blocks/section_links/block_section_links.php +++ b/blocks/section_links/block_section_links.php @@ -33,10 +33,12 @@ class CourseBlock_section_links extends MoodleBlock { 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,20 +49,20 @@ class CourseBlock_section_links extends MoodleBlock { } $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=all"; + $link = "$CFG->wwwroot/course/view.php?id=$courseid&$sectionname="; } else { - $link = ''; + $link = '#'; } $text = ''; for ($i = $inc; $i <= $this->course->numsections; $i += $inc) { if ($i == $highlight) { - $text .= "$i "; + $text .= "$i "; } else { - $text .= "$i "; + $text .= "$i "; } } if ($highlight) { - $text .= "
$linktext"; + $text .= "
$linktext"; } $this->content = New stdClass; -- 2.39.5