mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-12846: add course default settings page
This commit is contained in:
parent
edc1b8bd88
commit
eb1b95976f
3 changed files with 127 additions and 20 deletions
|
@ -11,13 +11,115 @@ if ($hassiteconfig
|
||||||
|
|
||||||
$ADMIN->add('courses', new admin_enrolment_page());
|
$ADMIN->add('courses', new admin_enrolment_page());
|
||||||
|
|
||||||
// "courserequests" settingpage
|
/// Course Default Settings Page
|
||||||
|
///main course settings
|
||||||
|
$temp = new admin_settingpage('coursesettings', get_string('coursesettings'));
|
||||||
|
$temp->add(new admin_settings_coursecat_select('course_category', get_string('category'), '', 1));
|
||||||
|
$courseformats = get_list_of_plugins('course/format');
|
||||||
|
$formcourseformats = array();
|
||||||
|
foreach ($courseformats as $courseformat) {
|
||||||
|
$formcourseformats["$courseformat"] = get_string("format$courseformat","format_$courseformat");
|
||||||
|
if ($formcourseformats["$courseformat"]=="[[format$courseformat]]") {
|
||||||
|
$formcourseformats["$courseformat"] = get_string("format$courseformat");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$temp->add(new admin_setting_configselect('course_format', get_string('format'), get_string('courseformats'), key($formcourseformats),$formcourseformats));
|
||||||
|
for ($i=1; $i<=52; $i++) {
|
||||||
|
$sectionmenu[$i] = "$i";
|
||||||
|
}
|
||||||
|
$temp->add(new admin_setting_configselect('course_numsections', get_string('numberweeks'), '', 1,$sectionmenu));
|
||||||
|
$choices = array();
|
||||||
|
$choices['0'] = get_string('hiddensectionscollapsed');
|
||||||
|
$choices['1'] = get_string('hiddensectionsinvisible');
|
||||||
|
$temp->add(new admin_setting_configselect('course_hiddensections', get_string('hiddensections'), '', 0,$choices));
|
||||||
|
$options = range(0, 10);
|
||||||
|
$temp->add(new admin_setting_configselect('course_newsitems', get_string('newsitemsnumber'), '', 5,$options));
|
||||||
|
$temp->add(new admin_setting_configselect('course_showgrades', get_string('showgrades'), get_string('grades'), 1,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||||
|
$temp->add(new admin_setting_configselect('course_showreports', get_string('showreports'), get_string('activityreport'), 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||||
|
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||||
|
$temp->add(new admin_setting_configselect('course_maxbytes', get_string('maximumupload'), '', key($choices),$choices));
|
||||||
|
$temp->add(new admin_setting_configselect('course_metacourse', get_string('metacourse'), '', 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||||
|
|
||||||
|
///enrolement course settings
|
||||||
|
$temp->add(new admin_setting_heading('enrolhdr', get_string('enrolments'), ''));
|
||||||
|
require_once($CFG->dirroot.'/enrol/enrol.class.php');
|
||||||
|
$choices = array();
|
||||||
|
$modules = explode(',', $CFG->enrol_plugins_enabled);
|
||||||
|
foreach ($modules as $module) {
|
||||||
|
$name = get_string('enrolname', "enrol_$module");
|
||||||
|
$plugin = enrolment_factory::factory($module);
|
||||||
|
if (method_exists($plugin, 'print_entry')) {
|
||||||
|
$choices[$name] = $module;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
asort($choices);
|
||||||
|
$choices = array_flip($choices);
|
||||||
|
$choices = array_merge(array('' => get_string('sitedefault').' ('.get_string('enrolname', "enrol_$CFG->enrol").')'), $choices);
|
||||||
|
$temp->add(new admin_setting_configselect('course_enrol', get_string('enrolmentplugins'), '', key($choices),$choices));
|
||||||
|
$choices = array(0 => get_string('no'), 1 => get_string('yes'), 2 => get_string('enroldate'));
|
||||||
|
$temp->add(new admin_setting_configselect('course_enrollable', get_string('enrollable'), '', 1,$choices));
|
||||||
|
$periodmenu=array();
|
||||||
|
$periodmenu[0] = get_string('unlimited');
|
||||||
|
for ($i=1; $i<=365; $i++) {
|
||||||
|
$seconds = $i * 86400;
|
||||||
|
$periodmenu[$seconds] = get_string('numdays', '', $i);
|
||||||
|
}
|
||||||
|
$temp->add(new admin_setting_configselect('course_enrolperiod', get_string('enrolperiod'), '', 0,$periodmenu));
|
||||||
|
|
||||||
|
///
|
||||||
|
$temp->add(new admin_setting_heading('expirynotifyhdr', get_string('expirynotify'), ''));
|
||||||
|
$temp->add(new admin_setting_configselect('course_expirynotify', get_string('notify'), '', 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||||
|
$temp->add(new admin_setting_configselect('course_notifystudents', get_string('expirynotifystudents'), '', 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||||
|
$thresholdmenu=array();
|
||||||
|
for ($i=1; $i<=30; $i++) {
|
||||||
|
$seconds = $i * 86400;
|
||||||
|
$thresholdmenu[$seconds] = get_string('numdays', '', $i);
|
||||||
|
}
|
||||||
|
$temp->add(new admin_setting_configselect('course_expirythreshold', get_string('expirythreshold'), '', 10 * 86400,$thresholdmenu));
|
||||||
|
|
||||||
|
|
||||||
|
$temp->add(new admin_setting_heading('groups', get_string('groups', 'group'), ''));
|
||||||
|
$choices = array();
|
||||||
|
$choices[NOGROUPS] = get_string('groupsnone', 'group');
|
||||||
|
$choices[SEPARATEGROUPS] = get_string('groupsseparate', 'group');
|
||||||
|
$choices[VISIBLEGROUPS] = get_string('groupsvisible', 'group');
|
||||||
|
$temp->add(new admin_setting_configselect('course_groupmode', get_string('groupmode'), '', key($choices),$choices));
|
||||||
|
$temp->add(new admin_setting_configselect('course_groupmodeforce', get_string('force'), get_string('groupmodeforce'), 0,array(0 => get_string('no'), 1 => get_string('yes'))));
|
||||||
|
|
||||||
|
|
||||||
|
$temp->add(new admin_setting_heading('availability', get_string('availability'), ''));
|
||||||
|
$choices = array();
|
||||||
|
$choices['0'] = get_string('courseavailablenot');
|
||||||
|
$choices['1'] = get_string('courseavailable');
|
||||||
|
$temp->add(new admin_setting_configselect('course_visible', get_string('visible'), '', 1,$choices));
|
||||||
|
$temp->add(new admin_setting_configpasswordunmask('course_enrolpassword', get_string('enrolmentkey'), '',''));
|
||||||
|
$choices = array();
|
||||||
|
$choices['0'] = get_string('guestsno');
|
||||||
|
$choices['1'] = get_string('guestsyes');
|
||||||
|
$choices['2'] = get_string('guestskey');
|
||||||
|
$temp->add(new admin_setting_configselect('course_guest', get_string('opentoguests'), '', 0,$choices));
|
||||||
|
|
||||||
|
|
||||||
|
$temp->add(new admin_setting_heading('language', get_string('language'), ''));
|
||||||
|
$languages=array();
|
||||||
|
$languages[''] = get_string('forceno');
|
||||||
|
$languages += get_list_of_languages();
|
||||||
|
$temp->add(new admin_setting_configselect('course_lang', get_string('forcelanguage'), '', 0,$languages));
|
||||||
|
|
||||||
|
if(completion_info::is_enabled_for_site()) {
|
||||||
|
$temp->add(new admin_setting_heading('progress', get_string('progress','completion'), ''));
|
||||||
|
$temp->add(new admin_setting_configselect('course_enablecompletion', get_string('completion','completion'), '',
|
||||||
|
1,array(0 => get_string('completiondisabled','completion'), 1 => get_string('completionenabled','completion'))));
|
||||||
|
}
|
||||||
|
$ADMIN->add('courses', $temp);
|
||||||
|
|
||||||
|
/// "courserequests" settingpage
|
||||||
$temp = new admin_settingpage('courserequest', get_string('courserequest'));
|
$temp = new admin_settingpage('courserequest', get_string('courserequest'));
|
||||||
$temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0));
|
$temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0));
|
||||||
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1));
|
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1));
|
||||||
$ADMIN->add('courses', $temp);
|
$ADMIN->add('courses', $temp);
|
||||||
|
|
||||||
// "backups" settingpage
|
/// "backups" settingpage
|
||||||
if (!empty($CFG->backup_version)) {
|
if (!empty($CFG->backup_version)) {
|
||||||
$temp = new admin_settingpage('backups', get_string('backups','admin'), 'moodle/site:backup');
|
$temp = new admin_settingpage('backups', get_string('backups','admin'), 'moodle/site:backup');
|
||||||
$temp->add(new admin_setting_configcheckbox('backup/backup_sche_modules', get_string('includemodules'), get_string('backupincludemoduleshelp'), 0));
|
$temp->add(new admin_setting_configcheckbox('backup/backup_sche_modules', get_string('includemodules'), get_string('backupincludemoduleshelp'), 0));
|
||||||
|
|
|
@ -71,7 +71,7 @@ class course_edit_form extends moodleform {
|
||||||
$mform->addElement('hidden', 'category', null);
|
$mform->addElement('hidden', 'category', null);
|
||||||
}
|
}
|
||||||
$mform->setHelpButton('category', array('coursecategory', get_string('category')));
|
$mform->setHelpButton('category', array('coursecategory', get_string('category')));
|
||||||
$mform->setDefault('category', $category->id);
|
$mform->setDefault('category', $CFG->course_category);
|
||||||
$mform->setType('category', PARAM_INT);
|
$mform->setType('category', PARAM_INT);
|
||||||
|
|
||||||
$mform->addElement('text','fullname', get_string('fullnamecourse'),'maxlength="254" size="50"');
|
$mform->addElement('text','fullname', get_string('fullnamecourse'),'maxlength="254" size="50"');
|
||||||
|
@ -113,13 +113,13 @@ class course_edit_form extends moodleform {
|
||||||
}
|
}
|
||||||
$mform->addElement('select', 'format', get_string('format'), $formcourseformats);
|
$mform->addElement('select', 'format', get_string('format'), $formcourseformats);
|
||||||
$mform->setHelpButton('format', array('courseformats', get_string('courseformats')), true);
|
$mform->setHelpButton('format', array('courseformats', get_string('courseformats')), true);
|
||||||
$mform->setDefault('format', 'weeks');
|
$mform->setDefault('format', $CFG->course_format);
|
||||||
|
|
||||||
for ($i=1; $i<=52; $i++) {
|
for ($i=1; $i<=52; $i++) {
|
||||||
$sectionmenu[$i] = "$i";
|
$sectionmenu[$i] = "$i";
|
||||||
}
|
}
|
||||||
$mform->addElement('select', 'numsections', get_string('numberweeks'), $sectionmenu);
|
$mform->addElement('select', 'numsections', get_string('numberweeks'), $sectionmenu);
|
||||||
$mform->setDefault('numsections', 10);
|
$mform->setDefault('numsections', $CFG->course_numsections);
|
||||||
|
|
||||||
$mform->addElement('date_selector', 'startdate', get_string('startdate'));
|
$mform->addElement('date_selector', 'startdate', get_string('startdate'));
|
||||||
$mform->setHelpButton('startdate', array('coursestartdate', get_string('startdate')), true);
|
$mform->setHelpButton('startdate', array('coursestartdate', get_string('startdate')), true);
|
||||||
|
@ -130,24 +130,25 @@ class course_edit_form extends moodleform {
|
||||||
$choices['1'] = get_string('hiddensectionsinvisible');
|
$choices['1'] = get_string('hiddensectionsinvisible');
|
||||||
$mform->addElement('select', 'hiddensections', get_string('hiddensections'), $choices);
|
$mform->addElement('select', 'hiddensections', get_string('hiddensections'), $choices);
|
||||||
$mform->setHelpButton('hiddensections', array('coursehiddensections', get_string('hiddensections')), true);
|
$mform->setHelpButton('hiddensections', array('coursehiddensections', get_string('hiddensections')), true);
|
||||||
$mform->setDefault('hiddensections', 0);
|
$mform->setDefault('hiddensections', $CFG->course_hiddensections);
|
||||||
|
|
||||||
$options = range(0, 10);
|
$options = range(0, 10);
|
||||||
$mform->addElement('select', 'newsitems', get_string('newsitemsnumber'), $options);
|
$mform->addElement('select', 'newsitems', get_string('newsitemsnumber'), $options);
|
||||||
$mform->setHelpButton('newsitems', array('coursenewsitems', get_string('newsitemsnumber')), true);
|
$mform->setHelpButton('newsitems', array('coursenewsitems', get_string('newsitemsnumber')), true);
|
||||||
$mform->setDefault('newsitems', 5);
|
$mform->setDefault('newsitems', $CFG->course_newsitems);
|
||||||
|
|
||||||
$mform->addElement('selectyesno', 'showgrades', get_string('showgrades'));
|
$mform->addElement('selectyesno', 'showgrades', get_string('showgrades'));
|
||||||
$mform->setHelpButton('showgrades', array('coursegrades', get_string('grades')), true);
|
$mform->setHelpButton('showgrades', array('coursegrades', get_string('grades')), true);
|
||||||
$mform->setDefault('showgrades', 1);
|
$mform->setDefault('showgrades', $CFG->course_showgrades);
|
||||||
|
|
||||||
$mform->addElement('selectyesno', 'showreports', get_string('showreports'));
|
$mform->addElement('selectyesno', 'showreports', get_string('showreports'));
|
||||||
$mform->setHelpButton('showreports', array('coursereports', get_string('activityreport')), true);
|
$mform->setHelpButton('showreports', array('coursereports', get_string('activityreport')), true);
|
||||||
$mform->setDefault('showreports', 0);
|
$mform->setDefault('showreports', $CFG->course_showreports);
|
||||||
|
|
||||||
$choices = get_max_upload_sizes($CFG->maxbytes);
|
$choices = get_max_upload_sizes($CFG->maxbytes);
|
||||||
$mform->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
|
$mform->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
|
||||||
$mform->setHelpButton('maxbytes', array('courseuploadsize', get_string('maximumupload')), true);
|
$mform->setHelpButton('maxbytes', array('courseuploadsize', get_string('maximumupload')), true);
|
||||||
|
$mform->setDefault('maxbytes', $CFG->course_maxbytes);
|
||||||
|
|
||||||
if (!empty($CFG->allowcoursethemes)) {
|
if (!empty($CFG->allowcoursethemes)) {
|
||||||
$themes=array();
|
$themes=array();
|
||||||
|
@ -162,7 +163,7 @@ class course_edit_form extends moodleform {
|
||||||
if ($disable_meta === false) {
|
if ($disable_meta === false) {
|
||||||
$mform->addElement('select', 'metacourse', get_string('managemeta'), $meta);
|
$mform->addElement('select', 'metacourse', get_string('managemeta'), $meta);
|
||||||
$mform->setHelpButton('metacourse', array('metacourse', get_string('metacourse')), true);
|
$mform->setHelpButton('metacourse', array('metacourse', get_string('metacourse')), true);
|
||||||
$mform->setDefault('metacourse', 0);
|
$mform->setDefault('metacourse', $CFG->course_metacourse);
|
||||||
} else {
|
} else {
|
||||||
// no metacourse element - we do not want to change it anyway!
|
// no metacourse element - we do not want to change it anyway!
|
||||||
$mform->addElement('static', 'nometacourse', get_string('managemeta'),
|
$mform->addElement('static', 'nometacourse', get_string('managemeta'),
|
||||||
|
@ -187,6 +188,7 @@ class course_edit_form extends moodleform {
|
||||||
$choices = array_merge(array('' => get_string('sitedefault').' ('.get_string('enrolname', "enrol_$CFG->enrol").')'), $choices);
|
$choices = array_merge(array('' => get_string('sitedefault').' ('.get_string('enrolname', "enrol_$CFG->enrol").')'), $choices);
|
||||||
$mform->addElement('select', 'enrol', get_string('enrolmentplugins'), $choices);
|
$mform->addElement('select', 'enrol', get_string('enrolmentplugins'), $choices);
|
||||||
$mform->setHelpButton('enrol', array('courseenrolmentplugins', get_string('enrolmentplugins')), true);
|
$mform->setHelpButton('enrol', array('courseenrolmentplugins', get_string('enrolmentplugins')), true);
|
||||||
|
$mform->setDefault('enrol', $CFG->course_enrol);
|
||||||
|
|
||||||
|
|
||||||
$roles = get_assignable_roles($context);
|
$roles = get_assignable_roles($context);
|
||||||
|
@ -219,7 +221,7 @@ class course_edit_form extends moodleform {
|
||||||
$radio[] = &MoodleQuickForm::createElement('radio', 'enrollable', null, get_string('enroldate'), 2);
|
$radio[] = &MoodleQuickForm::createElement('radio', 'enrollable', null, get_string('enroldate'), 2);
|
||||||
$mform->addGroup($radio, 'enrollable', get_string('enrollable'), ' ', false);
|
$mform->addGroup($radio, 'enrollable', get_string('enrollable'), ' ', false);
|
||||||
$mform->setHelpButton('enrollable', array('courseenrollable2', get_string('enrollable')), true);
|
$mform->setHelpButton('enrollable', array('courseenrollable2', get_string('enrollable')), true);
|
||||||
$mform->setDefault('enrollable', 1);
|
$mform->setDefault('enrollable', $CFG->course_enrollable);
|
||||||
|
|
||||||
$enroldatestartgrp = array();
|
$enroldatestartgrp = array();
|
||||||
$enroldatestartgrp[] = &MoodleQuickForm::createElement('date_selector', 'enrolstartdate');
|
$enroldatestartgrp[] = &MoodleQuickForm::createElement('date_selector', 'enrolstartdate');
|
||||||
|
@ -244,7 +246,7 @@ class course_edit_form extends moodleform {
|
||||||
$periodmenu[$seconds] = get_string('numdays', '', $i);
|
$periodmenu[$seconds] = get_string('numdays', '', $i);
|
||||||
}
|
}
|
||||||
$mform->addElement('select', 'enrolperiod', get_string('enrolperiod'), $periodmenu);
|
$mform->addElement('select', 'enrolperiod', get_string('enrolperiod'), $periodmenu);
|
||||||
$mform->setDefault('enrolperiod', 0);
|
$mform->setDefault('enrolperiod', $CFG->course_enrolperiod);
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
@ -255,11 +257,11 @@ class course_edit_form extends moodleform {
|
||||||
$choices['1'] = get_string('yes');
|
$choices['1'] = get_string('yes');
|
||||||
$mform->addElement('select', 'expirynotify', get_string('notify'), $choices);
|
$mform->addElement('select', 'expirynotify', get_string('notify'), $choices);
|
||||||
$mform->setHelpButton('expirynotify', array('expirynotify', get_string('expirynotify')), true);
|
$mform->setHelpButton('expirynotify', array('expirynotify', get_string('expirynotify')), true);
|
||||||
$mform->setDefault('expirynotify', 0);
|
$mform->setDefault('expirynotify', $CFG->course_expirynotify);
|
||||||
|
|
||||||
$mform->addElement('select', 'notifystudents', get_string('expirynotifystudents'), $choices);
|
$mform->addElement('select', 'notifystudents', get_string('expirynotifystudents'), $choices);
|
||||||
$mform->setHelpButton('notifystudents', array('expirynotifystudents', get_string('expirynotifystudents')), true);
|
$mform->setHelpButton('notifystudents', array('expirynotifystudents', get_string('expirynotifystudents')), true);
|
||||||
$mform->setDefault('notifystudents', 0);
|
$mform->setDefault('notifystudents', $CFG->course_notifystudents);
|
||||||
|
|
||||||
$thresholdmenu=array();
|
$thresholdmenu=array();
|
||||||
for ($i=1; $i<=30; $i++) {
|
for ($i=1; $i<=30; $i++) {
|
||||||
|
@ -268,7 +270,7 @@ class course_edit_form extends moodleform {
|
||||||
}
|
}
|
||||||
$mform->addElement('select', 'expirythreshold', get_string('expirythreshold'), $thresholdmenu);
|
$mform->addElement('select', 'expirythreshold', get_string('expirythreshold'), $thresholdmenu);
|
||||||
$mform->setHelpButton('expirythreshold', array('expirythreshold', get_string('expirythreshold')), true);
|
$mform->setHelpButton('expirythreshold', array('expirythreshold', get_string('expirythreshold')), true);
|
||||||
$mform->setDefault('expirythreshold', 10 * 86400);
|
$mform->setDefault('expirythreshold', $CFG->course_expirythreshold);
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
$mform->addElement('header','', get_string('groups', 'group'));
|
$mform->addElement('header','', get_string('groups', 'group'));
|
||||||
|
@ -279,14 +281,14 @@ class course_edit_form extends moodleform {
|
||||||
$choices[VISIBLEGROUPS] = get_string('groupsvisible', 'group');
|
$choices[VISIBLEGROUPS] = get_string('groupsvisible', 'group');
|
||||||
$mform->addElement('select', 'groupmode', get_string('groupmode'), $choices);
|
$mform->addElement('select', 'groupmode', get_string('groupmode'), $choices);
|
||||||
$mform->setHelpButton('groupmode', array('groupmode', get_string('groupmode')), true);
|
$mform->setHelpButton('groupmode', array('groupmode', get_string('groupmode')), true);
|
||||||
$mform->setDefault('groupmode', 0);
|
$mform->setDefault('groupmode', $CFG->course_groupmode);
|
||||||
|
|
||||||
$choices = array();
|
$choices = array();
|
||||||
$choices['0'] = get_string('no');
|
$choices['0'] = get_string('no');
|
||||||
$choices['1'] = get_string('yes');
|
$choices['1'] = get_string('yes');
|
||||||
$mform->addElement('select', 'groupmodeforce', get_string('force'), $choices);
|
$mform->addElement('select', 'groupmodeforce', get_string('force'), $choices);
|
||||||
$mform->setHelpButton('groupmodeforce', array('groupmodeforce', get_string('groupmodeforce')), true);
|
$mform->setHelpButton('groupmodeforce', array('groupmodeforce', get_string('groupmodeforce')), true);
|
||||||
$mform->setDefault('groupmodeforce', 0);
|
$mform->setDefault('groupmodeforce', $CFG->course_groupmodeforce);
|
||||||
|
|
||||||
if (!empty($CFG->enablegroupings)) {
|
if (!empty($CFG->enablegroupings)) {
|
||||||
//default groupings selector
|
//default groupings selector
|
||||||
|
@ -303,11 +305,12 @@ class course_edit_form extends moodleform {
|
||||||
$choices['1'] = get_string('courseavailable');
|
$choices['1'] = get_string('courseavailable');
|
||||||
$mform->addElement('select', 'visible', get_string('availability'), $choices);
|
$mform->addElement('select', 'visible', get_string('availability'), $choices);
|
||||||
$mform->setHelpButton('visible', array('courseavailability', get_string('availability')), true);
|
$mform->setHelpButton('visible', array('courseavailability', get_string('availability')), true);
|
||||||
$mform->setDefault('visible', 1);
|
$mform->setDefault('visible', $CFG->course_visible);
|
||||||
|
|
||||||
$mform->addElement('passwordunmask', 'enrolpassword', get_string('enrolmentkey'), 'size="25"');
|
$mform->addElement('passwordunmask', 'enrolpassword', get_string('enrolmentkey'), 'size="25"');
|
||||||
$mform->setHelpButton('enrolpassword', array('enrolmentkey', get_string('enrolmentkey')), true);
|
$mform->setHelpButton('enrolpassword', array('enrolmentkey', get_string('enrolmentkey')), true);
|
||||||
$mform->setDefault('enrolpassword', '');
|
$mform->setDefault('enrolpassword', '');
|
||||||
|
$mform->setDefault('enrolpassword', $CFG->course_enrolpassword);
|
||||||
$mform->setType('enrolpassword', PARAM_RAW);
|
$mform->setType('enrolpassword', PARAM_RAW);
|
||||||
|
|
||||||
$choices = array();
|
$choices = array();
|
||||||
|
@ -316,7 +319,7 @@ class course_edit_form extends moodleform {
|
||||||
$choices['2'] = get_string('guestskey');
|
$choices['2'] = get_string('guestskey');
|
||||||
$mform->addElement('select', 'guest', get_string('opentoguests'), $choices);
|
$mform->addElement('select', 'guest', get_string('opentoguests'), $choices);
|
||||||
$mform->setHelpButton('guest', array('guestaccess', get_string('opentoguests')), true);
|
$mform->setHelpButton('guest', array('guestaccess', get_string('opentoguests')), true);
|
||||||
$mform->setDefault('guest', 0);
|
$mform->setDefault('guest', $CFG->course_guest);
|
||||||
|
|
||||||
// If we are creating a course, its enrol method isn't yet chosen, BUT the site has a default enrol method which we can use here
|
// If we are creating a course, its enrol method isn't yet chosen, BUT the site has a default enrol method which we can use here
|
||||||
$enrol_object = $CFG;
|
$enrol_object = $CFG;
|
||||||
|
@ -349,6 +352,7 @@ class course_edit_form extends moodleform {
|
||||||
$languages[''] = get_string('forceno');
|
$languages[''] = get_string('forceno');
|
||||||
$languages += get_list_of_languages();
|
$languages += get_list_of_languages();
|
||||||
$mform->addElement('select', 'lang', get_string('forcelanguage'), $languages);
|
$mform->addElement('select', 'lang', get_string('forcelanguage'), $languages);
|
||||||
|
$mform->setDefault('lang', $CFG->course_lang);
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
require_once($CFG->libdir.'/completionlib.php');
|
require_once($CFG->libdir.'/completionlib.php');
|
||||||
|
@ -356,7 +360,7 @@ class course_edit_form extends moodleform {
|
||||||
$mform->addElement('header','', get_string('progress','completion'));
|
$mform->addElement('header','', get_string('progress','completion'));
|
||||||
$mform->addElement('select', 'enablecompletion', get_string('completion','completion'),
|
$mform->addElement('select', 'enablecompletion', get_string('completion','completion'),
|
||||||
array(0=>get_string('completiondisabled','completion'), 1=>get_string('completionenabled','completion')));
|
array(0=>get_string('completiondisabled','completion'), 1=>get_string('completionenabled','completion')));
|
||||||
$mform->setDefault('enablecompletion',1);
|
$mform->setDefault('enablecompletion', $CFG->course_enablecompletion);
|
||||||
} else {
|
} else {
|
||||||
$mform->addElement('hidden', 'enablecompletion');
|
$mform->addElement('hidden', 'enablecompletion');
|
||||||
$mform->setDefault('enablecompletion',0);
|
$mform->setDefault('enablecompletion',0);
|
||||||
|
|
|
@ -301,6 +301,7 @@ $string['courserestore'] = 'Course restore';
|
||||||
$string['courses'] = 'Courses';
|
$string['courses'] = 'Courses';
|
||||||
$string['coursescategory'] = 'Courses in the same category';
|
$string['coursescategory'] = 'Courses in the same category';
|
||||||
$string['coursesmovedout'] = 'Courses moved out from $a';
|
$string['coursesmovedout'] = 'Courses moved out from $a';
|
||||||
|
$string['coursesettings'] = 'Course default settings';
|
||||||
$string['coursespending'] = 'Courses pending approval';
|
$string['coursespending'] = 'Courses pending approval';
|
||||||
$string['coursestaught'] = 'Courses I have taught';
|
$string['coursestaught'] = 'Courses I have taught';
|
||||||
$string['courseupdates'] = 'Course updates';
|
$string['courseupdates'] = 'Course updates';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue