MDL-73683 core_courseformat: format section visible logic
Move the section visible logic to the format base class. This way format plugins can decide whenever a section is visible or not instead of using format custom settings from core.
This commit is contained in:
@@ -1033,13 +1033,8 @@ abstract class section_renderer extends core_course_renderer {
|
||||
// Activities inside this section are 'orphaned', this section will be printed as 'stealth' below.
|
||||
continue;
|
||||
}
|
||||
// Show the section if the user is permitted to access it, OR if it's not available
|
||||
// but there is some available info text which explains the reason & should display,
|
||||
// OR it is hidden but the course has a setting to display hidden sections as unavilable.
|
||||
$showsection = $thissection->uservisible ||
|
||||
($thissection->visible && !$thissection->available && !empty($thissection->availableinfo)) ||
|
||||
(!$thissection->visible && !$course->hiddensections);
|
||||
if (!$showsection) {
|
||||
|
||||
if (!$format->is_section_visible($thissection)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user