From 686fafc187472b6c4a09349f8123321d65c0e878 Mon Sep 17 00:00:00 2001 From: defacer Date: Mon, 31 Jan 2005 00:56:00 +0000 Subject: [PATCH] Bugfix: don't revert to full details display when clicking on the sorting links in the table headers. Remain in the display mode you were before. --- user/index.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/user/index.php b/user/index.php index 98c9f3d0a79..d2bab5fac82 100644 --- a/user/index.php +++ b/user/index.php @@ -14,9 +14,8 @@ optional_variable($lastinitial, ""); // only show students with this last initial optional_variable($firstinitial, ""); // only show students with this first initial optional_variable($perpage, "20"); // how many per page - optional_variable($_GET['format'], ''); // 'brief' for less details, '' for more - - $compactmode = ($_GET['format'] == 'brief'); + $format = optional_param('format', ''); // 'brief' for less details, '' for more + $compactmode = ($format == 'brief'); if (! $course = get_record("course", "id", $id)) { error("Course ID is incorrect"); @@ -65,7 +64,7 @@ 'brief' => get_string('detailedless'), ); // [pj] Oh, the things I do to put it in one line... :P - echo str_replace(''; $exceptions = ''; // This will be a list of userids that are shown as teachers and thus @@ -217,7 +216,7 @@ function print_user_table($users, $isteacher) { // Print one big table with abbreviated info - global $sort, $course, $dir, $CFG; + global $format, $sort, $course, $dir, $CFG; $columns = array("firstname", "lastname", "city", "country", "lastaccess"); @@ -252,7 +251,7 @@ function print_user_table($users, $isteacher) { } $columnicon = " pixpath/t/$columnicon.gif\" alt=\"\"/>"; } - $$column = "id&sort=$column&dir=$columndir\">".$colname["$column"]."$columnicon"; + $$column = "id&sort=$column&dir=$columndir&format=$format\">".$colname["$column"]."$columnicon"; } foreach ($users as $key => $user) {