-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
63 lines (51 loc) · 2.03 KB
/
Copy pathindex.php
File metadata and controls
63 lines (51 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
require_once('../../config.php');
require_once($CFG->libdir . '/adminlib.php');
// Check permissions.
admin_externalpage_setup('local_screenreaderdetect_report');
$page = optional_param('page', 0, PARAM_INT);
$perpage = 30;
$PAGE->set_url(new moodle_url('/local/screenreaderdetect/index.php'));
$PAGE->set_title(get_string('pluginname', 'local_screenreaderdetect'));
$PAGE->set_heading(get_string('screenreaderreport', 'local_screenreaderdetect'));
echo $OUTPUT->header();
// Get detection records.
$detections = \local_screenreaderdetect\manager::get_all_detections($perpage, $page * $perpage);
// Build the table.
$table = new html_table();
$table->head = array(
get_string('user'),
get_string('detected', 'local_screenreaderdetect'),
get_string('date')
);
$table->data = array();
foreach ($detections as $detection) {
$userlink = html_writer::link(
new moodle_url('/user/profile.php', array('id' => $detection->userid)),
fullname($detection)
);
$table->data[] = array(
$userlink,
$detection->detected ? get_string('yes') : get_string('no'),
userdate($detection->timemodified)
);
}
echo html_writer::table($table);
// Add pagination if needed.
$totalrecords = $DB->count_records('local_screenreaderdetect');
echo $OUTPUT->paging_bar($totalrecords, $page, $perpage, $PAGE->url);
echo $OUTPUT->footer();