2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * Performance overview report
20 * @package report_performance
21 * @copyright 2013 Rajesh Taneja
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 define('NO_OUTPUT_BUFFERING', true);
27 require('../../config.php');
28 require_once($CFG->dirroot
.'/report/performance/locallib.php');
29 require_once($CFG->libdir
.'/adminlib.php');
33 // Show detailed info about one issue only.
34 $issue = optional_param('issue', '', PARAM_ALPHANUMEXT
);
36 $reportperformance = new report_performance();
37 $issues = $reportperformance->get_issue_list();
39 // Test if issue valid string.
40 if (array_search($issue, $issues, true) === false) {
45 admin_externalpage_setup('reportperformance', '', null, '', array('pagelayout'=>'report'));
46 echo $OUTPUT->header();
48 echo $OUTPUT->heading(get_string('pluginname', 'report_performance'));
50 $strissue = get_string('issue', 'report_performance');
51 $strvalue = get_string('value', 'report_performance');
52 $strcomments = get_string('comments', 'report_performance');
53 $stredit = get_string('edit');
55 $table = new html_table();
56 $table->head
= array($strissue, $strvalue, $strcomments, $stredit);
57 $table->colclasses
= array('mdl-left issue', 'mdl-left value', 'mdl-left comments', 'mdl-left config');
58 $table->attributes
= array('class' => 'admintable performancereport generaltable');
59 $table->id
= 'performanceissuereporttable';
60 $table->data
= array();
62 // Print details of one issue only.
63 if ($issue and ($issueresult = $reportperformance::$issue())) {
64 $reportperformance->add_issue_to_table($table, $issueresult, true);
66 $PAGE->set_docs_path('report/security/' . $issue);
68 echo html_writer
::table($table);
70 echo $OUTPUT->box($issueresult->details
, 'generalbox boxwidthnormal boxaligncenter');
72 echo $OUTPUT->continue_button(new moodle_url('/report/performance/index.php'));
74 // Add Performance report description on main list page.
75 $morehelplink = $OUTPUT->doc_link('report/performance', get_string('morehelp', 'report_performance'));
76 echo $OUTPUT->box(get_string('performancereportdesc', 'report_performance', $morehelplink), 'generalbox mdl-align');
78 foreach ($issues as $issue) {
79 $issueresult = $reportperformance::$issue();
84 $reportperformance->add_issue_to_table($table, $issueresult, false);
86 echo html_writer
::table($table);
89 echo $OUTPUT->footer();