MDL-75401 mod_data: add sticky footers
This commit is contained in:
+15
-37
@@ -217,8 +217,8 @@ if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
|
||||
$urlediting = 'on';
|
||||
$strediting = get_string('blocksediton');
|
||||
}
|
||||
$url = new moodle_url($CFG->wwwroot.'/mod/data/view.php', array('id' => $cm->id, 'edit' => $urlediting));
|
||||
$PAGE->set_button($OUTPUT->single_button($url, $strediting));
|
||||
$editurl = new moodle_url($CFG->wwwroot.'/mod/data/view.php', ['id' => $cm->id, 'edit' => $urlediting]);
|
||||
$PAGE->set_button($OUTPUT->single_button($editurl, $strediting));
|
||||
}
|
||||
|
||||
if ($mode == 'asearch') {
|
||||
@@ -426,8 +426,8 @@ if ($showactivity) {
|
||||
|
||||
} else {
|
||||
// We have some records to print.
|
||||
$url = new moodle_url('/mod/data/view.php', array('d' => $data->id, 'sesskey' => sesskey()));
|
||||
echo html_writer::start_tag('form', array('action' => $url, 'method' => 'post'));
|
||||
$formurl = new moodle_url('/mod/data/view.php', ['d' => $data->id, 'sesskey' => sesskey()]);
|
||||
echo html_writer::start_tag('form', ['action' => $formurl, 'method' => 'post']);
|
||||
|
||||
if ($maxcount != $totalcount) {
|
||||
$a = new stdClass();
|
||||
@@ -447,7 +447,6 @@ if ($showactivity) {
|
||||
$baseurlparams['page'] = $page;
|
||||
}
|
||||
$baseurl = new moodle_url($baseurl, $baseurlparams);
|
||||
echo $OUTPUT->paging_bar($totalcount, $page, $nowperpage, $baseurl);
|
||||
|
||||
require_once($CFG->dirroot.'/rating/lib.php');
|
||||
if ($data->assessed != RATING_AGGREGATE_NONE) {
|
||||
@@ -474,10 +473,8 @@ if ($showactivity) {
|
||||
];
|
||||
$parser = $manager->get_template('singletemplate', $options);
|
||||
echo $parser->parse_entries($records);
|
||||
|
||||
echo $OUTPUT->paging_bar($totalcount, $page, $nowperpage, $baseurl);
|
||||
|
||||
} else { // List template
|
||||
} else {
|
||||
// List template.
|
||||
$baseurl = '/mod/data/view.php';
|
||||
$baseurlparams = ['d' => $data->id, 'advanced' => $advanced, 'paging' => $paging];
|
||||
if (!empty($search)) {
|
||||
@@ -485,8 +482,6 @@ if ($showactivity) {
|
||||
}
|
||||
$baseurl = new moodle_url($baseurl, $baseurlparams);
|
||||
|
||||
echo $OUTPUT->paging_bar($totalcount, $page, $nowperpage, $baseurl);
|
||||
|
||||
echo $data->listtemplateheader;
|
||||
$options = [
|
||||
'search' => $search,
|
||||
@@ -497,34 +492,17 @@ if ($showactivity) {
|
||||
echo $parser->parse_entries($records);
|
||||
|
||||
echo $data->listtemplatefooter;
|
||||
|
||||
echo $OUTPUT->paging_bar($totalcount, $page, $nowperpage, $baseurl->out());
|
||||
}
|
||||
|
||||
if ($mode != 'single' && $canmanageentries) {
|
||||
// Build the select/deselect all control.
|
||||
$selectallid = 'selectall-listview-entries';
|
||||
$togglegroup = 'listview-entries';
|
||||
$mastercheckbox = new \core\output\checkbox_toggleall($togglegroup, true, [
|
||||
'id' => $selectallid,
|
||||
'name' => $selectallid,
|
||||
'value' => 1,
|
||||
'label' => get_string('selectall'),
|
||||
'classes' => 'btn-secondary mr-1',
|
||||
], true);
|
||||
echo $OUTPUT->render($mastercheckbox);
|
||||
|
||||
$deleteselected = html_writer::empty_tag('input', array(
|
||||
'class' => 'btn btn-secondary',
|
||||
'type' => 'submit',
|
||||
'value' => get_string('deleteselected'),
|
||||
'disabled' => true,
|
||||
'data-action' => 'toggle',
|
||||
'data-togglegroup' => $togglegroup,
|
||||
'data-toggle' => 'action',
|
||||
));
|
||||
echo $deleteselected;
|
||||
}
|
||||
$stickyfooter = new mod_data\output\view_footer(
|
||||
$manager,
|
||||
$totalcount,
|
||||
$page,
|
||||
$nowperpage,
|
||||
$baseurl,
|
||||
$parser
|
||||
);
|
||||
echo $OUTPUT->render($stickyfooter);
|
||||
|
||||
echo html_writer::end_tag('form');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user