]> git.mjollnir.org Git - moodle.git/commitdiff
Better country sorting on user index in a course
authormartin <martin>
Sun, 22 Sep 2002 16:16:13 +0000 (16:16 +0000)
committermartin <martin>
Sun, 22 Sep 2002 16:16:13 +0000 (16:16 +0000)
user/index.php

index 3a4a1d8adf773f4d9b6ea83f3082acdf8c21bd93..788fe1047f1919e27d31f33b4ffe2c887e6aba9e 100644 (file)
                 }
             }
 
+            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 ("&nbsp;", $name, $city, $country, $lastaccess);
             $table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT");
             $table->size = array ("10", "*", "*", "*", "*");