mirror of
https://github.com/moodle/moodle.git
synced 2025-07-10 00:46:32 +02:00
MDL-27508 workshop manual allocator supports configurable page size for items pagination
This commit is contained in:
@ -61,6 +61,13 @@ class workshop_manual_allocator implements workshop_allocator {
|
|||||||
global $PAGE;
|
global $PAGE;
|
||||||
|
|
||||||
$mode = optional_param('mode', 'display', PARAM_ALPHA);
|
$mode = optional_param('mode', 'display', PARAM_ALPHA);
|
||||||
|
$perpage = optional_param('perpage', null, PARAM_INT);
|
||||||
|
|
||||||
|
if ($perpage and $perpage > 0 and $perpage <= 1000) {
|
||||||
|
require_sesskey();
|
||||||
|
set_user_preference('workshopallocation_manual_perpage', $perpage);
|
||||||
|
redirect($PAGE->url);
|
||||||
|
}
|
||||||
|
|
||||||
$result = new workshop_allocation_result($this);
|
$result = new workshop_allocation_result($this);
|
||||||
|
|
||||||
@ -141,9 +148,8 @@ class workshop_manual_allocator implements workshop_allocator {
|
|||||||
|
|
||||||
$output = $PAGE->get_renderer('workshopallocation_manual');
|
$output = $PAGE->get_renderer('workshopallocation_manual');
|
||||||
|
|
||||||
$pagingvar = 'page';
|
$page = optional_param('page', 0, PARAM_INT);
|
||||||
$page = optional_param($pagingvar, 0, PARAM_INT);
|
$perpage = get_user_preferences('workshopallocation_manual_perpage', 10);
|
||||||
$perpage = 10; // todo let the user modify this
|
|
||||||
|
|
||||||
$hlauthorid = -1; // highlight this author
|
$hlauthorid = -1; // highlight this author
|
||||||
$hlreviewerid = -1; // highlight this reviewer
|
$hlreviewerid = -1; // highlight this reviewer
|
||||||
@ -324,10 +330,11 @@ class workshop_manual_allocator implements workshop_allocator {
|
|||||||
$data->selfassessment = $this->workshop->useselfassessment;
|
$data->selfassessment = $this->workshop->useselfassessment;
|
||||||
|
|
||||||
// prepare paging bar
|
// prepare paging bar
|
||||||
$pagingbar = new paging_bar($numofparticipants, $page, $perpage, $PAGE->url, $pagingvar);
|
$pagingbar = new paging_bar($numofparticipants, $page, $perpage, $PAGE->url, 'page');
|
||||||
$pagingbarout = $output->render($pagingbar);
|
$pagingbarout = $output->render($pagingbar);
|
||||||
|
$perpageselector = $output->perpage_selector($perpage);
|
||||||
|
|
||||||
return $pagingbarout . $output->render($message) . $output->render($data) . $button . $pagingbarout;
|
return $pagingbarout . $output->render($message) . $output->render($data) . $button . $pagingbarout . $perpageselector;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user