Select Git revision
defaults.yaml
renderer.php 4.70 KiB
<?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/>.
/**
* @package mod_pdfannotator
* @copyright 2018 RWTH Aachen (see README.md)
* @author Rabea de Groot and Anna Heynkes
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
*/
defined('MOODLE_INTERNAL') || die();
class mod_pdfannotator_renderer extends plugin_renderer_base {
/**
*
* @param type $index
* @return type
*/
public function render_index($index) {
return $this->render_from_template('pdfannotator/index', $index->export_for_template($this));
}
/**
*
* @param \templatable $statistic
* @return type
*/
public function render_statistic(\templatable $statistic) {
$data = $statistic->export_for_template($this);
return $this->render_from_template('mod_pdfannotator/statistic', $data);
}
/**
* renders dropdown-actionmenu. Currently used on overview in the categories "answers" and "reports".
* @param \templatable $dropdownmenu
* @return type
*/
public function render_dropdownmenu(\templatable $dropdownmenu) {
$data = $dropdownmenu->export_for_template($this);
return $this->render_from_template('mod_pdfannotator/dropdownmenu', $data);
}
/**
* Render a table containing information about a comment the user wants to report
*
* @param pdfannotator_comment_info $info a renderable
* @return string
*/
public function render_pdfannotator_comment_info(pdfannotator_comment_info $info) {
$o = '';
$o .= $this->output->container_start('appointmentinfotable');
$o .= $this->output->box_start('boxaligncenter appointmentinfotable');
$t = new html_table();
$row = new html_table_row();
$cell1 = new html_table_cell(get_string('slotdatetimelabel', 'pdfannotator'));