Línea 41... |
Línea 41... |
41 |
* @param bool $showsectionname Whether or not section name should be displayed.
|
41 |
* @param bool $showsectionname Whether or not section name should be displayed.
|
42 |
* @return string The HTML to display.
|
42 |
* @return string The HTML to display.
|
43 |
*/
|
43 |
*/
|
44 |
public function render_section_links(stdClass $course, array $sections, $jumptosection = false, $showsectionname = false) {
|
44 |
public function render_section_links(stdClass $course, array $sections, $jumptosection = false, $showsectionname = false) {
|
45 |
$olparams = $showsectionname ? ['class' => 'unlist'] : ['class' => 'inline-list'];
|
45 |
$olparams = $showsectionname ? ['class' => 'unlist'] : ['class' => 'inline-list'];
|
- |
|
46 |
$liparams = $showsectionname ? ['class' => 'mb-2'] : [];
|
46 |
$html = html_writer::start_tag('ol', $olparams);
|
47 |
$html = html_writer::start_tag('ol', $olparams);
|
47 |
foreach ($sections as $section) {
|
48 |
foreach ($sections as $section) {
|
48 |
$attributes = array();
|
49 |
$attributes = array();
|
49 |
if (!$section->visible) {
|
50 |
if (!$section->visible) {
|
50 |
$attributes['class'] = 'dimmed';
|
51 |
$attributes['class'] = 'dimmed';
|
51 |
}
|
52 |
}
|
52 |
$html .= html_writer::start_tag('li');
|
53 |
$html .= html_writer::start_tag('li', $liparams);
|
53 |
$sectiontext = $section->section;
|
54 |
$sectiontext = $section->section;
|
54 |
if ($showsectionname) {
|
55 |
if ($showsectionname) {
|
55 |
$sectiontext .= ': ' . $section->name;
|
56 |
$sectiontext = $section->name;
|
56 |
}
|
57 |
}
|
57 |
if ($section->highlight) {
|
58 |
if ($section->highlight) {
|
58 |
$sectiontext = html_writer::tag('strong', $sectiontext);
|
59 |
$sectiontext = html_writer::tag('strong', $sectiontext);
|
59 |
}
|
60 |
}
|
60 |
$html .= html_writer::link(
|
61 |
$html .= html_writer::link(
|