1 |
efrain |
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 |
* Contains class mod_h5pactivity\output\reportlink
|
|
|
19 |
*
|
|
|
20 |
* @package mod_h5pactivity
|
|
|
21 |
* @copyright 2020 Ferran Recio
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
namespace mod_h5pactivity\output;
|
|
|
26 |
|
|
|
27 |
defined('MOODLE_INTERNAL') || die();
|
|
|
28 |
|
|
|
29 |
use renderable;
|
|
|
30 |
use templatable;
|
|
|
31 |
use renderer_base;
|
|
|
32 |
use moodle_url;
|
|
|
33 |
|
|
|
34 |
/**
|
|
|
35 |
* Class to help display report link in mod_h5pactivity.
|
|
|
36 |
*
|
|
|
37 |
* @copyright 2020 Ferran Recio
|
|
|
38 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
39 |
*/
|
|
|
40 |
class reportlink implements renderable, templatable {
|
|
|
41 |
|
|
|
42 |
/** @var H5P factory */
|
|
|
43 |
public $url;
|
|
|
44 |
|
|
|
45 |
/** @var H5P library list */
|
|
|
46 |
public $message;
|
|
|
47 |
|
|
|
48 |
/**
|
|
|
49 |
* Constructor.
|
|
|
50 |
*
|
|
|
51 |
* @param moodle_url $url the destination url
|
|
|
52 |
* @param string $message the link message
|
|
|
53 |
*/
|
|
|
54 |
public function __construct(moodle_url $url, string $message) {
|
|
|
55 |
$this->url = $url;
|
|
|
56 |
$this->message = $message;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
* Export this data so it can be used as the context for a mustache template.
|
|
|
61 |
*
|
|
|
62 |
* @param renderer_base $output
|
|
|
63 |
* @return stdClass
|
|
|
64 |
*/
|
|
|
65 |
public function export_for_template(renderer_base $output) {
|
|
|
66 |
return $this;
|
|
|
67 |
}
|
|
|
68 |
}
|