Skip to content

Commit 2812d60

Browse files
committed
Fixing header order
1 parent 48688c9 commit 2812d60

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

main/gradebook/lib/fe/flatviewtable.class.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -577,21 +577,19 @@ public function get_table_data($from = 1, $per_page = null, $column = null, $dir
577577

578578
$table_data = array();
579579
foreach ($data_array as $user_row) {
580-
$table_row = array();
581-
$count = 0;
582-
$user_id = $user_row[$count++];
580+
$user_id = $user_row[0];
581+
unset($user_row[0]);
583582
$userInfo = api_get_user_info($user_id);
584583
if ($is_western_name_order) {
585-
$table_row[] = $this->build_name_link($user_id, $userInfo['firstname']);
586-
$table_row[] = $this->build_name_link($user_id, $userInfo['lastname']);
584+
$user_row[1] = $this->build_name_link($user_id, $userInfo['firstname']);
585+
$user_row[2] = $this->build_name_link($user_id, $userInfo['lastname']);
587586
} else {
588-
$table_row[] = $this->build_name_link($user_id, $userInfo['lastname']);
589-
$table_row[] = $this->build_name_link($user_id, $userInfo['firstname']);
587+
$user_row[1] = $this->build_name_link($user_id, $userInfo['lastname']);
588+
$user_row[2] = $this->build_name_link($user_id, $userInfo['firstname']);
590589
}
591-
while ($count < count($user_row)) {
592-
$table_row[] = $user_row[$count++];
593-
}
594-
$table_data[] = $table_row;
590+
$user_row = array_values($user_row);
591+
592+
$table_data[] = $user_row;
595593
}
596594
return $table_data;
597595
}

0 commit comments

Comments
 (0)