MDL-57636 frontpage: Fix display enrolled courses
This commit is contained in:
@@ -188,7 +188,8 @@ if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) {
|
||||
$frontpagelayout = $CFG->frontpage;
|
||||
}
|
||||
|
||||
foreach (explode(',', $frontpagelayout) as $v) {
|
||||
$frontpageoptions = explode(',', $frontpagelayout);
|
||||
foreach ($frontpageoptions as $v) {
|
||||
switch ($v) {
|
||||
// Display the main part of the front page.
|
||||
case FRONTPAGENEWS:
|
||||
@@ -256,8 +257,13 @@ foreach (explode(',', $frontpagelayout) as $v) {
|
||||
|
||||
echo html_writer::tag('span', '', array('class' => 'skip-block-to', 'id' => 'skipmycourses'));
|
||||
break;
|
||||
} else {
|
||||
// Temp fix/fallback in order to display available courses when enrolled courses should be shown,
|
||||
// but user is not enrolled in any course.
|
||||
if (array_search(FRONTPAGEALLCOURSELIST, $frontpageoptions)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// No "break" here. If there are no enrolled courses - continue to 'Available courses'.
|
||||
|
||||
case FRONTPAGEALLCOURSELIST:
|
||||
$availablecourseshtml = $courserenderer->frontpage_available_courses();
|
||||
|
||||
Reference in New Issue
Block a user