MDL-16043: manage case when administrator set enrol_remotecoursefield or enrol_remote...
[moodle-linuxchix.git] / admin / settings / courses.php
blob60f10c5ccc92e7b3e74dd6440920d47182cb5ed2
1 <?php // $Id$
3 // This file defines settingpages and externalpages under the "courses" category
5 if ($hassiteconfig
6 or has_capability('moodle/site:backup', $systemcontext)
7 or has_capability('moodle/category:update', $systemcontext)) { // speedup for non-admins, add all caps used on this page
10 $ADMIN->add('courses', new admin_externalpage('coursemgmt', get_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on','moodle/category:update'));
12 $ADMIN->add('courses', new admin_enrolment_page());
14 // "courserequests" settingpage
15 $temp = new admin_settingpage('courserequest', get_string('courserequest'));
16 $temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0));
17 $temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1));
18 $ADMIN->add('courses', $temp);
20 // "backups" settingpage
21 if (!empty($CFG->backup_version)) {
22 $bi = array();
23 $bi[] = new admin_setting_configcheckbox('backup_sche_modules', get_string('includemodules'), get_string('backupincludemoduleshelp'), 0);
24 $bi[] = new admin_setting_configcheckbox('backup_sche_withuserdata', get_string('includemoduleuserdata'), get_string('backupincludemoduleuserdatahelp'), 0);
25 $bi[] = new admin_setting_configcheckbox('backup_sche_metacourse', get_string('metacourse'), get_string('backupmetacoursehelp'), 0);
26 $bi[] = new admin_setting_configselect('backup_sche_users', get_string('users'), get_string('backupusershelp'),
27 0, array(0 => get_string('all'), 1 => get_string('course')));
28 $bi[] = new admin_setting_configcheckbox('backup_sche_logs', get_string('logs'), get_string('backuplogshelp'), 0);
29 $bi[] = new admin_setting_configcheckbox('backup_sche_userfiles', get_string('userfiles'), get_string('backupuserfileshelp'), 0);
30 $bi[] = new admin_setting_configcheckbox('backup_sche_coursefiles', get_string('coursefiles'), get_string('backupcoursefileshelp'), 0);
31 $bi[] = new admin_setting_configcheckbox('backup_sche_sitefiles', get_string('sitefiles'), get_string('backupsitefileshelp'), 0);
32 $bi[] = new admin_setting_configcheckbox('backup_sche_messages', get_string('messages', 'message'), get_string('backupmessageshelp','message'), 0);
33 $bi[] = new admin_setting_configcheckbox('backup_sche_blogs', get_string('blogs', 'blog'), get_string('backupblogshelp','blog'), 0);
34 $bi[] = new admin_setting_configselect('backup_sche_keep', get_string('keep'),
35 get_string('backupkeephelp'), 1, array(0 => get_string('all'), 1 => '1',
36 2 => '2',
37 5 => '5',
38 10 => '10',
39 20 => '20',
40 30 => '30',
41 40 => '40',
42 50 => '50',
43 100 => '100',
44 200 => '200',
45 300 => '300',
46 400 => '400',
47 500 => '500'));
48 $bi[] = new admin_setting_configcheckbox('backup_sche_active', get_string('active'), get_string('backupactivehelp'), 0);
49 $bi[] = new admin_setting_special_backupdays();
50 $bi[] = new admin_setting_configtime('backup_sche_hour', 'backup_sche_minute', get_string('executeat'),
51 get_string('backupexecuteathelp'), array('h' => 0, 'm' => 0));
52 $bi[] = new admin_setting_configdirectory('backup_sche_destination', get_string('saveto'), get_string('backupsavetohelp'), '');
54 $temp = new admin_settingpage('backups', get_string('backups','admin'), 'moodle/site:backup');
55 foreach ($bi as $backupitem) {
56 $backupitem->plugin = 'backup';
57 $temp->add($backupitem);
59 $ADMIN->add('courses', $temp);
62 } // end of speedup