Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-32505/MDL-32508 course: fix section_links block

Now course_display has gone
  • Loading branch information...
commit 3246428b95815c76cfeefb3e6c9fe7347458d8ee 1 parent fe221dd
@danpoltawski danpoltawski authored
Showing with 3 additions and 12 deletions.
  1. +3 −12 blocks/section_links/block_section_links.php
View
15 blocks/section_links/block_section_links.php
@@ -102,15 +102,6 @@ function get_content() {
}
}
- 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 @@ function get_content() {
}
$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 @@ function get_content() {
$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>";
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.