From 1f5a5595907991563d379fc7af77ac5977ee29f6 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 4 Jan 2010 18:09:58 +0000 Subject: [PATCH] Preparing for the future feature to let the user to set users per page --- mod/workshop/allocation/manual/lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/workshop/allocation/manual/lib.php b/mod/workshop/allocation/manual/lib.php index 1ce9811f042..99fc3292030 100644 --- a/mod/workshop/allocation/manual/lib.php +++ b/mod/workshop/allocation/manual/lib.php @@ -132,6 +132,7 @@ class workshop_manual_allocator implements workshop_allocator { global $PAGE, $OUTPUT, $DB; $pagingvar = 'page'; $page = optional_param($pagingvar, 0, PARAM_INT); + $perpage = 10; // todo let the user modify this $hlauthorid = -1; // highlight this author $hlreviewerid = -1; // highlight this reviewer @@ -203,7 +204,7 @@ class workshop_manual_allocator implements workshop_allocator { $participants = array_intersect_key($participants, array($hlauthorid => null, $hlreviewerid => null)); } else { // slice the list of participants according to the current page - $participants = array_slice($participants, $page * workshop::PERPAGE, workshop::PERPAGE, true); + $participants = array_slice($participants, $page * $perpage, $perpage, true); } // this will hold the information needed to display user names and pictures @@ -314,7 +315,7 @@ class workshop_manual_allocator implements workshop_allocator { $pagingbar = new moodle_paging_bar(); $pagingbar->totalcount = $numofparticipants; $pagingbar->page = $page; - $pagingbar->perpage = workshop::PERPAGE; + $pagingbar->perpage = $perpage; $pagingbar->baseurl = $PAGE->url; $pagingbar->pagevar = $pagingvar;