MDL-71324 course: Render hasinfo class only if necessary.

This commit is contained in:
Luca Bösch
2021-04-17 11:49:28 +02:00
parent 9600becce3
commit e2b1ede0dd
+2 -1
View File
@@ -837,7 +837,8 @@ class core_course_renderer extends plugin_renderer_base {
$output = '';
if ($modulehtml = $this->course_section_cm($course, $completioninfo, $mod, $sectionreturn, $displayoptions)) {
$infoclass = '';
if (($course->showcompletionconditions == COMPLETION_SHOW_CONDITIONS) || !empty($course->showactivitydates)) {
if ((($course->enablecompletion == COMPLETION_ENABLED) &&
($course->showcompletionconditions == COMPLETION_SHOW_CONDITIONS)) || !empty($course->showactivitydates)) {
// This will apply styles to the course homepage when the activity information output component is displayed.
$infoclass = 'hasinfo';
}