}
$controls .= html_writer::tag('span', "Page {$takedata->pageparams->page} of $numberofpages", array('class' => 'attbtn'));
if ($takedata->pageparams->page < $numberofpages) {
- $controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page + 1)), $this->output->rarrow());
+ $controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page + 1,
+ 'perpage' => $takedata->pageparams->perpage)), $this->output->rarrow());
}
}
$select->class = 'singleselect inline';
$controls .= $this->output->render($select);
+ if ($takedata->pageparams->viewmode == att_take_page_params::SORTED_LIST) {
+ $options = array(
+ 0 => get_string('donotusepaging', 'attendance'),
+ get_config('attendance', 'resultsperpage') => get_config('attendance', 'resultsperpage'));
+ $select = new single_select($takedata->url(), 'perpage', $options, $takedata->pageparams->perpage, null);
+ $select->class = 'singleselect inline';
+ $controls .= $this->output->render($select);
+ }
+
if ($takedata->pageparams->viewmode == att_take_page_params::SORTED_GRID) {
$options = array (1 => '1 '.get_string('column', 'attendance'), '2 '.get_string('columns', 'attendance'),
'3 '.get_string('columns', 'attendance'), '4 '.get_string('columns', 'attendance'),
$pageparams->viewmode = optional_param('viewmode', null, PARAM_INT);
$pageparams->gridcols = optional_param('gridcols', null, PARAM_INT);
$pageparams->page = optional_param('page', 1, PARAM_INT);
-$pageparams->perpage = get_config('attendance', 'resultsperpage');
+$pageparams->perpage = optional_param('perpage', get_config('attendance', 'resultsperpage'), PARAM_INT);
$cm = get_coursemodule_from_id('attendance', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);