Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is 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  namespace mod_bigbluebuttonbn\output;
  18  
  19  use mod_bigbluebuttonbn\instance;
  20  use renderable;
  21  use renderer_base;
  22  use stdClass;
  23  use templatable;
  24  
  25  /**
  26   * Renderer for recording section.
  27   *
  28   * @package   mod_bigbluebuttonbn
  29   * @copyright 2010 onwards, Blindside Networks Inc
  30   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  31   * @author    Laurent David  (laurent.david [at] call-learning [dt] fr)
  32   */
  33  class recordings_session implements renderable, templatable {
  34  
  35      /**
  36       * @var instance
  37       */
  38      protected $instance;
  39  
  40      /**
  41       * recording_section constructor.
  42       *
  43       * @param instance $instance
  44       */
  45      public function __construct(instance $instance) {
  46          $this->instance = $instance;
  47      }
  48  
  49      /**
  50       * Export for template
  51       *
  52       * @param renderer_base $output
  53       * @return stdClass
  54       */
  55      public function export_for_template(renderer_base $output): stdClass {
  56          $isrecordedtype = $this->instance->is_type_room_and_recordings() || $this->instance->is_type_recordings_only();
  57  
  58          $context = (object) [
  59              'bbbid' => $this->instance->get_instance_id(),
  60              'groupid' => $this->instance->get_group_id(),
  61              'has_recordings' => $this->instance->is_recorded() && $isrecordedtype,
  62              'searchbutton' => [
  63                  'value' => '',
  64              ],
  65          ];
  66  
  67          if ($this->instance->can_import_recordings()) {
  68              $button = new \single_button(
  69                  $this->instance->get_import_url(),
  70                  get_string('view_recording_button_import', 'mod_bigbluebuttonbn')
  71              );
  72              $context->import_button = $button->export_for_template($output);
  73          }
  74  
  75          return $context;
  76      }
  77  }