Fixes MDL-6838, uses 'inline-list' class (label with ordered list <ol> not redendered with numbers)

This commit is contained in:
nfreear 2006-12-01 15:54:46 +00:00
parent 9dd68bc79b
commit 764d1d20dd

View file

@ -34,7 +34,7 @@ class block_section_links extends block_base {
return $this->content; return $this->content;
} }
$this->content = New stdClass; $this->content = new stdClass;
$this->content->footer = ''; $this->content->footer = '';
$this->content->text = ''; $this->content->text = '';
@ -71,7 +71,7 @@ class block_section_links extends block_base {
} else { } else {
$link = '#section-'; $link = '#section-';
} }
$text = ''; $text = '<ol class="inline-list">';
for ($i = $inc; $i <= $course->numsections; $i += $inc) { for ($i = $inc; $i <= $course->numsections; $i += $inc) {
$isvisible = get_field('course_sections', 'visible', 'course', $this->instance->pageid, 'section', $i); $isvisible = get_field('course_sections', 'visible', 'course', $this->instance->pageid, 'section', $i);
if (!$isvisible and !has_capability('moodle/course:update', $context)) { if (!$isvisible and !has_capability('moodle/course:update', $context)) {
@ -79,16 +79,17 @@ class block_section_links extends block_base {
} }
$style = ($isvisible) ? '' : ' class="dimmed"'; $style = ($isvisible) ? '' : ' class="dimmed"';
if ($i == $highlight) { if ($i == $highlight) {
$text .= "<a href=\"$link$i\"$style><b>$i</b></a> "; $text .= "<li><a href=\"$link$i\"$style><b>$i</b></a></li>\n";
} else { } else {
$text .= "<a href=\"$link$i\"$style>$i</a> "; $text .= "<li><a href=\"$link$i\"$style>$i</a></li>\n";
} }
} }
$text .= '</ol>';
if ($highlight) { if ($highlight) {
$isvisible = get_field('course_sections', 'visible', 'course', $this->instance->pageid, 'section', $highlight); $isvisible = get_field('course_sections', 'visible', 'course', $this->instance->pageid, 'section', $highlight);
if ($isvisible or has_capability('moodle/course:update', $context)) { if ($isvisible or has_capability('moodle/course:update', $context)) {
$style = ($isvisible) ? '' : ' class="dimmed"'; $style = ($isvisible) ? '' : ' class="dimmed"';
$text .= "<br /><a href=\"$link$highlight\"$style>$linktext</a>"; $text .= "\n<a href=\"$link$highlight\"$style>$linktext</a>";
} }
} }
@ -98,4 +99,5 @@ class block_section_links extends block_base {
return $this->content; return $this->content;
} }
} }
?>
?>