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 |
* unilabel module.
|
|
|
19 |
*
|
|
|
20 |
* @package mod_unilabel
|
|
|
21 |
* @author Andreas Grabs <info@grabs-edv.de>
|
|
|
22 |
* @copyright 2018 onwards Grabs EDV {@link https://www.grabs-edv.de}
|
|
|
23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
24 |
*/
|
|
|
25 |
|
|
|
26 |
/**
|
|
|
27 |
* Define all the backup steps that will be used by the backup_unilabel_activity_task.
|
|
|
28 |
* @package mod_unilabel
|
|
|
29 |
* @author Andreas Grabs <info@grabs-edv.de>
|
|
|
30 |
* @copyright 2018 onwards Grabs EDV {@link https://www.grabs-edv.de}
|
|
|
31 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
32 |
*/
|
|
|
33 |
class backup_unilabel_activity_structure_step extends backup_activity_structure_step {
|
|
|
34 |
/**
|
|
|
35 |
* Define the complete unilabel structure for backup, with file and id annotations.
|
|
|
36 |
*
|
|
|
37 |
* @return void
|
|
|
38 |
*/
|
|
|
39 |
protected function define_structure() {
|
|
|
40 |
// Define each element separated.
|
|
|
41 |
$unilabel = new backup_nested_element(
|
|
|
42 |
'unilabel',
|
|
|
43 |
['id'],
|
|
|
44 |
[
|
|
|
45 |
'name',
|
|
|
46 |
'intro',
|
|
|
47 |
'introformat',
|
|
|
48 |
'unilabeltype',
|
|
|
49 |
'timemodified',
|
|
|
50 |
]
|
|
|
51 |
);
|
|
|
52 |
|
|
|
53 |
$this->add_subplugin_structure('unilabeltype', $unilabel, true);
|
|
|
54 |
|
|
|
55 |
// Build the tree.
|
|
|
56 |
|
|
|
57 |
// Define sources.
|
|
|
58 |
$unilabel->set_source_table('unilabel', ['id' => backup::VAR_ACTIVITYID]);
|
|
|
59 |
|
|
|
60 |
// Define id annotations.
|
|
|
61 |
// Nothing to do here.
|
|
|
62 |
|
|
|
63 |
// Define file annotations.
|
|
|
64 |
$unilabel->annotate_files('mod_unilabel', 'intro', null); // This file area hasn't itemid.
|
|
|
65 |
|
|
|
66 |
// Return the root element (unilabel), wrapped into standard activity structure.
|
|
|
67 |
return $this->prepare_activity_structure($unilabel);
|
|
|
68 |
}
|
|
|
69 |
}
|