Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better country sorting on user index in a course

  • Loading branch information...
commit adcb3ac53d7f3ab912a2bdeaf53392377c423b1a 1 parent 7c3cf7f
martin authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 user/index.php
View
14 user/index.php
@@ -78,6 +78,20 @@
}
}
+ foreach ($students as $key => $student) {
+ $students[$key]->country = $COUNTRIES[$student->country];
+ }
+ if ($sort == "country") { // Need to re-sort by full country name, not code
+ foreach ($students as $student) {
+ $sstudents[$student->id] = $student->country;
+ }
+ asort($sstudents);
+ foreach ($sstudents as $key => $value) {
+ $nstudents[] = $students[$key];
+ }
+ $students = $nstudents;
+ }
+
$table->head = array (" ", $name, $city, $country, $lastaccess);
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT");
$table->size = array ("10", "*", "*", "*", "*");
Please sign in to comment.
Something went wrong with that request. Please try again.