Commit fc07f6ad authored by Luca Bösch's avatar Luca Bösch

MDL-32350 admin: Sort users by country ASC and DESC

parent 5f54a876
......@@ -256,11 +256,17 @@
$users[$key]->country = $countries[$user->country];
}
}
if ($sort == "country") { // Need to resort by full country name, not code
if ($sort == "country") {
// Need to resort by full country name, not code.
foreach ($users as $user) {
$susers[$user->id] = $user->country;
}
asort($susers);
// Sort by country name, according to $dir.
if ($dir === 'DESC') {
arsort($susers);
} else {
asort($susers);
}
foreach ($susers as $key => $value) {
$nusers[] = $users[$key];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment