Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   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   * Log live report ajax renderer.
  18   *
  19   * @package    report_loglive
  20   * @copyright  2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
  21   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  22   */
  23  
  24  /**
  25   * Log live report ajax renderer.
  26   *
  27   * @since      Moodle 2.7
  28   * @package    report_loglive
  29   * @copyright  2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
  30   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  31   */
  32  class report_loglive_renderer_ajax extends plugin_renderer_base {
  33  
  34      /**
  35       * This method should never be manually called, it should only be called by process.
  36       * Please call the render method instead.
  37       *
  38       * @deprecated since 2.8, to be removed in 2.9
  39       * @param report_loglive_renderable $reportloglive
  40       * @return string
  41       */
  42      public function render_report_loglive_renderable(report_loglive_renderable $reportloglive) {
  43          debugging('Do not call this method. Please call $renderer->render($reportloglive) instead.', DEBUG_DEVELOPER);
  44          return $this->render($reportloglive);
  45      }
  46  
  47      /**
  48       * Render logs for ajax.
  49       *
  50       * @param report_loglive_renderable $reportloglive object of report_loglive_renderable.
  51       *
  52       * @return string html to be displayed to user.
  53       */
  54      protected function render_report_loglive(report_loglive_renderable $reportloglive) {
  55          if (empty($reportloglive->selectedlogreader)) {
  56              return null;
  57          }
  58          $table = $reportloglive->get_table(true);
  59          return $table->out($reportloglive->perpage, false);
  60      }
  61  }