Merge branch 'MDL-72736-master-v3' of git://github.com/peterRd/moodle

This commit is contained in:
Ilya Tregubov 2021-11-01 08:19:24 +01:00
commit 03eca63387
2 changed files with 10 additions and 6 deletions

View file

@ -79,6 +79,7 @@ class content implements renderable, templatable {
* @return stdClass data context for a mustache template
*/
public function export_for_template(\renderer_base $output) {
global $PAGE;
$format = $this->format;
// Most formats uses section 0 as a separate section so we remove from the list.
@ -99,12 +100,13 @@ class content implements renderable, templatable {
// The single section format has extra navigation.
$singlesection = $this->format->get_section_number();
if ($singlesection) {
if (!$PAGE->theme->usescourseindex) {
$sectionnavigation = new $this->sectionnavigationclass($format, $singlesection);
$data->sectionnavigation = $sectionnavigation->export_for_template($output);
$sectionselector = new $this->sectionselectorclass($format, $sectionnavigation);
$data->sectionselector = $sectionselector->export_for_template($output);
}
$data->hasnavigation = true;
$data->singlesection = array_shift($data->sections);
$data->sectionreturn = $singlesection;

View file

@ -4,6 +4,8 @@
"blocks/tests/behat/hide_blocks.feature",
"blocks/tests/behat/move_blocks.feature",
"course/tests/behat/activity_navigation.feature",
"course/tests/behat/activity_navigation_with_restrictions.feature"
"course/tests/behat/activity_navigation_with_restrictions.feature",
"course/tests/behat/paged_course_navigation.feature",
"course/tests/behat/section_visibility.feature"
]
}