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
 * References files that should be automatically loaded
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
defined('MOODLE_INTERNAL') || die();
25
 
26
/**
27
 * A simple autoloader which makes it easy to load classes when you need them.
28
 *
29
 * @param string $class name
30
 */
31
function hvp_autoloader($class) {
32
    global $CFG;
33
    static $classmap;
34
    if (!isset($classmap)) {
35
        $classmap = array(
36
        // Core.
37
        'H5PCore' => 'library/h5p.classes.php',
38
        'H5PFrameworkInterface' => 'library/h5p.classes.php',
39
        'H5PContentValidator' => 'library/h5p.classes.php',
40
        'H5PValidator' => 'library/h5p.classes.php',
41
        'H5PStorage' => 'library/h5p.classes.php',
42
        'H5PExport' => 'library/h5p.classes.php',
43
        'H5PDevelopment' => 'library/h5p-development.class.php',
44
        'H5PFileStorage' => 'library/h5p-file-storage.interface.php',
45
        'H5PDefaultStorage' => 'library/h5p-default-storage.class.php',
46
        'H5PEventBase' => 'library/h5p-event-base.class.php',
47
        'H5PMetadata' => 'library/h5p-metadata.class.php',
48
 
49
        // Editor.
50
        'H5peditor' => 'editor/h5peditor.class.php',
51
        'H5PEditorAjax' => 'editor/h5peditor-ajax.class.php',
52
        'H5PEditorAjaxInterface' => 'editor/h5peditor-ajax.interface.php',
53
        'H5peditorFile' => 'editor/h5peditor-file.class.php',
54
        'H5peditorStorage' => 'editor/h5peditor-storage.interface.php',
55
 
56
        // Reporting.
57
        'H5PReport' => 'reporting/h5p-report.class.php',
58
        'H5PReportXAPIData' => 'reporting/h5p-report-xapi-data.class.php',
59
        'ChoiceProcessor' => 'reporting/type-processors/choice-processor.class.php',
60
        'CompoundProcessor' => 'reporting/type-processors/compound-processor.class.php',
61
        'FillInProcessor' => 'reporting/type-processors/fill-in-processor.class.php',
62
        'LongChoiceProcessor' => 'reporting/type-processors/long-choice-processor.class.php',
63
        'MatchingProcessor' => 'reporting/type-processors/matching-processor.class.php',
64
        'TrueFalseProcessor' => 'reporting/type-processors/true-false-processor.class.php',
65
        'IVOpenEndedQuestionProcessor' => 'reporting/type-processors/iv-open-ended-question-processor.class.php',
66
        'TypeProcessor' => 'reporting/type-processors/type-processor.class.php',
67
        'DocumentationToolProcessor' => 'reporting/type-processors/compound/documentation-tool-processor.class.php',
68
        'GoalsPageProcessor' => 'reporting/type-processors/compound/goals-page-processor.class.php',
69
        'GoalsAssessmentPageProcessor' => 'reporting/type-processors/compound/goals-assessment-page-processor.class.php',
70
        'StandardPageProcessor' => 'reporting/type-processors/compound/standard-page-processor.class.php',
71
 
72
        // Plugin specific classes are loaded by Moodle.
73
        );
74
    }
75
 
76
    if (isset($classmap[$class])) {
77
        require_once($CFG->dirroot . '/mod/hvp/' . $classmap[$class]);
78
    }
79
}
80
spl_autoload_register('hvp_autoloader');