Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
 * Defines the renderer for the hvp (H5P) module.
19
 *
20
 * @package     mod_hvp
21
 * @copyright   2016 Joubel AS <contact@joubel.com>
22
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
24
 
25
defined('MOODLE_INTERNAL') || die();
26
 
27
/**
28
 * The renderer for the hvp module.
29
 *
30
 * @copyright   2016 Joubel AS <contact@joubel.com>
31
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 *
33
 * @SuppressWarnings(PHPMD)
34
 */
35
class mod_hvp_renderer extends plugin_renderer_base {
36
 
37
    /**
38
     * Alter which stylesheets are loaded for H5P. This is useful for adding
39
     * your own custom styles or replacing existing ones.
40
     *
41
     * @param object $scripts List of stylesheets that will be loaded
42
     * @param array $libraries Array of libraries indexed by the library's machineName
43
     * @param string $embedtype Possible values: div, iframe, external, editor
44
     */
45
    public function hvp_alter_styles(&$scripts, $libraries, $embedtype) {
46
    }
47
 
48
    /**
49
     * Alter which scripts are loaded for H5P. Useful for adding your
50
     * own custom scripts or replacing existing ones.
51
     *
52
     * @param object $scripts List of JavaScripts that will be loaded
53
     * @param array $libraries Array of libraries indexed by the library's machineName
54
     * @param string $embedtype Possible values: div, iframe, external, editor
55
     */
56
    public function hvp_alter_scripts(&$scripts, $libraries, $embedtype) {
57
    }
58
 
59
    /**
60
     * Alter semantics before they are processed. This is useful for changing
61
     * how the editor looks and how content parameters are filtered.
62
     *
63
     * @param object $semantics Semantics as object
64
     * @param string $name Machine name of library
65
     * @param int $majorversion Major version of library
66
     * @param int $minorversion Minor version of library
67
     */
68
    public function hvp_alter_semantics(&$semantics, $name, $majorversion, $minorversion) {
69
    }
70
 
71
    /**
72
     * Alter parameters of H5P content after it has been filtered through
73
     * semantics. This is useful for adapting the content to the current context.
74
     *
75
     * @param object $parameters The content parameters for the library
76
     * @param string $name The machine readable name of the library
77
     * @param int $majorversion Major version of the library
78
     * @param int $minorversion Minor version of the library
79
     */
80
    public function hvp_alter_filtered_parameters(&$parameters, $name, $majorversion, $minorversion) {
81
    }
82
}