MDL-24329 reverting previous patch, it should be imo better to not should discouraged legacycoursefiles option when it is disabled site-wide

This commit is contained in:
Petr Skoda
2010-09-22 08:18:18 +00:00
parent 14f001a993
commit 532a91d431
2 changed files with 8 additions and 2 deletions
+4 -2
View File
@@ -42,8 +42,10 @@ if ($hassiteconfig
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', get_string('maximumupload'), get_string('coursehelpmaximumupload'), key($choices), $choices));
$choices = array('0'=>get_string('no'), '2'=>get_string('yes'));
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', get_string('courselegacyfiles'), get_string('courselegacyfiles_help'), key($choices), $choices));
if (!empty($CFG->legacyfilesinnewcourses)) {
$choices = array('0'=>get_string('no'), '2'=>get_string('yes'));
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', get_string('courselegacyfiles'), get_string('courselegacyfiles_help'), key($choices), $choices));
}
$temp->add(new admin_setting_heading('groups', get_string('groups', 'group'), ''));
$choices = array();
+4
View File
@@ -163,6 +163,10 @@ class course_edit_form extends moodleform {
}
$mform->addElement('select', 'legacyfiles', get_string('courselegacyfiles'), $choices);
$mform->addHelpButton('legacyfiles', 'courselegacyfiles');
if (!isset($courseconfig->legacyfiles)) {
// in case this was not initialised properly due to switching of $CFG->legacyfilesinnewcourses
$courseconfig->legacyfiles = 0;
}
$mform->setDefault('legacyfiles', $courseconfig->legacyfiles);
}