Commit b34ef43a authored by Camille Tardy's avatar Camille Tardy
Browse files

fix drop down section menu in Course header : display name of section using...


fix drop down section menu in Course header : display name of section using native function form course_format in core
Signed-off-by: Camille Tardy's avatarCamille Tardy <camille.tardy@unige.ch>
parent 0a7d3a91
......@@ -525,8 +525,11 @@ class core_renderer extends \theme_boost\output\core_renderer {
$course_modinfo = get_fast_modinfo($this->page->course->id);
$course_sections = $course_modinfo->get_section_info_all();
// Course topics list
$counter = 0;
$format = course_get_format($this->page->course);
foreach ($course_sections as $num_section) {
if ($counter != 0) {
......@@ -534,18 +537,15 @@ class core_renderer extends \theme_boost\output\core_renderer {
$context = context_course::instance($this->page->course->id);
if ((($course_sections[$counter]->visible == 0) AND (has_capability('moodle/course:create', $context))) OR ($course_sections[$counter]->visible == 1)) {
// If the section has a name
if (isset($course_sections[$counter]->name)) {
$html .= html_writer::tag('option', $course_sections[$counter]->name, array('value' => 'section-' . $counter));
} else {
$html .= html_writer::tag('option', get_string('topic', 'moodle') . ' ' . $counter, array('value' => 'section-' . $counter));
}
$sectionname = $format->get_section_name($num_section);
$html .= html_writer::tag('option', $sectionname, array('value' => 'section-' . $counter));
}
}
$counter += 1;
}
} //end topic list
$html .= html_writer::end_tag('select');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment