}
$text = '<font size=-1>';
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 .= "<a href=\"$link$i\"><b>$i</b></a> ";
+ $text .= "<a href=\"$link$i\"$style><b>$i</b></a> ";
} else {
- $text .= "<a href=\"$link$i\">$i</a> ";
+ $text .= "<a href=\"$link$i\"$style>$i</a> ";
}
}
if ($highlight) {
- $text .= "<br><a href=\"$link$highlight\">$linktext</a>";
+ $isvisible = get_field('course_sections', 'visible', 'course', $this->course->id, 'section', $highlight);
+ $style = ($isvisible) ? '' : ' class="dimmed"';
+ $text .= "<br><a href=\"$link$highlight\"$style>$linktext</a>";
}
$this->content = New stdClass;