[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/report/performance/ -> index.php (source)

   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   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.
   8  //
   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.
  13  //
  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/>.
  16  
  17  /**
  18   * Performance overview report
  19   *
  20   * @package   report_performance
  21   * @copyright 2013 Rajesh Taneja
  22   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  
  25  define('NO_OUTPUT_BUFFERING', true);
  26  
  27  require('../../config.php');
  28  require_once($CFG->dirroot.'/report/performance/locallib.php');
  29  require_once($CFG->libdir.'/adminlib.php');
  30  
  31  require_login();
  32  
  33  // Show detailed info about one issue only.
  34  $issue = optional_param('issue', '', PARAM_ALPHANUMEXT);
  35  
  36  $reportperformance = new report_performance();
  37  $issues = $reportperformance->get_issue_list();
  38  
  39  // Test if issue valid string.
  40  if (array_search($issue, $issues, true) === false) {
  41      $issue = '';
  42  }
  43  
  44  // Print the header.
  45  admin_externalpage_setup('reportperformance', '', null, '', array('pagelayout'=>'report'));
  46  echo $OUTPUT->header();
  47  
  48  echo $OUTPUT->heading(get_string('pluginname', 'report_performance'));
  49  
  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');
  54  
  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();
  61  
  62  // Print details of one issue only.
  63  if ($issue and ($issueresult = $reportperformance::$issue())) {
  64      $reportperformance->add_issue_to_table($table, $issueresult, true);
  65  
  66      $PAGE->set_docs_path('report/security/' . $issue);
  67  
  68      echo html_writer::table($table);
  69  
  70      echo $OUTPUT->box($issueresult->details, 'generalbox boxwidthnormal boxaligncenter');
  71  
  72      echo $OUTPUT->continue_button(new moodle_url('/report/performance/index.php'));
  73  } else {
  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');
  77  
  78      foreach ($issues as $issue) {
  79          $issueresult = $reportperformance::$issue();
  80          if (!$issueresult) {
  81              // Ignore this test.
  82              continue;
  83          }
  84          $reportperformance->add_issue_to_table($table, $issueresult, false);
  85      }
  86      echo html_writer::table($table);
  87  }
  88  
  89  echo $OUTPUT->footer();


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1