From 2812d601059e31047a9fdabaaf6ec08e34a8e8cf Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 17 Feb 2015 10:19:56 +0100 Subject: [PATCH] Fixing header order --- main/gradebook/lib/fe/flatviewtable.class.php | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/main/gradebook/lib/fe/flatviewtable.class.php b/main/gradebook/lib/fe/flatviewtable.class.php index 8d0d6548b5..9e40ef1379 100755 --- a/main/gradebook/lib/fe/flatviewtable.class.php +++ b/main/gradebook/lib/fe/flatviewtable.class.php @@ -577,21 +577,19 @@ class FlatViewTable extends SortableTable $table_data = array(); foreach ($data_array as $user_row) { - $table_row = array(); - $count = 0; - $user_id = $user_row[$count++]; + $user_id = $user_row[0]; + unset($user_row[0]); $userInfo = api_get_user_info($user_id); if ($is_western_name_order) { - $table_row[] = $this->build_name_link($user_id, $userInfo['firstname']); - $table_row[] = $this->build_name_link($user_id, $userInfo['lastname']); + $user_row[1] = $this->build_name_link($user_id, $userInfo['firstname']); + $user_row[2] = $this->build_name_link($user_id, $userInfo['lastname']); } else { - $table_row[] = $this->build_name_link($user_id, $userInfo['lastname']); - $table_row[] = $this->build_name_link($user_id, $userInfo['firstname']); + $user_row[1] = $this->build_name_link($user_id, $userInfo['lastname']); + $user_row[2] = $this->build_name_link($user_id, $userInfo['firstname']); } - while ($count < count($user_row)) { - $table_row[] = $user_row[$count++]; - } - $table_data[] = $table_row; + $user_row = array_values($user_row); + + $table_data[] = $user_row; } return $table_data; }