1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of the Zoom plugin 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 |
* Defines backup_activity_structure_step class.
|
|
|
19 |
*
|
|
|
20 |
* @package mod_zoom
|
|
|
21 |
* @category backup
|
|
|
22 |
* @copyright 2015 UC Regents
|
|
|
23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
24 |
*/
|
|
|
25 |
|
|
|
26 |
namespace mod_zoom;
|
|
|
27 |
|
|
|
28 |
use backup;
|
|
|
29 |
use backup_nested_element;
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
* Define the complete zoom structure for backup, with file and id annotations.
|
|
|
33 |
*/
|
|
|
34 |
class backup_activity_structure_step extends \backup_activity_structure_step {
|
|
|
35 |
/**
|
|
|
36 |
* Defines the backup structure of the module.
|
|
|
37 |
*
|
|
|
38 |
* @return backup_nested_element
|
|
|
39 |
*/
|
|
|
40 |
protected function define_structure() {
|
|
|
41 |
// Define the root element describing the zoom instance.
|
|
|
42 |
$zoom = new backup_nested_element('zoom', ['id'], [
|
|
|
43 |
'intro', 'introformat', 'grade', 'grading_method', 'meeting_id', 'join_url', 'created_at', 'host_id', 'name',
|
|
|
44 |
'start_time', 'timemodified', 'recurring', 'recurrence_type', 'repeat_interval', 'weekly_days', 'monthly_day',
|
|
|
45 |
'monthly_week', 'monthly_week_day', 'monthly_repeat_option', 'end_times', 'end_date_time', 'end_date_option',
|
|
|
46 |
'webinar', 'duration', 'timezone', 'password', 'option_jbh', 'option_start_type', 'option_host_video',
|
|
|
47 |
'option_participants_video', 'option_audio', 'option_mute_upon_entry', 'option_waiting_room',
|
|
|
48 |
'option_authenticated_users', 'option_encryption_type', 'exists_on_zoom', 'alternative_hosts',
|
|
|
49 |
'recordings_visible_default', 'show_schedule', 'show_security', 'show_media', 'option_auto_recording',
|
|
|
50 |
'registration',
|
|
|
51 |
]);
|
|
|
52 |
|
|
|
53 |
$trackingfields = new backup_nested_element('trackingfields');
|
|
|
54 |
|
|
|
55 |
$trackingfield = new backup_nested_element('trackingfield', ['id'], ['meeting_id', 'tracking_field', 'value']);
|
|
|
56 |
|
|
|
57 |
// If we had more elements, we would build the tree here.
|
|
|
58 |
$zoom->add_child($trackingfields);
|
|
|
59 |
$trackingfields->add_child($trackingfield);
|
|
|
60 |
|
|
|
61 |
// Define data sources.
|
|
|
62 |
$zoom->set_source_table('zoom', ['id' => backup::VAR_ACTIVITYID]);
|
|
|
63 |
$trackingfield->set_source_table('zoom_meeting_tracking_fields', ['meeting_id' => backup::VAR_ACTIVITYID]);
|
|
|
64 |
|
|
|
65 |
// If we were referring to other tables, we would annotate the relation
|
|
|
66 |
// with the element's annotate_ids() method.
|
|
|
67 |
|
|
|
68 |
// Define file annotations.
|
|
|
69 |
// Intro does not need itemid.
|
|
|
70 |
$zoom->annotate_files('mod_zoom', 'intro', null);
|
|
|
71 |
|
|
|
72 |
// Return the root element (zoom), wrapped into standard activity structure.
|
|
|
73 |
return $this->prepare_activity_structure($zoom);
|
|
|
74 |
}
|
|
|
75 |
}
|