mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
MDL-32505/MDL-32508 course: fix section_links block
Now course_display has gone
This commit is contained in:
parent
fe221dd583
commit
3246428b95
@ -102,15 +102,6 @@ class block_section_links extends block_base {
|
||||
}
|
||||
}
|
||||
|
||||
if (isloggedin()) {
|
||||
$display = $DB->get_field('course_display', 'display', array('course'=>$this->page->course->id, 'userid'=>$USER->id));
|
||||
}
|
||||
if (!empty($display)) {
|
||||
$link = $CFG->wwwroot.'/course/view.php?id='.$this->page->course->id.'&'.$sectionname.'=';
|
||||
} else {
|
||||
$link = '#section-';
|
||||
}
|
||||
|
||||
$sql = "SELECT section, visible
|
||||
FROM {course_sections}
|
||||
WHERE course = ? AND
|
||||
@ -129,9 +120,9 @@ class block_section_links extends block_base {
|
||||
}
|
||||
$style = ($isvisible) ? '' : ' class="dimmed"';
|
||||
if ($i == $highlight) {
|
||||
$text .= "<li><a href=\"$link$i\"$style><strong>$i</strong></a></li>\n";
|
||||
$text .= '<li><a href="'.course_get_url($course, $i)."\"$style><strong>$i</strong></a></li>\n";
|
||||
} else {
|
||||
$text .= "<li><a href=\"$link$i\"$style>$i</a></li>\n";
|
||||
$text .= '<li><a href="'.course_get_url($course, $i)."\"$style>$i</a></li>\n";
|
||||
}
|
||||
}
|
||||
$text .= '</ol>';
|
||||
@ -139,7 +130,7 @@ class block_section_links extends block_base {
|
||||
$isvisible = $sections[$highlight]->visible;
|
||||
if ($isvisible or has_capability('moodle/course:update', $context)) {
|
||||
$style = ($isvisible) ? '' : ' class="dimmed"';
|
||||
$text .= "\n<a href=\"$link$highlight\"$style>$linktext</a>";
|
||||
$text .= "\n<a href=\"".course_get_url($course, $highlight)."\"$style>$linktext</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user