MDL-34866 - Make "course display" default a site configurable option

This commit is contained in:
Rex Lorenzo
2012-08-13 16:24:12 -07:00
parent 87e9331d93
commit 79e250dbdc
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -47,6 +47,11 @@ if ($hassiteconfig
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', new lang_string('courselegacyfiles'), new lang_string('courselegacyfiles_help'), key($choices), $choices));
}
$choices = array();
$choices[0] = new lang_string('coursedisplay_single');
$choices[1] = new lang_string('coursedisplay_multi');
$temp->add(new admin_setting_configselect('moodlecourse/coursedisplay', new lang_string('coursedisplay'), new lang_string('coursedisplay_help'), 0, $choices));
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
$choices = array();
$choices[NOGROUPS] = new lang_string('groupsnone', 'group');
+1 -1
View File
@@ -124,7 +124,7 @@ class course_edit_form extends moodleform {
array(COURSE_DISPLAY_SINGLEPAGE => get_string('coursedisplay_single'),
COURSE_DISPLAY_MULTIPAGE => get_string('coursedisplay_multi')));
$mform->addHelpButton('coursedisplay', 'coursedisplay');
$mform->setDefault('coursedisplay', COURSE_DISPLAY_SINGLEPAGE);
$mform->setDefault('coursedisplay', $courseconfig->coursedisplay);
for ($i = 0; $i <= $courseconfig->maxsections; $i++) {
$sectionmenu[$i] = "$i";