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