mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Fixed bug 1531, section links to invisible sections now greyed out or hidden
This commit is contained in:
parent
a96deb69e2
commit
319225a714
1 changed files with 13 additions and 3 deletions
|
@ -55,14 +55,24 @@ class CourseBlock_section_links extends MoodleBlock {
|
|||
}
|
||||
$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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue