3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
19 * Defines classes used to handle restore settings
21 * @package core_backup
24 * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
25 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28 defined('MOODLE_INTERNAL') ||
die();
30 // TODO: Reduce these to the minimum because ui/dependencies are 100% separated
32 // Root restore settings
35 * root generic setting to store different things without dependencies
37 class restore_generic_setting
extends root_backup_setting
{}
40 * root setting to control if restore will create user information
41 * A lot of other settings are dependent of this (module's user info,
42 * grades user info, messages, blogs...
44 class restore_users_setting
extends restore_generic_setting
{}
47 * root setting to control if restore will create role assignments
48 * or no (any level), depends of @restore_users_setting
50 class restore_role_assignments_setting
extends root_backup_setting
{}
53 * root setting to control if restore will create activities
54 * A lot of other settings (_included at activity levels)
55 * are dependent of this setting
57 class restore_activities_setting
extends restore_generic_setting
{}
60 * root setting to control if restore will create
61 * comments or no, depends of @restore_users_setting
62 * exactly in the same way than @restore_role_assignments_setting so we extend from it
64 class restore_comments_setting
extends restore_role_assignments_setting
{}
67 * root setting to control if restore will create badges or not,
68 * depends on @restore_activities_setting
70 class restore_badges_setting
extends restore_generic_setting
{}
73 * root setting to control if restore will create
74 * events or no, depends of @restore_users_setting
75 * exactly in the same way than @restore_role_assignments_setting so we extend from it
77 class restore_calendarevents_setting
extends restore_role_assignments_setting
{}
80 * root setting to control if restore will create
81 * completion info or no, depends of @restore_users_setting
82 * exactly in the same way than @restore_role_assignments_setting so we extend from it
84 class restore_userscompletion_setting
extends restore_role_assignments_setting
{}
87 * root setting to control if restore will create
88 * logs or no, depends of @restore_users_setting
89 * exactly in the same way than @restore_role_assignments_setting so we extend from it
91 class restore_logs_setting
extends restore_role_assignments_setting
{}
94 * root setting to control if restore will create
95 * grade_histories or no, depends of @restore_users_setting
96 * exactly in the same way than @restore_role_assignments_setting so we extend from it
98 class restore_grade_histories_setting
extends restore_role_assignments_setting
{}
101 // Course restore settings
104 * generic course setting to pass various settings between tasks and steps
106 class restore_course_generic_setting
extends course_backup_setting
{}
109 * Setting to define is we are going to overwrite course configuration
111 class restore_course_overwrite_conf_setting
extends restore_course_generic_setting
{}
114 class restore_course_generic_text_setting
extends restore_course_generic_setting
{
116 public function __construct($name, $vtype, $value = null, $visibility = self
::VISIBLE
, $status = self
::NOT_LOCKED
) {
117 parent
::__construct($name, $vtype, $value, $visibility, $status);
118 $this->set_ui(new backup_setting_ui_text($this, $name));
123 // Section restore settings
126 * generic section setting to pass various settings between tasks and steps
128 class restore_section_generic_setting
extends section_backup_setting
{}
131 * Setting to define if one section is included or no. Activities _included
132 * settings depend of them if available
134 class restore_section_included_setting
extends restore_section_generic_setting
{}
137 * section backup setting to control if section will include
138 * user information or no, depends of @restore_users_setting
140 class restore_section_userinfo_setting
extends restore_section_generic_setting
{}
143 // Activity backup settings
146 * generic activity setting to pass various settings between tasks and steps
148 class restore_activity_generic_setting
extends activity_backup_setting
{}
151 * activity backup setting to control if activity will
152 * be included or no, depends of @restore_activities_setting and
153 * optionally parent section included setting
155 class restore_activity_included_setting
extends restore_activity_generic_setting
{}
158 * activity backup setting to control if activity will include
159 * user information or no, depends of @restore_users_setting
161 class restore_activity_userinfo_setting
extends restore_activity_generic_setting
{}