1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of eduplayer module for 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 |
* @package mod
|
|
|
19 |
* @subpackage eduplayer
|
|
|
20 |
* @author Humanage Srl <info@humanage.it>
|
|
|
21 |
* @copyright 2013 Humanage Srl <info@humanage.it>
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
defined('MOODLE_INTERNAL') || die();
|
|
|
26 |
|
|
|
27 |
/**
|
|
|
28 |
* Define the complete eduplayer structure for backup, with file and id annotations
|
|
|
29 |
*/
|
|
|
30 |
class backup_eduplayer_activity_structure_step extends backup_activity_structure_step {
|
|
|
31 |
|
|
|
32 |
protected function define_structure() {
|
|
|
33 |
|
|
|
34 |
// To know if we are including userinfo
|
|
|
35 |
// eduplayer user data is in the xmldata field in DB - anyway lets skip that
|
|
|
36 |
|
|
|
37 |
// Define each element separated
|
|
|
38 |
$eduplayer = new backup_nested_element('eduplayer', array('id'), array(
|
|
|
39 |
'name', 'intro', 'introformat', 'timecreated', 'timemodified',
|
|
|
40 |
'urltype', 'eduplayerfile', 'type', 'streamer', 'playlistposition',
|
|
|
41 |
'playlistsize', 'autostart', 'stretching', 'mute', 'controls',
|
|
|
42 |
'eduplayerrepeat', 'title', 'width', 'height', 'image', 'notes',
|
|
|
43 |
'notesformat', 'captionsback', 'captionsfile', 'captionsfontsize',
|
|
|
44 |
'captionsstate'));
|
|
|
45 |
|
|
|
46 |
// Build the tree
|
|
|
47 |
|
|
|
48 |
// Define sources
|
|
|
49 |
$eduplayer->set_source_table('eduplayer', array('id' => backup::VAR_ACTIVITYID));
|
|
|
50 |
|
|
|
51 |
// Define id annotations
|
|
|
52 |
|
|
|
53 |
// Define file annotations
|
|
|
54 |
$eduplayer->annotate_files('mod_eduplayer', 'intro', null);
|
|
|
55 |
$eduplayer->annotate_files('mod_eduplayer', 'notes', null);
|
|
|
56 |
$eduplayer->annotate_files('mod_eduplayer', 'file', null);
|
|
|
57 |
$eduplayer->annotate_files('mod_eduplayer', 'captionsfile', null);
|
|
|
58 |
$eduplayer->annotate_files('mod_eduplayer', 'image', null);
|
|
|
59 |
|
|
|
60 |
// Return the root element (eduplayer), wrapped into standard activity structure
|
|
|
61 |
return $this->prepare_activity_structure($eduplayer);
|
|
|
62 |
}
|
|
|
63 |
}
|