Browse Source

Merge pull request #55 from drjosephbaxter/master

CONTRIB-5286 added drop down to show all rows or the set limit
MOODLE_27_STABLE
Dan Marsden 10 years ago
parent
commit
b280438e3c
  1. 12
      renderer.php
  2. 2
      take.php

12
renderer.php

@ -404,7 +404,8 @@ class mod_attendance_renderer extends plugin_renderer_base {
} }
$controls .= html_writer::tag('span', "Page {$takedata->pageparams->page} of $numberofpages", array('class' => 'attbtn')); $controls .= html_writer::tag('span', "Page {$takedata->pageparams->page} of $numberofpages", array('class' => 'attbtn'));
if ($takedata->pageparams->page < $numberofpages) { 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());
} }
} }
@ -424,6 +425,15 @@ class mod_attendance_renderer extends plugin_renderer_base {
$select->class = 'singleselect inline'; $select->class = 'singleselect inline';
$controls .= $this->output->render($select); $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) { if ($takedata->pageparams->viewmode == att_take_page_params::SORTED_GRID) {
$options = array (1 => '1 '.get_string('column', 'attendance'), '2 '.get_string('columns', 'attendance'), $options = array (1 => '1 '.get_string('column', 'attendance'), '2 '.get_string('columns', 'attendance'),
'3 '.get_string('columns', 'attendance'), '4 '.get_string('columns', 'attendance'), '3 '.get_string('columns', 'attendance'), '4 '.get_string('columns', 'attendance'),

2
take.php

@ -35,7 +35,7 @@ $pageparams->copyfrom = optional_param('copyfrom', null, PARAM_INT);
$pageparams->viewmode = optional_param('viewmode', null, PARAM_INT); $pageparams->viewmode = optional_param('viewmode', null, PARAM_INT);
$pageparams->gridcols = optional_param('gridcols', null, PARAM_INT); $pageparams->gridcols = optional_param('gridcols', null, PARAM_INT);
$pageparams->page = optional_param('page', 1, 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); $cm = get_coursemodule_from_id('attendance', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);

Loading…
Cancel
Save