mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-42060 block_course_list: fixed sorting of mycourses
This commit is contained in:
parent
b58bc15af5
commit
19b13d531a
@ -35,7 +35,14 @@ class block_course_list extends block_list {
|
||||
|
||||
if (empty($CFG->disablemycourses) and isloggedin() and !isguestuser() and
|
||||
!(has_capability('moodle/course:update', context_system::instance()) and $adminseesall)) { // Just print My Courses
|
||||
if ($courses = enrol_get_my_courses(NULL, 'visible DESC, fullname ASC')) {
|
||||
// As this is producing navigation sort order should default to $CFG->navsortmycoursessort instead
|
||||
// of using the default.
|
||||
if (!empty($CFG->navsortmycoursessort)) {
|
||||
$sortorder = 'visible DESC, ' . $CFG->navsortmycoursessort . ' ASC';
|
||||
} else {
|
||||
$sortorder = 'visible DESC, sortorder ASC';
|
||||
}
|
||||
if ($courses = enrol_get_my_courses(NULL, $sortorder)) {
|
||||
foreach ($courses as $course) {
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user