From: gustav_delius Date: Sat, 5 Jun 2004 11:57:11 +0000 (+0000) Subject: Fixed bug 1531, section links to invisible sections now greyed out or hidden X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=319225a71428e9f8c364ac66c925beeeebc80bd9;p=moodle.git Fixed bug 1531, section links to invisible sections now greyed out or hidden --- diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php index eb5879ae0c..10abef16de 100644 --- a/blocks/section_links/block_section_links.php +++ b/blocks/section_links/block_section_links.php @@ -55,14 +55,24 @@ class CourseBlock_section_links extends MoodleBlock { } $text = ''; for ($i = $inc; $i <= $this->course->numsections; $i += $inc) { + $isvisible = get_field('course_sections', 'visible', 'course', $this->course->id, 'section', $i); + if (!$isvisible and !isteacher($this->course->id)) { + if ($i == $highlight) { + $highlight = 0; + } + continue; + } + $style = ($isvisible) ? '' : ' class="dimmed"'; if ($i == $highlight) { - $text .= "$i "; + $text .= "$i "; } else { - $text .= "$i "; + $text .= "$i "; } } if ($highlight) { - $text .= "
$linktext"; + $isvisible = get_field('course_sections', 'visible', 'course', $this->course->id, 'section', $highlight); + $style = ($isvisible) ? '' : ' class="dimmed"'; + $text .= "
$linktext"; } $this->content = New stdClass;