mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-74171 core_question: qbank_plugins page table sort.
This commit is contained in:
parent
a23f0bff3e
commit
102c93edb5
1 changed files with 12 additions and 0 deletions
|
@ -134,6 +134,18 @@ class manage_qbank_plugins_page extends \admin_setting {
|
||||||
$table->data[] = $row;
|
$table->data[] = $row;
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort table data.
|
||||||
|
usort($table->data, function($a, $b) {
|
||||||
|
$aid = $a->cells[0]->text;
|
||||||
|
$bid = $b->cells[0]->text;
|
||||||
|
|
||||||
|
if ($aid == $bid) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return $aid < $bid ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
$return .= \html_writer::table($table);
|
$return .= \html_writer::table($table);
|
||||||
return highlight($query, $return);
|
return highlight($query, $return);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue