mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Whoops - ranges for categories on each page were incorrect. Plus added
sesskey to page numbers.
This commit is contained in:
parent
4a987dfa67
commit
cb06a092dc
1 changed files with 5 additions and 4 deletions
|
@ -127,6 +127,7 @@ class quiz_category_object {
|
|||
* display list of page numbers for navigation
|
||||
*/
|
||||
function display_page_numbers( $page=0 ) {
|
||||
global $USER;
|
||||
|
||||
echo "<div class=\"paging\">{$this->str->page}:\n";
|
||||
foreach (range(1,$this->pagecount) as $currentpage) {
|
||||
|
@ -134,7 +135,7 @@ class quiz_category_object {
|
|||
echo " $currentpage \n";
|
||||
}
|
||||
else {
|
||||
echo "<a href=\"category.php?id={$this->course->id}&page=$currentpage\">";
|
||||
echo "<a href=\"category.php?id={$this->course->id}&page=$currentpage&sesskey={$USER->sesskey}\">";
|
||||
echo " $currentpage </a>\n";
|
||||
}
|
||||
}
|
||||
|
@ -210,14 +211,14 @@ class quiz_category_object {
|
|||
|
||||
// if pagination required work out range
|
||||
if (!empty($page)) {
|
||||
$firstcat = $page * PAGE_LENGTH;
|
||||
$lastcat = $firstcat+ PAGE_LENGTH - 1;
|
||||
$firstcat = ($page-1) * PAGE_LENGTH + 1;
|
||||
$lastcat = $firstcat + PAGE_LENGTH - 1;
|
||||
}
|
||||
else {
|
||||
$firstcat = 1;
|
||||
$lastcat = $this->topcount;
|
||||
}
|
||||
|
||||
//echo "$firstcat $lastcat $page"; die;
|
||||
$this->build_edit_table_body($this->categories, $page, $firstcat, $lastcat);
|
||||
print_table($this->edittable);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue