From: martin Date: Sat, 21 Sep 2002 06:12:54 +0000 (+0000) Subject: Much better look for user index X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e6b9ee042de6e02d4e8501b9b98c3020fe6d1918;p=moodle.git Much better look for user index --- diff --git a/pix/t/down.gif b/pix/t/down.gif index e867c016e0..693c3749f6 100644 Binary files a/pix/t/down.gif and b/pix/t/down.gif differ diff --git a/pix/t/up.gif b/pix/t/up.gif index e2cab75b4e..6de0cf15c0 100644 Binary files a/pix/t/up.gif and b/pix/t/up.gif differ diff --git a/user/index.php b/user/index.php index 4bd1f610d0..849c9d28bf 100644 --- a/user/index.php +++ b/user/index.php @@ -8,7 +8,7 @@ require_variable($id); //course optional_variable($sort, "u.lastaccess"); //how to sort students - optional_variable($dir,"ASC"); //how to sort students + optional_variable($dir,"DESC"); //how to sort students if (! $course = get_record("course", "id", $id)) { error("Course ID is incorrect"); @@ -50,20 +50,15 @@ if ($students = get_course_students($course->id, "$sort $dir")) { $numstudents = count($students); echo "

$numstudents $course->students

"; - if ($numstudents < 30) { + if ($numstudents > 30) { foreach ($students as $student) { print_user($student, $course, $string); } } else { // Print one big table with abbreviated info - if ($dir == "ASC") { - $dir = "DESC"; - } else { - $dir = "ASC"; - } $table->head = array (" ", - "id&sort=u.firstname&dir=$dir\">$string->name", - "id&sort=u.country&dir=$dir\">$string->location", - "id&sort=u.lastaccess&dir=$dir\">$string->lastaccess"); + "$string->name id&sort=u.firstname&dir=ASC\">", + "$string->location id&sort=u.country&dir=ASC\">", + "$string->lastaccess id&sort=u.lastaccess&dir=DESC\">"); $table->align = array ("LEFT", "LEFT", "LEFT", "LEFT"); $table->size = array ("35", "*", "*", "*"); @@ -76,7 +71,7 @@ } $table->data[] = array (print_user_picture($student->id, $course->id, $student->picture, false, true), - " wwwroot/user/view.php?id=$student->id&course=$course->id\">$student->firstname $student->lastname", + "wwwroot/user/view.php?id=$student->id&course=$course->id\">$student->firstname $student->lastname", "$student->city, ".$COUNTRIES["$student->country"], "$lastaccess"); }