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 |
* This file defines settingpages and externalpages under the "courses" category
|
|
|
19 |
*
|
|
|
20 |
* @package core
|
|
|
21 |
* @copyright 2002 onwards Martin Dougiamas (http://dougiamas.com)
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
defined('MOODLE_INTERNAL') || die();
|
|
|
26 |
|
|
|
27 |
require_once($CFG->libdir . '/pdflib.php');
|
|
|
28 |
|
|
|
29 |
use core_admin\local\settings\filesize;
|
|
|
30 |
|
|
|
31 |
$capabilities = array(
|
|
|
32 |
'moodle/backup:backupcourse',
|
|
|
33 |
'moodle/category:manage',
|
|
|
34 |
'moodle/course:create',
|
|
|
35 |
'moodle/site:approvecourse',
|
|
|
36 |
'moodle/restore:restorecourse'
|
|
|
37 |
);
|
|
|
38 |
if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
|
|
39 |
// Speedup for non-admins, add all caps used on this page.
|
|
|
40 |
$ADMIN->add('courses',
|
|
|
41 |
new admin_externalpage('coursemgmt', new lang_string('coursemgmt', 'admin'),
|
|
|
42 |
$CFG->wwwroot . '/course/management.php',
|
|
|
43 |
array('moodle/category:manage', 'moodle/course:create')
|
|
|
44 |
)
|
|
|
45 |
);
|
|
|
46 |
$ADMIN->add('courses',
|
|
|
47 |
new admin_externalpage('addcategory', new lang_string('addcategory', 'admin'),
|
|
|
48 |
new moodle_url('/course/editcategory.php', array('parent' => 0)),
|
|
|
49 |
array('moodle/category:manage')
|
|
|
50 |
)
|
|
|
51 |
);
|
|
|
52 |
$ADMIN->add('courses',
|
|
|
53 |
new admin_externalpage('addnewcourse', new lang_string('addnewcourse'),
|
|
|
54 |
new moodle_url('/course/edit.php', array('category' => 0)),
|
|
|
55 |
array('moodle/category:manage')
|
|
|
56 |
)
|
|
|
57 |
);
|
|
|
58 |
$ADMIN->add('courses',
|
|
|
59 |
new admin_externalpage('restorecourse', new lang_string('restorecourse', 'admin'),
|
|
|
60 |
new moodle_url('/backup/restorefile.php', array('contextid' => context_system::instance()->id)),
|
|
|
61 |
array('moodle/restore:restorecourse')
|
|
|
62 |
)
|
|
|
63 |
);
|
|
|
64 |
|
|
|
65 |
// Download course content.
|
|
|
66 |
$downloadcoursedefaulturl = new moodle_url('/admin/settings.php', ['section' => 'coursesettings']);
|
|
|
67 |
$temp = new admin_settingpage('downloadcoursecontent', new lang_string('downloadcoursecontent', 'course'));
|
|
|
68 |
$temp->add(new admin_setting_configcheckbox('downloadcoursecontentallowed',
|
|
|
69 |
new lang_string('downloadcoursecontentallowed', 'admin'),
|
|
|
70 |
new lang_string('downloadcoursecontentallowed_desc', 'admin', $downloadcoursedefaulturl->out()), 0));
|
|
|
71 |
|
|
|
72 |
// 50MB default maximum size per file when downloading course content.
|
|
|
73 |
$defaultmaxdownloadsize = 50 * filesize::UNIT_MB;
|
|
|
74 |
$temp->add(new filesize('maxsizeperdownloadcoursefile', new lang_string('maxsizeperdownloadcoursefile', 'admin'),
|
|
|
75 |
new lang_string('maxsizeperdownloadcoursefile_desc', 'admin'), $defaultmaxdownloadsize, filesize::UNIT_MB));
|
|
|
76 |
$temp->hide_if('maxsizeperdownloadcoursefile', 'downloadcoursecontentallowed');
|
|
|
77 |
|
|
|
78 |
$ADMIN->add('courses', $temp);
|
|
|
79 |
|
|
|
80 |
// "courserequests" settingpage.
|
|
|
81 |
$temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
|
|
|
82 |
$temp->add(new admin_setting_configcheckbox('enablecourserequests',
|
|
|
83 |
new lang_string('enablecourserequests', 'admin'),
|
|
|
84 |
new lang_string('configenablecourserequests', 'admin'), 1));
|
|
|
85 |
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory',
|
|
|
86 |
new lang_string('defaultrequestcategory', 'admin'),
|
|
|
87 |
new lang_string('configdefaultrequestcategory', 'admin'), 1));
|
|
|
88 |
$temp->add(new admin_setting_configcheckbox('lockrequestcategory',
|
|
|
89 |
new lang_string('lockrequestcategory', 'admin'),
|
|
|
90 |
new lang_string('configlockrequestcategory', 'admin'), 0));
|
|
|
91 |
$temp->add(new admin_setting_users_with_capability(
|
|
|
92 |
'courserequestnotify',
|
|
|
93 |
new lang_string('courserequestnotify', 'admin'),
|
|
|
94 |
new lang_string('configcourserequestnotify2', 'admin'),
|
|
|
95 |
[],
|
|
|
96 |
'moodle/site:approvecourse'
|
|
|
97 |
));
|
|
|
98 |
$ADMIN->add('courses', $temp);
|
|
|
99 |
|
|
|
100 |
// Pending course requests.
|
|
|
101 |
if (!empty($CFG->enablecourserequests)) {
|
|
|
102 |
$ADMIN->add('courses', new admin_externalpage('coursespending', new lang_string('pendingrequests'),
|
|
|
103 |
$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
// Add a category for the course Default settings.
|
|
|
107 |
$ADMIN->add('courses', new admin_category('coursedefaultsettings', new lang_string('defaultsettingscategory', 'course')));
|
|
|
108 |
// Course Default Settings Page.
|
|
|
109 |
// NOTE: these settings must be applied after all other settings because they depend on them.
|
|
|
110 |
|
|
|
111 |
// Main course settings.
|
|
|
112 |
$temp = new admin_settingpage('coursesettings', new lang_string('coursesettings'));
|
|
|
113 |
require_once($CFG->dirroot.'/course/lib.php');
|
|
|
114 |
|
|
|
115 |
$choices = array();
|
|
|
116 |
$choices['0'] = new lang_string('hide');
|
|
|
117 |
$choices['1'] = new lang_string('show');
|
|
|
118 |
$temp->add(new admin_setting_configselect('moodlecourse/visible', new lang_string('visible'), new lang_string('visible_help'),
|
|
|
119 |
1, $choices));
|
|
|
120 |
|
|
|
121 |
// Enable/disable download course content.
|
|
|
122 |
$choices = [
|
|
|
123 |
DOWNLOAD_COURSE_CONTENT_DISABLED => new lang_string('no'),
|
|
|
124 |
DOWNLOAD_COURSE_CONTENT_ENABLED => new lang_string('yes'),
|
|
|
125 |
];
|
|
|
126 |
$downloadcontentsitedefault = new admin_setting_configselect('moodlecourse/downloadcontentsitedefault',
|
|
|
127 |
new lang_string('enabledownloadcoursecontent', 'course'),
|
|
|
128 |
new lang_string('downloadcoursecontent_help', 'course'), 0, $choices);
|
|
|
129 |
$downloadcontentsitedefault->add_dependent_on('downloadcoursecontentallowed');
|
|
|
130 |
$temp->add($downloadcontentsitedefault);
|
|
|
131 |
|
|
|
132 |
$temp->add(
|
|
|
133 |
new admin_setting_configtext(
|
|
|
134 |
'moodlecourse/participantsperpage',
|
|
|
135 |
new lang_string('participants:perpage', 'course'),
|
|
|
136 |
new lang_string('participants:perpage_help', 'course'),
|
|
|
137 |
20
|
|
|
138 |
)
|
|
|
139 |
);
|
|
|
140 |
|
|
|
141 |
// Course format.
|
|
|
142 |
$temp->add(new admin_setting_heading('courseformathdr', new lang_string('type_format', 'plugin'), ''));
|
|
|
143 |
|
|
|
144 |
$courseformats = get_sorted_course_formats(true);
|
|
|
145 |
$formcourseformats = array();
|
|
|
146 |
foreach ($courseformats as $courseformat) {
|
|
|
147 |
$formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
|
|
|
148 |
}
|
|
|
149 |
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'),
|
|
|
150 |
'topics', $formcourseformats));
|
|
|
151 |
|
|
|
152 |
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'),
|
|
|
153 |
new lang_string('maxnumberweeks_desc'), 52));
|
|
|
154 |
|
|
|
155 |
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'),
|
|
|
156 |
new lang_string('coursehelpnumberweeks'), 4));
|
|
|
157 |
|
|
|
158 |
$choices = array();
|
|
|
159 |
$choices['0'] = new lang_string('hiddensectionscollapsed');
|
|
|
160 |
$choices['1'] = new lang_string('hiddensectionsinvisible');
|
|
|
161 |
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', new lang_string('hiddensections'),
|
|
|
162 |
new lang_string('coursehelphiddensections'), 1, $choices));
|
|
|
163 |
|
|
|
164 |
$choices = array();
|
|
|
165 |
$choices[COURSE_DISPLAY_SINGLEPAGE] = new lang_string('coursedisplay_single');
|
|
|
166 |
$choices[COURSE_DISPLAY_MULTIPAGE] = new lang_string('coursedisplay_multi');
|
|
|
167 |
$temp->add(new admin_setting_configselect('moodlecourse/coursedisplay', new lang_string('coursedisplay'),
|
|
|
168 |
new lang_string('coursedisplay_help'), COURSE_DISPLAY_SINGLEPAGE, $choices));
|
|
|
169 |
|
|
|
170 |
$temp->add(new admin_setting_configcheckbox('moodlecourse/courseenddateenabled', get_string('courseenddateenabled'),
|
|
|
171 |
get_string('courseenddateenabled_desc'), 1));
|
|
|
172 |
|
|
|
173 |
$temp->add(new admin_setting_configduration('moodlecourse/courseduration', get_string('courseduration'),
|
|
|
174 |
get_string('courseduration_desc'), YEARSECS));
|
|
|
175 |
|
|
|
176 |
// Appearance.
|
|
|
177 |
$temp->add(new admin_setting_heading('appearancehdr', new lang_string('appearance'), ''));
|
|
|
178 |
|
|
|
179 |
$languages = array();
|
|
|
180 |
$languages[''] = new lang_string('forceno');
|
|
|
181 |
$languages += get_string_manager()->get_list_of_translations();
|
|
|
182 |
$temp->add(new admin_setting_configselect('moodlecourse/lang', new lang_string('forcelanguage'), '', key($languages),
|
|
|
183 |
$languages));
|
|
|
184 |
|
|
|
185 |
$options = range(0, 10);
|
|
|
186 |
$temp->add(new admin_setting_configselect('moodlecourse/newsitems', new lang_string('newsitemsnumber'),
|
|
|
187 |
new lang_string('coursehelpnewsitemsnumber'), 5, $options));
|
|
|
188 |
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', new lang_string('showgrades'),
|
|
|
189 |
new lang_string('coursehelpshowgrades'), 1, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
|
|
190 |
$temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0,
|
|
|
191 |
array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
|
|
192 |
$temp->add(new admin_setting_configselect('moodlecourse/showactivitydates',
|
|
|
193 |
new lang_string('showactivitydates'),
|
|
|
194 |
new lang_string('showactivitydates_help'), 1, [
|
|
|
195 |
|
|
|
196 |
1 => new lang_string('yes')
|
|
|
197 |
]
|
|
|
198 |
));
|
|
|
199 |
|
|
|
200 |
// Files and uploads.
|
|
|
201 |
$temp->add(new admin_setting_heading('filesanduploadshdr', new lang_string('filesanduploads'), ''));
|
|
|
202 |
|
|
|
203 |
if (!empty($CFG->legacyfilesinnewcourses)) {
|
|
|
204 |
$choices = array('0'=>new lang_string('no'), '2'=>new lang_string('yes'));
|
|
|
205 |
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', new lang_string('courselegacyfiles'),
|
|
|
206 |
new lang_string('courselegacyfiles_help'), key($choices), $choices));
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
$currentmaxbytes = get_config('moodlecourse', 'maxbytes');
|
|
|
210 |
if (isset($CFG->maxbytes)) {
|
|
|
211 |
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $currentmaxbytes);
|
|
|
212 |
} else {
|
|
|
213 |
$choices = get_max_upload_sizes(0, 0, 0, $currentmaxbytes);
|
|
|
214 |
}
|
|
|
215 |
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', new lang_string('maximumupload'),
|
|
|
216 |
new lang_string('coursehelpmaximumupload'), key($choices), $choices));
|
|
|
217 |
|
|
|
218 |
if (!empty($CFG->enablepdfexportfont)) {
|
|
|
219 |
$pdf = new \pdf;
|
|
|
220 |
$fontlist = $pdf->get_export_fontlist();
|
|
|
221 |
// Show the option if the font is defined more than one.
|
|
|
222 |
if (count($fontlist) > 1) {
|
|
|
223 |
$temp->add(new admin_setting_configselect('moodlecourse/pdfexportfont',
|
|
|
224 |
new lang_string('pdfexportfont', 'course'),
|
|
|
225 |
new lang_string('pdfexportfont_help', 'course'),
|
|
|
226 |
'freesans', $fontlist
|
|
|
227 |
));
|
|
|
228 |
}
|
|
|
229 |
}
|
|
|
230 |
|
|
|
231 |
// Completion tracking.
|
|
|
232 |
$temp->add(new admin_setting_heading('progress', new lang_string('completion','completion'), ''));
|
|
|
233 |
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion', 'completion'),
|
|
|
234 |
new lang_string('enablecompletion_help', 'completion'), 1, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
|
|
235 |
|
|
|
236 |
// Display completion conditions.
|
|
|
237 |
$temp->add(new admin_setting_configselect('moodlecourse/showcompletionconditions',
|
|
|
238 |
new lang_string('showcompletionconditions', 'completion'),
|
|
|
239 |
new lang_string('showcompletionconditions_help', 'completion'), 1, [
|
|
|
240 |
|
|
|
241 |
1 => new lang_string('yes')
|
|
|
242 |
]
|
|
|
243 |
));
|
|
|
244 |
|
|
|
245 |
// Groups.
|
|
|
246 |
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
|
|
|
247 |
$choices = array();
|
|
|
248 |
$choices[NOGROUPS] = new lang_string('groupsnone', 'group');
|
|
|
249 |
$choices[SEPARATEGROUPS] = new lang_string('groupsseparate', 'group');
|
|
|
250 |
$choices[VISIBLEGROUPS] = new lang_string('groupsvisible', 'group');
|
|
|
251 |
$temp->add(new admin_setting_configselect('moodlecourse/groupmode', new lang_string('groupmode'), '', key($choices),$choices));
|
|
|
252 |
$temp->add(new admin_setting_configselect('moodlecourse/groupmodeforce', new lang_string('force'), new lang_string('coursehelpforce'), 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
|
|
253 |
|
|
|
254 |
// Communication.
|
|
|
255 |
$temp->add(new admin_setting_heading('communication',
|
|
|
256 |
new lang_string('communication', 'core_communication'), ''));
|
|
|
257 |
|
|
|
258 |
list($communicationproviders, $defaulprovider) = \core_communication\api::
|
|
|
259 |
get_enabled_providers_and_default();
|
|
|
260 |
|
|
|
261 |
$temp->add(new admin_setting_configselect('moodlecourse/coursecommunicationprovider',
|
|
|
262 |
new lang_string('selectcommunicationprovider', 'communication'),
|
|
|
263 |
new lang_string('coursecommunication_desc', 'course'),
|
|
|
264 |
$defaulprovider, $communicationproviders));
|
|
|
265 |
|
|
|
266 |
$ADMIN->add('coursedefaultsettings', $temp);
|
|
|
267 |
if (!empty($CFG->enablecompletion)) {
|
|
|
268 |
$ADMIN->add('coursedefaultsettings', new admin_externalpage(
|
|
|
269 |
'sitedefaultcompletion',
|
|
|
270 |
new lang_string('defaultcompletion', 'completion'),
|
|
|
271 |
new moodle_url('/course/defaultcompletion.php', ['id' => $SITE->id]),
|
|
|
272 |
['moodle/course:manageactivities'])
|
|
|
273 |
);
|
|
|
274 |
}
|
|
|
275 |
$ADMIN->add('coursedefaultsettings', new admin_externalpage(
|
|
|
276 |
'course_customfield',
|
|
|
277 |
new lang_string('course_customfield', 'admin'),
|
|
|
278 |
$CFG->wwwroot . '/course/customfield.php',
|
|
|
279 |
['moodle/course:configurecustomfields'])
|
|
|
280 |
);
|
|
|
281 |
|
|
|
282 |
$temp = new admin_settingpage('activitychoosersettings', new lang_string('activitychoosersettings', 'course'));
|
|
|
283 |
// Tab mode for the activity chooser.
|
|
|
284 |
$temp->add(
|
|
|
285 |
new admin_setting_configselect(
|
|
|
286 |
'activitychoosertabmode',
|
|
|
287 |
new lang_string('activitychoosertabmode', 'course'),
|
|
|
288 |
new lang_string('activitychoosertabmode_desc', 'course'),
|
|
|
289 |
3,
|
|
|
290 |
[
|
|
|
291 |
3 => new lang_string('activitychoosertabmodefour', 'course'),
|
|
|
292 |
4 => new lang_string('activitychoosertabmodefive', 'course'),
|
|
|
293 |
5 => new lang_string('activitychoosertabmodesix', 'course'),
|
|
|
294 |
|
|
|
295 |
1 => new lang_string('activitychoosertabmodetwo', 'course'),
|
|
|
296 |
2 => new lang_string('activitychoosertabmodethree', 'course'),
|
|
|
297 |
]
|
|
|
298 |
)
|
|
|
299 |
);
|
|
|
300 |
|
|
|
301 |
// Add a category for the Groups.
|
|
|
302 |
$ADMIN->add('courses', new admin_category('groups', new lang_string('groups')));
|
|
|
303 |
$ADMIN->add(
|
|
|
304 |
'groups',
|
|
|
305 |
new admin_externalpage(
|
|
|
306 |
'group_customfield',
|
|
|
307 |
new lang_string('group_customfield', 'admin'),
|
|
|
308 |
$CFG->wwwroot . '/group/customfield.php',
|
|
|
309 |
['moodle/group:configurecustomfields']
|
|
|
310 |
)
|
|
|
311 |
);
|
|
|
312 |
$ADMIN->add(
|
|
|
313 |
'groups',
|
|
|
314 |
new admin_externalpage(
|
|
|
315 |
'grouping_customfield',
|
|
|
316 |
new lang_string('grouping_customfield', 'admin'),
|
|
|
317 |
$CFG->wwwroot . '/group/grouping_customfield.php',
|
|
|
318 |
['moodle/group:configurecustomfields']
|
|
|
319 |
)
|
|
|
320 |
);
|
|
|
321 |
|
|
|
322 |
// Add a category for the Activity Chooser.
|
|
|
323 |
$ADMIN->add('courses', new admin_category('activitychooser', new lang_string('activitychoosercategory', 'course')));
|
|
|
324 |
$temp = new admin_settingpage('activitychoosersettings', new lang_string('activitychoosersettings', 'course'));
|
|
|
325 |
// Tab mode for the activity chooser.
|
|
|
326 |
$temp->add(
|
|
|
327 |
new admin_setting_configselect(
|
|
|
328 |
'activitychoosertabmode',
|
|
|
329 |
new lang_string('activitychoosertabmode', 'course'),
|
|
|
330 |
new lang_string('activitychoosertabmode_desc', 'course'),
|
|
|
331 |
3,
|
|
|
332 |
[
|
|
|
333 |
3 => new lang_string('activitychoosertabmodefour', 'course'),
|
|
|
334 |
4 => new lang_string('activitychoosertabmodefive', 'course'),
|
|
|
335 |
5 => new lang_string('activitychoosertabmodesix', 'course'),
|
|
|
336 |
|
|
|
337 |
1 => new lang_string('activitychoosertabmodetwo', 'course'),
|
|
|
338 |
2 => new lang_string('activitychoosertabmodethree', 'course'),
|
|
|
339 |
]
|
|
|
340 |
)
|
|
|
341 |
);
|
|
|
342 |
|
|
|
343 |
// Build a list of plugins that use the footer callback.
|
|
|
344 |
$pluginswithfunction = get_plugins_with_function('custom_chooser_footer', 'lib.php');
|
|
|
345 |
$pluginsoptions = [];
|
|
|
346 |
$pluginsoptions[COURSE_CHOOSER_FOOTER_NONE] = get_string('activitychooserhidefooter', 'course');
|
|
|
347 |
if ($pluginswithfunction) {
|
|
|
348 |
foreach ($pluginswithfunction as $plugintype => $plugins) {
|
|
|
349 |
foreach ($plugins as $pluginname => $pluginfunction) {
|
|
|
350 |
$plugin = $plugintype.'_'.$pluginname;
|
|
|
351 |
$pluginsoptions[$plugin] = get_string('pluginname', $plugin);
|
|
|
352 |
}
|
|
|
353 |
}
|
|
|
354 |
}
|
|
|
355 |
|
|
|
356 |
// Select what plugin to show in the footer.
|
|
|
357 |
$temp->add(
|
|
|
358 |
new admin_setting_configselect(
|
|
|
359 |
'activitychooseractivefooter',
|
|
|
360 |
new lang_string('activitychooseractivefooter', 'course'),
|
|
|
361 |
new lang_string('activitychooseractivefooter_desc', 'course'),
|
|
|
362 |
COURSE_CHOOSER_FOOTER_NONE,
|
|
|
363 |
$pluginsoptions
|
|
|
364 |
)
|
|
|
365 |
);
|
|
|
366 |
|
|
|
367 |
$ADMIN->add('activitychooser', $temp);
|
|
|
368 |
$ADMIN->add('activitychooser',
|
|
|
369 |
new admin_externalpage('activitychooserrecommended', new lang_string('activitychooserrecommendations', 'course'),
|
|
|
370 |
new moodle_url('/course/recommendations.php'),
|
|
|
371 |
array('moodle/course:recommendactivity')
|
|
|
372 |
)
|
|
|
373 |
);
|
|
|
374 |
|
|
|
375 |
// Add a category for backups.
|
|
|
376 |
$ADMIN->add('courses', new admin_category('backups', new lang_string('backups','admin')));
|
|
|
377 |
|
|
|
378 |
// Create a page for general backups configuration and defaults.
|
|
|
379 |
$temp = new admin_settingpage('backupgeneralsettings', new lang_string('generalbackdefaults', 'backup'), 'moodle/backup:backupcourse');
|
|
|
380 |
|
|
|
381 |
// General configuration section.
|
|
|
382 |
$temp->add(new admin_setting_configselect('backup/loglifetime', new lang_string('loglifetime', 'backup'), new lang_string('configloglifetime', 'backup'), 30, array(
|
|
|
383 |
1 => new lang_string('numdays', '', 1),
|
|
|
384 |
2 => new lang_string('numdays', '', 2),
|
|
|
385 |
3 => new lang_string('numdays', '', 3),
|
|
|
386 |
5 => new lang_string('numdays', '', 5),
|
|
|
387 |
7 => new lang_string('numdays', '', 7),
|
|
|
388 |
10 => new lang_string('numdays', '', 10),
|
|
|
389 |
14 => new lang_string('numdays', '', 14),
|
|
|
390 |
20 => new lang_string('numdays', '', 20),
|
|
|
391 |
30 => new lang_string('numdays', '', 30),
|
|
|
392 |
60 => new lang_string('numdays', '', 60),
|
|
|
393 |
90 => new lang_string('numdays', '', 90),
|
|
|
394 |
120 => new lang_string('numdays', '', 120),
|
|
|
395 |
180 => new lang_string('numdays', '', 180),
|
|
|
396 |
365 => new lang_string('numdays', '', 365)
|
|
|
397 |
)));
|
|
|
398 |
|
|
|
399 |
// General defaults section.
|
|
|
400 |
$temp->add(new admin_setting_heading('generalsettings', new lang_string('generalsettings', 'backup'), ''));
|
|
|
401 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', new lang_string('generalusers','backup'), new lang_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
402 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', new lang_string('generalanonymize','backup'), new lang_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
|
|
|
403 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
404 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
405 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
406 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
|
|
407 |
'backup/backup_general_files',
|
|
|
408 |
new lang_string('generalfiles', 'backup'),
|
|
|
409 |
new lang_string('configgeneralfiles', 'backup'),
|
|
|
410 |
array('value' => '1', 'locked' => 0)));
|
|
|
411 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
412 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
413 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), array('value'=>1,'locked'=>0)));
|
|
|
414 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
415 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
416 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', new lang_string('generallogs','backup'), new lang_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
|
|
|
417 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
|
|
|
418 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
419 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_groups',
|
|
|
420 |
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
|
|
421 |
array('value' => 1, 'locked' => 0)));
|
|
|
422 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
423 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_contentbankcontent',
|
|
|
424 |
new lang_string('generalcontentbankcontent', 'backup'),
|
|
|
425 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
|
|
426 |
['value' => 1, 'locked' => 0])
|
|
|
427 |
);
|
|
|
428 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_xapistate',
|
|
|
429 |
new lang_string('generalxapistate', 'backup'),
|
|
|
430 |
new lang_string('configgeneralxapistate', 'backup'),
|
|
|
431 |
['value' => 1, 'locked' => 0])
|
|
|
432 |
);
|
|
|
433 |
|
|
|
434 |
|
|
|
435 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_legacyfiles',
|
|
|
436 |
new lang_string('generallegacyfiles', 'backup'),
|
|
|
437 |
new lang_string('configlegacyfiles', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
438 |
$ADMIN->add('backups', $temp);
|
|
|
439 |
|
|
|
440 |
// Create a page for general import configuration and defaults.
|
|
|
441 |
$temp = new admin_settingpage('importgeneralsettings', new lang_string('importgeneralsettings', 'backup'), 'moodle/backup:backupcourse');
|
|
|
442 |
$temp->add(new admin_setting_configtext('backup/import_general_maxresults', new lang_string('importgeneralmaxresults', 'backup'), new lang_string('importgeneralmaxresults_desc', 'backup'), 10));
|
|
|
443 |
$temp->add(new admin_setting_configcheckbox('backup/import_general_duplicate_admin_allowed',
|
|
|
444 |
new lang_string('importgeneralduplicateadminallowed', 'backup'),
|
|
|
445 |
new lang_string('importgeneralduplicateadminallowed_desc', 'backup'), 0));
|
|
|
446 |
|
|
|
447 |
// Import defaults section.
|
|
|
448 |
$temp->add(new admin_setting_heading('importsettings', new lang_string('importsettings', 'backup'), ''));
|
|
|
449 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
|
|
450 |
'backup/backup_import_permissions',
|
|
|
451 |
new lang_string('generalpermissions', 'backup'),
|
|
|
452 |
new lang_string('configgeneralpermissions', 'backup'),
|
|
|
453 |
array('value' => 0, 'locked' => 0)));
|
|
|
454 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
455 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
456 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
457 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
458 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
459 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_groups',
|
|
|
460 |
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
|
|
461 |
array('value' => 1, 'locked' => 0)));
|
|
|
462 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
|
|
463 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
|
|
464 |
'backup/backup_import_contentbankcontent',
|
|
|
465 |
new lang_string('generalcontentbankcontent', 'backup'),
|
|
|
466 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
|
|
467 |
['value' => 1, 'locked' => 0])
|
|
|
468 |
);
|
|
|
469 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_legacyfiles',
|
|
|
470 |
new lang_string('generallegacyfiles', 'backup'),
|
|
|
471 |
new lang_string('configlegacyfiles', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
472 |
|
|
|
473 |
$ADMIN->add('backups', $temp);
|
|
|
474 |
|
|
|
475 |
// Create a page for automated backups configuration and defaults.
|
|
|
476 |
$temp = new admin_settingpage('automated', new lang_string('automatedsetup','backup'), 'moodle/backup:backupcourse');
|
|
|
477 |
|
|
|
478 |
// Automated configuration section.
|
|
|
479 |
$temp->add(new admin_setting_configselect('backup/backup_auto_active', new lang_string('active'), new lang_string('autoactivedescription', 'backup'), 0, array(
|
|
|
480 |
|
|
|
481 |
1 => new lang_string('autoactiveenabled', 'backup'),
|
|
|
482 |
2 => new lang_string('autoactivemanual', 'backup')
|
|
|
483 |
)));
|
|
|
484 |
$temp->add(new admin_setting_special_backupdays());
|
|
|
485 |
$temp->add(new admin_setting_configtime('backup/backup_auto_hour', 'backup_auto_minute', new lang_string('executeat'),
|
|
|
486 |
new lang_string('backupexecuteathelp'), array('h' => 0, 'm' => 0)));
|
|
|
487 |
$storageoptions = array(
|
|
|
488 |
|
|
|
489 |
1 => new lang_string('storageexternalonly', 'backup'),
|
|
|
490 |
2 => new lang_string('storagecourseandexternal', 'backup')
|
|
|
491 |
);
|
|
|
492 |
$temp->add(new admin_setting_configselect('backup/backup_auto_storage', new lang_string('automatedstorage', 'backup'), new lang_string('automatedstoragehelp', 'backup'), 0, $storageoptions));
|
|
|
493 |
$temp->add(new admin_setting_special_backup_auto_destination());
|
|
|
494 |
|
|
|
495 |
$maxkeptoptions = array(
|
|
|
496 |
|
|
|
497 |
2 => '2',
|
|
|
498 |
3 => '3',
|
|
|
499 |
4 => '4',
|
|
|
500 |
5 => '5',
|
|
|
501 |
10 => '10',
|
|
|
502 |
20 => '20',
|
|
|
503 |
30 => '30',
|
|
|
504 |
40 => '40',
|
|
|
505 |
50 => '50',
|
|
|
506 |
100 => '100',
|
|
|
507 |
200 => '200',
|
|
|
508 |
300 => '300',
|
|
|
509 |
400 => '400',
|
|
|
510 |
500 => '500');
|
|
|
511 |
$temp->add(new admin_setting_configselect('backup/backup_auto_max_kept', new lang_string('automatedmaxkept', 'backup'),
|
|
|
512 |
new lang_string('automatedmaxkepthelp', 'backup'), 1, $maxkeptoptions));
|
|
|
513 |
|
|
|
514 |
$automateddeletedaysoptions = array(
|
|
|
515 |
|
|
|
516 |
1000 => new lang_string('numdays', '', 1000),
|
|
|
517 |
365 => new lang_string('numdays', '', 365),
|
|
|
518 |
180 => new lang_string('numdays', '', 180),
|
|
|
519 |
150 => new lang_string('numdays', '', 150),
|
|
|
520 |
120 => new lang_string('numdays', '', 120),
|
|
|
521 |
90 => new lang_string('numdays', '', 90),
|
|
|
522 |
60 => new lang_string('numdays', '', 60),
|
|
|
523 |
35 => new lang_string('numdays', '', 35),
|
|
|
524 |
10 => new lang_string('numdays', '', 10),
|
|
|
525 |
5 => new lang_string('numdays', '', 5),
|
|
|
526 |
2 => new lang_string('numdays', '', 2)
|
|
|
527 |
);
|
|
|
528 |
$temp->add(new admin_setting_configselect('backup/backup_auto_delete_days', new lang_string('automateddeletedays', 'backup'),
|
|
|
529 |
'', 0, $automateddeletedaysoptions));
|
|
|
530 |
|
|
|
531 |
$minkeptoptions = array(
|
|
|
532 |
|
|
|
533 |
1 => '1',
|
|
|
534 |
2 => '2',
|
|
|
535 |
5 => '5',
|
|
|
536 |
10 => '10',
|
|
|
537 |
20 => '20',
|
|
|
538 |
30 => '30',
|
|
|
539 |
40 => '40',
|
|
|
540 |
50 => '50',
|
|
|
541 |
100 => '100',
|
|
|
542 |
200 => '200',
|
|
|
543 |
300 => '300',
|
|
|
544 |
400 => '400'
|
|
|
545 |
);
|
|
|
546 |
$temp->add(new admin_setting_configselect('backup/backup_auto_min_kept', new lang_string('automatedminkept', 'backup'),
|
|
|
547 |
new lang_string('automatedminkepthelp', 'backup'), 0, $minkeptoptions));
|
|
|
548 |
|
|
|
549 |
$temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
|
|
|
550 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_hidden', new lang_string('skiphidden', 'backup'), new lang_string('skiphiddenhelp', 'backup'), 1));
|
|
|
551 |
$temp->add(new admin_setting_configselect('backup/backup_auto_skip_modif_days', new lang_string('skipmodifdays', 'backup'), new lang_string('skipmodifdayshelp', 'backup'), 30, array(
|
|
|
552 |
|
|
|
553 |
1 => new lang_string('numdays', '', 1),
|
|
|
554 |
2 => new lang_string('numdays', '', 2),
|
|
|
555 |
3 => new lang_string('numdays', '', 3),
|
|
|
556 |
5 => new lang_string('numdays', '', 5),
|
|
|
557 |
7 => new lang_string('numdays', '', 7),
|
|
|
558 |
10 => new lang_string('numdays', '', 10),
|
|
|
559 |
14 => new lang_string('numdays', '', 14),
|
|
|
560 |
20 => new lang_string('numdays', '', 20),
|
|
|
561 |
30 => new lang_string('numdays', '', 30),
|
|
|
562 |
60 => new lang_string('numdays', '', 60),
|
|
|
563 |
90 => new lang_string('numdays', '', 90),
|
|
|
564 |
120 => new lang_string('numdays', '', 120),
|
|
|
565 |
180 => new lang_string('numdays', '', 180),
|
|
|
566 |
365 => new lang_string('numdays', '', 365)
|
|
|
567 |
)));
|
|
|
568 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_skip_modif_prev', new lang_string('skipmodifprev', 'backup'), new lang_string('skipmodifprevhelp', 'backup'), 0));
|
|
|
569 |
|
|
|
570 |
// Automated defaults section.
|
|
|
571 |
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), new lang_string('recyclebin_desc', 'backup')));
|
|
|
572 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
|
|
|
573 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
|
|
|
574 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities', 'backup'),
|
|
|
575 |
new lang_string('backupautoactivitiesdescription', 'backup'), 1));
|
|
|
576 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), 1));
|
|
|
577 |
$temp->add(new admin_setting_configcheckbox(
|
|
|
578 |
'backup/backup_auto_files',
|
|
|
579 |
new lang_string('generalfiles', 'backup'),
|
|
|
580 |
new lang_string('configgeneralfiles', 'backup'), '1'));
|
|
|
581 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), 1));
|
|
|
582 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_comments', new lang_string('generalcomments','backup'), new lang_string('configgeneralcomments','backup'), 1));
|
|
|
583 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), 1));
|
|
|
584 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), 1));
|
|
|
585 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), 1));
|
|
|
586 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', new lang_string('generallogs', 'backup'), new lang_string('configgenerallogs', 'backup'), 0));
|
|
|
587 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), 0));
|
|
|
588 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), 1));
|
|
|
589 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_groups', new lang_string('generalgroups', 'backup'),
|
|
|
590 |
new lang_string('configgeneralgroups', 'backup'), 1));
|
|
|
591 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), 1));
|
|
|
592 |
$temp->add(new admin_setting_configcheckbox(
|
|
|
593 |
'backup/backup_auto_contentbankcontent',
|
|
|
594 |
new lang_string('generalcontentbankcontent', 'backup'),
|
|
|
595 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
|
|
596 |
1)
|
|
|
597 |
);
|
|
|
598 |
$temp->add(new admin_setting_configcheckbox(
|
|
|
599 |
'backup/backup_auto_xapistate',
|
|
|
600 |
new lang_string('generalxapistate', 'backup'),
|
|
|
601 |
new lang_string('configgeneralxapistate', 'backup'),
|
|
|
602 |
1)
|
|
|
603 |
);
|
|
|
604 |
|
|
|
605 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_legacyfiles',
|
|
|
606 |
new lang_string('generallegacyfiles', 'backup'),
|
|
|
607 |
new lang_string('configlegacyfiles', 'backup'), 1));
|
|
|
608 |
|
|
|
609 |
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_messages', new lang_string('messages', 'message'), new lang_string('backupmessageshelp','message'), 0));
|
|
|
610 |
//$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blogs', new lang_string('blogs', 'blog'), new lang_string('backupblogshelp','blog'), 0));
|
|
|
611 |
|
|
|
612 |
$ADMIN->add('backups', $temp);
|
|
|
613 |
|
|
|
614 |
// Create a page for general restore configuration and defaults.
|
|
|
615 |
$temp = new admin_settingpage('restoregeneralsettings', new lang_string('generalrestoredefaults', 'backup'));
|
|
|
616 |
|
|
|
617 |
// General restore defaults.
|
|
|
618 |
$temp->add(new admin_setting_heading('generalsettings', new lang_string('generalrestoresettings', 'backup'), ''));
|
|
|
619 |
|
|
|
620 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_users',
|
|
|
621 |
new lang_string('generalusers', 'backup'), new lang_string('configrestoreusers', 'backup'),
|
|
|
622 |
array('value' => 1, 'locked' => 0)));
|
|
|
623 |
// Can not use actual constants here because we'd need to include 100 of backup/restore files.
|
|
|
624 |
$options = [
|
|
|
625 |
0/*backup::ENROL_NEVER*/ => get_string('rootsettingenrolments_never', 'backup'),
|
|
|
626 |
1/*backup::ENROL_WITHUSERS*/ => get_string('rootsettingenrolments_withusers', 'backup'),
|
|
|
627 |
2/*backup::ENROL_ALWAYS*/ => get_string('rootsettingenrolments_always', 'backup'),
|
|
|
628 |
];
|
|
|
629 |
$temp->add(new admin_setting_configselect_with_lock('restore/restore_general_enrolments',
|
|
|
630 |
new lang_string('generalenrolments', 'backup'), new lang_string('configrestoreenrolments', 'backup'),
|
|
|
631 |
array('value' => 1/*backup::ENROL_WITHUSERS*/, 'locked' => 0), $options));
|
|
|
632 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_role_assignments',
|
|
|
633 |
new lang_string('generalroleassignments', 'backup'),
|
|
|
634 |
new lang_string('configrestoreroleassignments', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
635 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_permissions',
|
|
|
636 |
new lang_string('generalpermissions', 'backup'),
|
|
|
637 |
new lang_string('configrestorepermissions', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
638 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_activities',
|
|
|
639 |
new lang_string('generalactivities', 'backup'),
|
|
|
640 |
new lang_string('configrestoreactivities', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
641 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_blocks',
|
|
|
642 |
new lang_string('generalblocks', 'backup'),
|
|
|
643 |
new lang_string('configrestoreblocks', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
644 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_filters',
|
|
|
645 |
new lang_string('generalfilters', 'backup'),
|
|
|
646 |
new lang_string('configrestorefilters', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
647 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_comments',
|
|
|
648 |
new lang_string('generalcomments', 'backup'),
|
|
|
649 |
new lang_string('configrestorecomments', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
650 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_badges',
|
|
|
651 |
new lang_string('generalbadges', 'backup'),
|
|
|
652 |
new lang_string('configrestorebadges', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
653 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_calendarevents',
|
|
|
654 |
new lang_string('generalcalendarevents', 'backup'),
|
|
|
655 |
new lang_string('configrestorecalendarevents', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
656 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_userscompletion',
|
|
|
657 |
new lang_string('generaluserscompletion', 'backup'),
|
|
|
658 |
new lang_string('configrestoreuserscompletion', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
659 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_logs',
|
|
|
660 |
new lang_string('generallogs', 'backup'),
|
|
|
661 |
new lang_string('configrestorelogs', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
662 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_histories',
|
|
|
663 |
new lang_string('generalhistories', 'backup'),
|
|
|
664 |
new lang_string('configrestorehistories', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
665 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_groups',
|
|
|
666 |
new lang_string('generalgroups', 'backup'), new lang_string('configrestoregroups', 'backup'),
|
|
|
667 |
array('value' => 1, 'locked' => 0)));
|
|
|
668 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_competencies',
|
|
|
669 |
new lang_string('generalcompetencies', 'backup'),
|
|
|
670 |
new lang_string('configrestorecompetencies', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
671 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_contentbankcontent',
|
|
|
672 |
new lang_string('generalcontentbankcontent', 'backup'),
|
|
|
673 |
new lang_string('configrestorecontentbankcontent', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
674 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_xapistate',
|
|
|
675 |
new lang_string('generalxapistate', 'backup'),
|
|
|
676 |
new lang_string('configrestorexapistate', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
677 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_legacyfiles',
|
|
|
678 |
new lang_string('generallegacyfiles', 'backup'),
|
|
|
679 |
new lang_string('configlegacyfiles', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
680 |
|
|
|
681 |
// Restore defaults when merging into another course.
|
|
|
682 |
$temp->add(new admin_setting_heading('mergerestoredefaults', new lang_string('mergerestoredefaults', 'backup'), ''));
|
|
|
683 |
|
|
|
684 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_overwrite_conf',
|
|
|
685 |
new lang_string('setting_overwrite_conf', 'backup'),
|
|
|
686 |
new lang_string('config_overwrite_conf', 'backup'), array('value' => 0, 'locked' => 0)));
|
|
|
687 |
|
|
|
688 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_course_fullname',
|
|
|
689 |
new lang_string('setting_overwrite_course_fullname', 'backup'),
|
|
|
690 |
new lang_string('config_overwrite_course_fullname', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
691 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_course_shortname',
|
|
|
692 |
new lang_string('setting_overwrite_course_shortname', 'backup'),
|
|
|
693 |
new lang_string('config_overwrite_course_shortname', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
694 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_merge_course_startdate',
|
|
|
695 |
new lang_string('setting_overwrite_course_startdate', 'backup'),
|
|
|
696 |
new lang_string('config_overwrite_course_startdate', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
697 |
|
|
|
698 |
// Restore defaults when replacing course contents.
|
|
|
699 |
$temp->add(new admin_setting_heading('replacerestoredefaults', new lang_string('replacerestoredefaults', 'backup'), ''));
|
|
|
700 |
|
|
|
701 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_overwrite_conf',
|
|
|
702 |
new lang_string('setting_overwrite_conf', 'backup'),
|
|
|
703 |
new lang_string('config_overwrite_conf', 'backup'), array('value' => 0, 'locked' => 0)));
|
|
|
704 |
|
|
|
705 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_course_fullname',
|
|
|
706 |
new lang_string('setting_overwrite_course_fullname', 'backup'),
|
|
|
707 |
new lang_string('config_overwrite_course_fullname', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
708 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_course_shortname',
|
|
|
709 |
new lang_string('setting_overwrite_course_shortname', 'backup'),
|
|
|
710 |
new lang_string('config_overwrite_course_shortname', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
711 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_replace_course_startdate',
|
|
|
712 |
new lang_string('setting_overwrite_course_startdate', 'backup'),
|
|
|
713 |
new lang_string('config_overwrite_course_startdate', 'backup'), array('value' => 1, 'locked' => 0)));
|
|
|
714 |
|
|
|
715 |
$temp->add(new admin_setting_configselect_with_lock('restore/restore_replace_keep_roles_and_enrolments',
|
|
|
716 |
new lang_string('setting_keep_roles_and_enrolments', 'backup'),
|
|
|
717 |
new lang_string('config_keep_roles_and_enrolments', 'backup'), array('value' => 0, 'locked' => 0),
|
|
|
718 |
array(1 => get_string('yes'), 0 => get_string('no'))));
|
|
|
719 |
$temp->add(new admin_setting_configselect_with_lock('restore/restore_replace_keep_groups_and_groupings',
|
|
|
720 |
new lang_string('setting_keep_groups_and_groupings', 'backup'),
|
|
|
721 |
new lang_string('config_keep_groups_and_groupings', 'backup'), array('value' => 0, 'locked' => 0),
|
|
|
722 |
array(1 => get_string('yes'), 0 => get_string('no'))));
|
|
|
723 |
|
|
|
724 |
$ADMIN->add('backups', $temp);
|
|
|
725 |
|
|
|
726 |
// Create a page for asynchronous backup and restore configuration and defaults.
|
|
|
727 |
$temp = new admin_settingpage('asyncgeneralsettings', new lang_string('asyncgeneralsettings', 'backup'));
|
|
|
728 |
|
|
|
729 |
$temp->add(new admin_setting_configcheckbox('enableasyncbackup', new lang_string('enableasyncbackup', 'backup'),
|
|
|
730 |
new lang_string('enableasyncbackup_help', 'backup'), 1, 1, 0));
|
|
|
731 |
|
|
|
732 |
$temp->add(new admin_setting_configcheckbox(
|
|
|
733 |
'backup/backup_async_message_users',
|
|
|
734 |
new lang_string('asyncemailenable', 'backup'),
|
|
|
735 |
new lang_string('asyncemailenabledetail', 'backup'), 1));
|
|
|
736 |
$temp->hide_if('backup/backup_async_message_users', 'enableasyncbackup');
|
|
|
737 |
|
|
|
738 |
$temp->add(new admin_setting_configtext(
|
|
|
739 |
'backup/backup_async_message_subject',
|
|
|
740 |
new lang_string('asyncmessagesubject', 'backup'),
|
|
|
741 |
new lang_string('asyncmessagesubjectdetail', 'backup'),
|
|
|
742 |
new lang_string('asyncmessagesubjectdefault', 'backup')));
|
|
|
743 |
$temp->hide_if('backup/backup_async_message_subject', 'backup/backup_async_message_users');
|
|
|
744 |
|
|
|
745 |
$temp->add(new admin_setting_confightmleditor(
|
|
|
746 |
'backup/backup_async_message',
|
|
|
747 |
new lang_string('asyncmessagebody', 'backup'),
|
|
|
748 |
new lang_string('asyncmessagebodydetail', 'backup'),
|
|
|
749 |
new lang_string('asyncmessagebodydefault', 'backup')));
|
|
|
750 |
$temp->hide_if('backup/backup_async_message', 'backup/backup_async_message_users');
|
|
|
751 |
|
|
|
752 |
$ADMIN->add('backups', $temp);
|
|
|
753 |
|
|
|
754 |
}
|