mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-42060 block_course_list: fixed sorting of mycourses
This commit is contained in:
parent
b58bc15af5
commit
19b13d531a
1 changed files with 8 additions and 1 deletions
|
@ -35,7 +35,14 @@ class block_course_list extends block_list {
|
||||||
|
|
||||||
if (empty($CFG->disablemycourses) and isloggedin() and !isguestuser() and
|
if (empty($CFG->disablemycourses) and isloggedin() and !isguestuser() and
|
||||||
!(has_capability('moodle/course:update', context_system::instance()) and $adminseesall)) { // Just print My Courses
|
!(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) {
|
foreach ($courses as $course) {
|
||||||
$coursecontext = context_course::instance($course->id);
|
$coursecontext = context_course::instance($course->id);
|
||||||
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
|
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue