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 |
* Responsible for displaying the content upgrade page
|
|
|
18 |
*
|
|
|
19 |
* @package mod_hvp
|
|
|
20 |
* @copyright 2020 Joubel AS <contact@joubel.com>
|
|
|
21 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
22 |
*/
|
|
|
23 |
use mod_hvp\content_hub_service;
|
|
|
24 |
|
|
|
25 |
require_once("../../config.php");
|
|
|
26 |
require_once($CFG->libdir.'/adminlib.php');
|
|
|
27 |
require_once("locallib.php");
|
|
|
28 |
|
|
|
29 |
global $PAGE, $SITE, $OUTPUT, $CFG;
|
|
|
30 |
|
|
|
31 |
// No guest autologin.
|
|
|
32 |
require_login(0, false);
|
|
|
33 |
|
|
|
34 |
$context = \context_system::instance();
|
|
|
35 |
require_capability('mod/hvp:contenthubregistration', $context);
|
|
|
36 |
|
|
|
37 |
$pageurl = new moodle_url('/mod/hvp/content_hub_registration.php');
|
|
|
38 |
$PAGE->set_context(context_system::instance());
|
|
|
39 |
$PAGE->set_url($pageurl);
|
|
|
40 |
$PAGE->set_title("{$SITE->shortname}: " . get_string('upgrade', 'hvp'));
|
|
|
41 |
$PAGE->set_heading(get_string('contenthub:settings:heading', 'mod_hvp'));
|
|
|
42 |
|
|
|
43 |
$settings = content_hub_service::get_registration_ui_settings();
|
|
|
44 |
$PAGE->requires->data_for_js('H5PSettings', $settings, true);
|
|
|
45 |
$PAGE->requires->js(new moodle_url('library/js/h5p-hub-registration.js'), true);
|
|
|
46 |
$PAGE->requires->css(new moodle_url('library/styles/h5p.css'));
|
|
|
47 |
$PAGE->requires->css(new moodle_url('library/styles/h5p-hub-registration.css'));
|
|
|
48 |
|
|
|
49 |
echo $OUTPUT->header();
|
|
|
50 |
|
|
|
51 |
echo $OUTPUT->render_from_template('mod_hvp/content_hub_registration', []);
|
|
|
52 |
$PAGE->requires->js_call_amd('mod_hvp/contenthubregistration', 'init');
|
|
|
53 |
|
|
|
54 |
echo $OUTPUT->footer();
|