Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug 1531, section links to invisible sections now greyed out or…

… hidden
  • Loading branch information...
commit 345692a64d63f9a135088ef33b323f0744098b35 1 parent 86a8e90
gustav_delius authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 blocks/section_links/block_section_links.php
View
9 blocks/section_links/block_section_links.php
@@ -57,9 +57,6 @@ function get_content() {
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"';
@@ -71,8 +68,10 @@ function get_content() {
}
if ($highlight) {
$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>";
+ if ($isvisible or isteacher($this->course->id)) {
+ $style = ($isvisible) ? '' : ' class="dimmed"';
+ $text .= "<br><a href=\"$link$highlight\"$style>$linktext</a>";
+ }
}
$this->content = New stdClass;
Please sign in to comment.
Something went wrong with that request. Please try again.