Skip to content
Snippets Groups Projects
Commit 06c2c40c authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

ensure correct order, fixes #751

parent 10442aec
No related branches found
No related tags found
No related merge requests found
...@@ -194,7 +194,6 @@ class MyCoursesController extends AuthenticatedController ...@@ -194,7 +194,6 @@ class MyCoursesController extends AuthenticatedController
'responsive_type' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY && $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY_RESPONSIVE ? 'tiles' : 'tables', 'responsive_type' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY && $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY_RESPONSIVE ? 'tiles' : 'tables',
'navigation_show_only_new' => $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY, 'navigation_show_only_new' => $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY,
'group_by' => $this->getGroupField(), 'group_by' => $this->getGroupField(),
], ],
]; ];
...@@ -1055,6 +1054,7 @@ class MyCoursesController extends AuthenticatedController ...@@ -1055,6 +1054,7 @@ class MyCoursesController extends AuthenticatedController
uksort($course['navigation'], function ($a, $b) use ($positions) { uksort($course['navigation'], function ($a, $b) use ($positions) {
return array_search($a, $positions) - array_search($b, $positions); return array_search($a, $positions) - array_search($b, $positions);
}); });
$course['navigation'] = array_values($course['navigation']);
return $course; return $course;
}, },
$courses $courses
......
...@@ -880,16 +880,16 @@ class MyRealmModel ...@@ -880,16 +880,16 @@ class MyRealmModel
*/ */
public static function array_rtrim($array) public static function array_rtrim($array)
{ {
$temp = array_reverse($array); $temp = array_reverse($array, true);
$empty = true; $empty = true;
while ($empty && !empty($temp)) { while ($empty && !empty($temp)) {
$item = reset($temp); $item = reset($temp);
if ($empty = ($item === null)) { if ($empty = ($item === null)) {
$temp = array_slice($temp, 1); $temp = array_slice($temp, 1, null, true);
} }
} }
return array_reverse($temp); return array_reverse($temp, true);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment