Merge branch 'MDL-38415-master' of git://github.com/FMCorz/moodle
This commit is contained in:
+67
-38
@@ -11,30 +11,77 @@ if ($hassiteconfig
|
||||
$ADMIN->add('courses', new admin_externalpage('coursemgmt', new lang_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/manage.php',
|
||||
array('moodle/category:manage', 'moodle/course:create')));
|
||||
|
||||
/// Course Default Settings Page
|
||||
/// NOTE: these settings must be applied after all other settings because they depend on them
|
||||
///main course settings
|
||||
// Course Default Settings Page.
|
||||
// NOTE: these settings must be applied after all other settings because they depend on them.
|
||||
|
||||
|
||||
// Main course settings.
|
||||
$temp = new admin_settingpage('coursesettings', new lang_string('coursesettings'));
|
||||
require_once($CFG->dirroot.'/course/lib.php');
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('hide');
|
||||
$choices['1'] = new lang_string('show');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/visible', new lang_string('visible'), new lang_string('visible_help'),
|
||||
1, $choices));
|
||||
|
||||
|
||||
// Course format.
|
||||
$temp->add(new admin_setting_heading('courseformathdr', new lang_string('type_format', 'plugin'), ''));
|
||||
|
||||
$courseformats = get_sorted_course_formats(true);
|
||||
$formcourseformats = array();
|
||||
foreach ($courseformats as $courseformat) {
|
||||
$formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'), 'weeks',$formcourseformats));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'),
|
||||
'weeks',$formcourseformats));
|
||||
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'), new lang_string('maxnumberweeks_desc'), 52));
|
||||
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'),
|
||||
new lang_string('maxnumberweeks_desc'), 52));
|
||||
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'), new lang_string('coursehelpnumberweeks'), 10));
|
||||
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'),
|
||||
new lang_string('coursehelpnumberweeks'), 10));
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('hiddensectionscollapsed');
|
||||
$choices['1'] = new lang_string('hiddensectionsinvisible');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', new lang_string('hiddensections'), new lang_string('coursehelphiddensections'), 0,$choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/hiddensections', new lang_string('hiddensections'),
|
||||
new lang_string('coursehelphiddensections'), 0, $choices));
|
||||
|
||||
$choices = array();
|
||||
$choices[COURSE_DISPLAY_SINGLEPAGE] = new lang_string('coursedisplay_single');
|
||||
$choices[COURSE_DISPLAY_MULTIPAGE] = new lang_string('coursedisplay_multi');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/coursedisplay', new lang_string('coursedisplay'),
|
||||
new lang_string('coursedisplay_help'), COURSE_DISPLAY_SINGLEPAGE, $choices));
|
||||
|
||||
|
||||
// Appearance.
|
||||
$temp->add(new admin_setting_heading('appearancehdr', new lang_string('appearance'), ''));
|
||||
|
||||
$languages = array();
|
||||
$languages[''] = new lang_string('forceno');
|
||||
$languages += get_string_manager()->get_list_of_translations();
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/lang', new lang_string('forcelanguage'), '', key($languages),
|
||||
$languages));
|
||||
|
||||
$options = range(0, 10);
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/newsitems', new lang_string('newsitemsnumber'), new lang_string('coursehelpnewsitemsnumber'), 5,$options));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', new lang_string('showgrades'), new lang_string('coursehelpshowgrades'), 1,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/newsitems', new lang_string('newsitemsnumber'),
|
||||
new lang_string('coursehelpnewsitemsnumber'), 5, $options));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showgrades', new lang_string('showgrades'),
|
||||
new lang_string('coursehelpshowgrades'), 1, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0,
|
||||
array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
|
||||
|
||||
// Files and uploads.
|
||||
$temp->add(new admin_setting_heading('filesanduploadshdr', new lang_string('filesanduploads'), ''));
|
||||
|
||||
if (!empty($CFG->legacyfilesinnewcourses)) {
|
||||
$choices = array('0'=>new lang_string('no'), '2'=>new lang_string('yes'));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', new lang_string('courselegacyfiles'),
|
||||
new lang_string('courselegacyfiles_help'), key($choices), $choices));
|
||||
}
|
||||
|
||||
$currentmaxbytes = get_config('moodlecourse', 'maxbytes');
|
||||
if (isset($CFG->maxbytes)) {
|
||||
@@ -42,18 +89,17 @@ if ($hassiteconfig
|
||||
} else {
|
||||
$choices = get_max_upload_sizes(0, 0, 0, $currentmaxbytes);
|
||||
}
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', new lang_string('maximumupload'), new lang_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/maxbytes', new lang_string('maximumupload'),
|
||||
new lang_string('coursehelpmaximumupload'), key($choices), $choices));
|
||||
|
||||
if (!empty($CFG->legacyfilesinnewcourses)) {
|
||||
$choices = array('0'=>new lang_string('no'), '2'=>new lang_string('yes'));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/legacyfiles', new lang_string('courselegacyfiles'), new lang_string('courselegacyfiles_help'), key($choices), $choices));
|
||||
}
|
||||
|
||||
$choices = array();
|
||||
$choices[COURSE_DISPLAY_SINGLEPAGE] = new lang_string('coursedisplay_single');
|
||||
$choices[COURSE_DISPLAY_MULTIPAGE] = new lang_string('coursedisplay_multi');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/coursedisplay', new lang_string('coursedisplay'), new lang_string('coursedisplay_help'), COURSE_DISPLAY_SINGLEPAGE, $choices));
|
||||
// Completion tracking.
|
||||
$temp->add(new admin_setting_heading('progress', new lang_string('completion','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion', 'completion'),
|
||||
new lang_string('enablecompletion_help', 'completion'), 0, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
|
||||
|
||||
|
||||
// Groups.
|
||||
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
|
||||
$choices = array();
|
||||
$choices[NOGROUPS] = new lang_string('groupsnone', 'group');
|
||||
@@ -62,27 +108,10 @@ if ($hassiteconfig
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/groupmode', new lang_string('groupmode'), '', key($choices),$choices));
|
||||
$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'))));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_heading('availability', new lang_string('availability'), ''));
|
||||
$choices = array();
|
||||
$choices['0'] = new lang_string('courseavailablenot');
|
||||
$choices['1'] = new lang_string('courseavailable');
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/visible', new lang_string('visible'), '', 1,$choices));
|
||||
|
||||
|
||||
$temp->add(new admin_setting_heading('language', new lang_string('language'), ''));
|
||||
$languages=array();
|
||||
$languages[''] = new lang_string('forceno');
|
||||
$languages += get_string_manager()->get_list_of_translations();
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/lang', new lang_string('forcelanguage'), '',key($languages),$languages));
|
||||
|
||||
$temp->add(new admin_setting_heading('progress', new lang_string('progress','completion'), ''));
|
||||
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion','completion'), '',
|
||||
0, array(0 => new lang_string('completiondisabled','completion'), 1 => new lang_string('completionenabled','completion'))));
|
||||
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
/// "courserequests" settingpage
|
||||
|
||||
// "courserequests" settingpage.
|
||||
$temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablecourserequests', new lang_string('enablecourserequests', 'admin'), new lang_string('configenablecourserequests', 'admin'), 0));
|
||||
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory', new lang_string('defaultrequestcategory', 'admin'), new lang_string('configdefaultrequestcategory', 'admin'), 1));
|
||||
|
||||
+103
-100
@@ -46,35 +46,6 @@ class course_edit_form extends moodleform {
|
||||
$mform->setType('returnto', PARAM_ALPHANUM);
|
||||
$mform->setConstant('returnto', $returnto);
|
||||
|
||||
// verify permissions to change course category or keep current
|
||||
if (empty($course->id)) {
|
||||
if (has_capability('moodle/course:create', $categorycontext)) {
|
||||
$displaylist = coursecat::make_categories_list('moodle/course:create');
|
||||
$mform->addElement('select', 'category', get_string('category'), $displaylist);
|
||||
$mform->addHelpButton('category', 'category');
|
||||
$mform->setDefault('category', $category->id);
|
||||
} else {
|
||||
$mform->addElement('hidden', 'category', null);
|
||||
$mform->setType('category', PARAM_INT);
|
||||
$mform->setConstant('category', $category->id);
|
||||
}
|
||||
} else {
|
||||
if (has_capability('moodle/course:changecategory', $coursecontext)) {
|
||||
$displaylist = coursecat::make_categories_list('moodle/course:create');
|
||||
if (!isset($displaylist[$course->category])) {
|
||||
//always keep current
|
||||
$displaylist[$course->category] = coursecat::get($course->category)->get_formatted_name();
|
||||
}
|
||||
$mform->addElement('select', 'category', get_string('category'), $displaylist);
|
||||
$mform->addHelpButton('category', 'category');
|
||||
} else {
|
||||
//keep current
|
||||
$mform->addElement('hidden', 'category', null);
|
||||
$mform->setType('category', PARAM_INT);
|
||||
$mform->setConstant('category', $course->category);
|
||||
}
|
||||
}
|
||||
|
||||
$mform->addElement('text','fullname', get_string('fullnamecourse'),'maxlength="254" size="50"');
|
||||
$mform->addHelpButton('fullname', 'fullnamecourse');
|
||||
$mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client');
|
||||
@@ -93,6 +64,54 @@ class course_edit_form extends moodleform {
|
||||
$mform->setConstant('shortname', $course->shortname);
|
||||
}
|
||||
|
||||
// Verify permissions to change course category or keep current.
|
||||
if (empty($course->id)) {
|
||||
if (has_capability('moodle/course:create', $categorycontext)) {
|
||||
$displaylist = coursecat::make_categories_list('moodle/course:create');
|
||||
$mform->addElement('select', 'category', get_string('coursecategory'), $displaylist);
|
||||
$mform->addHelpButton('category', 'coursecategory');
|
||||
$mform->setDefault('category', $category->id);
|
||||
} else {
|
||||
$mform->addElement('hidden', 'category', null);
|
||||
$mform->setType('category', PARAM_INT);
|
||||
$mform->setConstant('category', $category->id);
|
||||
}
|
||||
} else {
|
||||
if (has_capability('moodle/course:changecategory', $coursecontext)) {
|
||||
$displaylist = coursecat::make_categories_list('moodle/course:create');
|
||||
if (!isset($displaylist[$course->category])) {
|
||||
//always keep current
|
||||
$displaylist[$course->category] = coursecat::get($course->category)->get_formatted_name();
|
||||
}
|
||||
$mform->addElement('select', 'category', get_string('coursecategory'), $displaylist);
|
||||
$mform->addHelpButton('category', 'coursecategory');
|
||||
} else {
|
||||
//keep current
|
||||
$mform->addElement('hidden', 'category', null);
|
||||
$mform->setType('category', PARAM_INT);
|
||||
$mform->setConstant('category', $course->category);
|
||||
}
|
||||
}
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = get_string('hide');
|
||||
$choices['1'] = get_string('show');
|
||||
$mform->addElement('select', 'visible', get_string('visible'), $choices);
|
||||
$mform->addHelpButton('visible', 'visible');
|
||||
$mform->setDefault('visible', $courseconfig->visible);
|
||||
if (!has_capability('moodle/course:visibility', $context)) {
|
||||
$mform->hardFreeze('visible');
|
||||
if (!empty($course->id)) {
|
||||
$mform->setConstant('visible', $course->visible);
|
||||
} else {
|
||||
$mform->setConstant('visible', $courseconfig->visible);
|
||||
}
|
||||
}
|
||||
|
||||
$mform->addElement('date_selector', 'startdate', get_string('startdate'));
|
||||
$mform->addHelpButton('startdate', 'startdate');
|
||||
$mform->setDefault('startdate', time() + 3600 * 24);
|
||||
|
||||
$mform->addElement('text','idnumber', get_string('idnumbercourse'),'maxlength="100" size="10"');
|
||||
$mform->addHelpButton('idnumber', 'idnumbercourse');
|
||||
$mform->setType('idnumber', PARAM_RAW);
|
||||
@@ -101,6 +120,9 @@ class course_edit_form extends moodleform {
|
||||
$mform->setConstants('idnumber', $course->idnumber);
|
||||
}
|
||||
|
||||
// Description.
|
||||
$mform->addElement('header', 'descriptionhdr', get_string('description'));
|
||||
$mform->setExpanded('descriptionhdr');
|
||||
|
||||
$mform->addElement('editor','summary_editor', get_string('coursesummary'), null, $editoroptions);
|
||||
$mform->addHelpButton('summary_editor', 'coursesummary');
|
||||
@@ -114,9 +136,14 @@ class course_edit_form extends moodleform {
|
||||
}
|
||||
|
||||
if (!empty($course->id) and !has_capability('moodle/course:changesummary', $coursecontext)) {
|
||||
// Remove the description header it does not contain anything any more.
|
||||
$mform->removeElement('descriptionhdr');
|
||||
$mform->hardFreeze($summaryfields);
|
||||
}
|
||||
|
||||
// Course format.
|
||||
$mform->addElement('header', 'courseformathdr', get_string('type_format', 'plugin'));
|
||||
|
||||
$courseformats = get_sorted_course_formats(true);
|
||||
$formcourseformats = array();
|
||||
foreach ($courseformats as $courseformat) {
|
||||
@@ -135,13 +162,34 @@ class course_edit_form extends moodleform {
|
||||
$mform->addHelpButton('format', 'format');
|
||||
$mform->setDefault('format', $courseconfig->format);
|
||||
|
||||
// button to update format-specific options on format change (will be hidden by JavaScript)
|
||||
// Button to update format-specific options on format change (will be hidden by JavaScript).
|
||||
$mform->registerNoSubmitButton('updatecourseformat');
|
||||
$mform->addElement('submit', 'updatecourseformat', get_string('courseformatudpate'));
|
||||
|
||||
$mform->addElement('date_selector', 'startdate', get_string('startdate'));
|
||||
$mform->addHelpButton('startdate', 'startdate');
|
||||
$mform->setDefault('startdate', time() + 3600 * 24);
|
||||
// Just a placeholder for the course format options.
|
||||
$mform->addElement('hidden', 'addcourseformatoptionshere');
|
||||
$mform->setType('addcourseformatoptionshere', PARAM_BOOL);
|
||||
|
||||
// Appearance.
|
||||
$mform->addElement('header', 'appearancehdr', get_string('appearance'));
|
||||
|
||||
if (!empty($CFG->allowcoursethemes)) {
|
||||
$themeobjects = get_list_of_themes();
|
||||
$themes=array();
|
||||
$themes[''] = get_string('forceno');
|
||||
foreach ($themeobjects as $key=>$theme) {
|
||||
if (empty($theme->hidefromselector)) {
|
||||
$themes[$key] = get_string('pluginname', 'theme_'.$theme->name);
|
||||
}
|
||||
}
|
||||
$mform->addElement('select', 'theme', get_string('forcetheme'), $themes);
|
||||
}
|
||||
|
||||
$languages=array();
|
||||
$languages[''] = get_string('forceno');
|
||||
$languages += get_string_manager()->get_list_of_translations();
|
||||
$mform->addElement('select', 'lang', get_string('forcelanguage'), $languages);
|
||||
$mform->setDefault('lang', $courseconfig->lang);
|
||||
|
||||
$options = range(0, 10);
|
||||
$mform->addElement('select', 'newsitems', get_string('newsitemsnumber'), $options);
|
||||
@@ -156,14 +204,8 @@ class course_edit_form extends moodleform {
|
||||
$mform->addHelpButton('showreports', 'showreports');
|
||||
$mform->setDefault('showreports', $courseconfig->showreports);
|
||||
|
||||
// Handle non-existing $course->maxbytes on course creation.
|
||||
$coursemaxbytes = !isset($course->maxbytes) ? null : $course->maxbytes;
|
||||
|
||||
// Let's prepare the maxbytes popup.
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $coursemaxbytes);
|
||||
$mform->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
|
||||
$mform->addHelpButton('maxbytes', 'maximumupload');
|
||||
$mform->setDefault('maxbytes', $courseconfig->maxbytes);
|
||||
// Files and uploads.
|
||||
$mform->addElement('header', 'filehdr', get_string('filesanduploads'));
|
||||
|
||||
if (!empty($course->legacyfiles) or !empty($CFG->legacyfilesinnewcourses)) {
|
||||
if (empty($course->legacyfiles)) {
|
||||
@@ -181,22 +223,26 @@ class course_edit_form extends moodleform {
|
||||
$mform->setDefault('legacyfiles', $courseconfig->legacyfiles);
|
||||
}
|
||||
|
||||
if (!empty($CFG->allowcoursethemes)) {
|
||||
$themeobjects = get_list_of_themes();
|
||||
$themes=array();
|
||||
$themes[''] = get_string('forceno');
|
||||
foreach ($themeobjects as $key=>$theme) {
|
||||
if (empty($theme->hidefromselector)) {
|
||||
$themes[$key] = get_string('pluginname', 'theme_'.$theme->name);
|
||||
}
|
||||
}
|
||||
$mform->addElement('select', 'theme', get_string('forcetheme'), $themes);
|
||||
}
|
||||
// Handle non-existing $course->maxbytes on course creation.
|
||||
$coursemaxbytes = !isset($course->maxbytes) ? null : $course->maxbytes;
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// Just a placeholder..
|
||||
$mform->addElement('hidden', 'addcourseformatoptionshere');
|
||||
$mform->setType('addcourseformatoptionshere', PARAM_BOOL);
|
||||
// Let's prepare the maxbytes popup.
|
||||
$choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $coursemaxbytes);
|
||||
$mform->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
|
||||
$mform->addHelpButton('maxbytes', 'maximumupload');
|
||||
$mform->setDefault('maxbytes', $courseconfig->maxbytes);
|
||||
|
||||
// Completion tracking.
|
||||
if (completion_info::is_enabled_for_site()) {
|
||||
$mform->addElement('header', 'completionhdr', get_string('completion', 'completion'));
|
||||
$mform->addElement('selectyesno', 'enablecompletion', get_string('enablecompletion', 'completion'));
|
||||
$mform->setDefault('enablecompletion', $courseconfig->enablecompletion);
|
||||
$mform->addHelpButton('enablecompletion', 'enablecompletion', 'completion');
|
||||
} else {
|
||||
$mform->addElement('hidden', 'enablecompletion');
|
||||
$mform->setType('enablecompletion', PARAM_INT);
|
||||
$mform->setDefault('enablecompletion', 0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
enrol_course_edit_form($mform, $course, $context);
|
||||
@@ -212,10 +258,7 @@ class course_edit_form extends moodleform {
|
||||
$mform->addHelpButton('groupmode', 'groupmode', 'group');
|
||||
$mform->setDefault('groupmode', $courseconfig->groupmode);
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = get_string('no');
|
||||
$choices['1'] = get_string('yes');
|
||||
$mform->addElement('select', 'groupmodeforce', get_string('groupmodeforce', 'group'), $choices);
|
||||
$mform->addElement('selectyesno', 'groupmodeforce', get_string('groupmodeforce', 'group'));
|
||||
$mform->addHelpButton('groupmodeforce', 'groupmodeforce', 'group');
|
||||
$mform->setDefault('groupmodeforce', $courseconfig->groupmodeforce);
|
||||
|
||||
@@ -225,43 +268,6 @@ class course_edit_form extends moodleform {
|
||||
$mform->addElement('select', 'defaultgroupingid', get_string('defaultgrouping', 'group'), $options);
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
$mform->addElement('header','availability', get_string('availability'));
|
||||
|
||||
$choices = array();
|
||||
$choices['0'] = get_string('courseavailablenot');
|
||||
$choices['1'] = get_string('courseavailable');
|
||||
$mform->addElement('select', 'visible', get_string('availability'), $choices);
|
||||
$mform->addHelpButton('visible', 'availability');
|
||||
$mform->setDefault('visible', $courseconfig->visible);
|
||||
if (!has_capability('moodle/course:visibility', $context)) {
|
||||
$mform->hardFreeze('visible');
|
||||
if (!empty($course->id)) {
|
||||
$mform->setConstant('visible', $course->visible);
|
||||
} else {
|
||||
$mform->setConstant('visible', $courseconfig->visible);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
$mform->addElement('header','language', get_string('language'));
|
||||
|
||||
$languages=array();
|
||||
$languages[''] = get_string('forceno');
|
||||
$languages += get_string_manager()->get_list_of_translations();
|
||||
$mform->addElement('select', 'lang', get_string('forcelanguage'), $languages);
|
||||
$mform->setDefault('lang', $courseconfig->lang);
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
if (completion_info::is_enabled_for_site()) {
|
||||
$mform->addElement('header','progress', get_string('progress','completion'));
|
||||
$mform->addElement('select', 'enablecompletion', get_string('completion','completion'),
|
||||
array(0=>get_string('completiondisabled','completion'), 1=>get_string('completionenabled','completion')));
|
||||
$mform->setDefault('enablecompletion', $courseconfig->enablecompletion);
|
||||
} else {
|
||||
$mform->addElement('hidden', 'enablecompletion');
|
||||
$mform->setType('enablecompletion', PARAM_INT);
|
||||
$mform->setDefault('enablecompletion',0);
|
||||
}
|
||||
|
||||
/// customizable role names in this course
|
||||
//--------------------------------------------------------------------------------
|
||||
@@ -309,9 +315,6 @@ class course_edit_form extends moodleform {
|
||||
$formatvalue = $mform->getElementValue('format');
|
||||
if (is_array($formatvalue) && !empty($formatvalue)) {
|
||||
$courseformat = course_get_format((object)array('format' => $formatvalue[0]));
|
||||
$newel = $mform->createElement('header', 'courseformatoptions', get_string('courseformatoptions', 'moodle',
|
||||
$courseformat->get_format_name()));
|
||||
$mform->insertElementBefore($newel, 'addcourseformatoptionshere');
|
||||
|
||||
$elements = $courseformat->create_edit_form_elements($mform);
|
||||
for ($i = 0; $i < count($elements); $i++) {
|
||||
|
||||
@@ -72,6 +72,7 @@ $string['configenablecompletion'] = 'When enabled, this lets you turn on complet
|
||||
$string['csvdownload'] = 'Download in spreadsheet format (UTF-8 .csv)';
|
||||
$string['deletecompletiondata'] = 'Delete completion data';
|
||||
$string['enablecompletion'] = 'Enable completion tracking';
|
||||
$string['enablecompletion_help'] = 'Once enabled, the completion tracking settings are displayed in the completion tracking page, and in the activity settings.';
|
||||
$string['err_noactivities'] = 'Completion information is not enabled for any activity, so none can be displayed. You can enable completion information by editing the settings for an activity.';
|
||||
$string['err_nousers'] = 'There are no students on this course or group for whom completion information is displayed. (By default, completion information is displayed only for students, so if there are no students, you will see this error. Administrators can alter this option via the admin screens.)';
|
||||
$string['err_system'] = 'An internal error occurred in the completion system. (System administrators can enable debugging information to see more detail.)';
|
||||
|
||||
+7
-6
@@ -156,7 +156,6 @@ $string['autosubscribe'] = 'Forum auto-subscribe';
|
||||
$string['autosubscribeno'] = 'No: don\'t automatically subscribe me to forums';
|
||||
$string['autosubscribeyes'] = 'Yes: when I post, subscribe me to that forum';
|
||||
$string['availability'] = 'Availability';
|
||||
$string['availability_help'] = 'This setting determines whether the course appears in the list of courses. Apart from teachers and administrators, users are not allowed to enter the course.';
|
||||
$string['availablecourses'] = 'Available courses';
|
||||
$string['back'] = 'Back';
|
||||
$string['backto'] = 'Back to {$a}';
|
||||
@@ -215,7 +214,6 @@ $string['cancel'] = 'Cancel';
|
||||
$string['cancelled'] = 'Cancelled';
|
||||
$string['categories'] = 'Course categories';
|
||||
$string['category'] = 'Category';
|
||||
$string['category_help'] = 'This setting determines the category in which the course will appear in the list of courses.';
|
||||
$string['categoryadded'] = 'The category \'{$a}\' was added';
|
||||
$string['categorycontents'] = 'Subcategories and courses';
|
||||
$string['categorycurrentcontents'] = 'Contents of {$a}';
|
||||
@@ -293,6 +291,7 @@ $string['courseavailablenot'] = 'This course is not available to students';
|
||||
$string['coursebackup'] = 'Course backup';
|
||||
$string['coursecategories'] = 'Course categories';
|
||||
$string['coursecategory'] = 'Course category';
|
||||
$string['coursecategory_help'] = 'This setting determines the category in which the course will appear in the list of courses.';
|
||||
$string['coursecategorydeleted'] = 'Deleted course category {$a}';
|
||||
$string['coursecompletion'] = 'Course completion';
|
||||
$string['coursecompletions'] = 'Course completions';
|
||||
@@ -322,10 +321,10 @@ $string['coursehelpnewsitemsnumber'] = 'Number of recent items appearing on the
|
||||
$string['coursehelpnumberweeks'] = 'Number of sections in the course (applies to certain course formats only).';
|
||||
$string['coursehelpshowgrades'] = 'Enable the display of the gradebook. It does not prevent grades from being displayed within the individual activities.';
|
||||
$string['coursehidden'] = 'This course is currently unavailable to students';
|
||||
$string['courseoverviewfiles'] = 'Course overview files';
|
||||
$string['courseoverviewfilesext'] = 'Course overview files extensions';
|
||||
$string['courseoverviewfileslimit'] = 'Course overview files limit';
|
||||
$string['courseoverviewfiles_help'] = 'Course overview files (usually images) are displayed in the list of courses together with summary';
|
||||
$string['courseoverviewfiles'] = 'Course summary files';
|
||||
$string['courseoverviewfilesext'] = 'Course summary files extensions';
|
||||
$string['courseoverviewfileslimit'] = 'Course summary files limit';
|
||||
$string['courseoverviewfiles_help'] = 'Course summary files (usually images) are displayed in the list of courses together with summary';
|
||||
$string['courseinfo'] = 'Course info';
|
||||
$string['coursemessage'] = 'Message course users';
|
||||
$string['coursenotaccessible'] = 'This course does not allow public access';
|
||||
@@ -677,6 +676,7 @@ $string['fileexists'] = 'There is already a file called {$a}';
|
||||
$string['filemissing'] = '{$a} is missing';
|
||||
$string['filetoolarge'] = 'is too large to upload';
|
||||
$string['files'] = 'Files';
|
||||
$string['filesanduploads'] = 'Files and uploads';
|
||||
$string['filesfolders'] = 'Files/folders';
|
||||
$string['fileuploadwithcontent'] = 'File uploads should not include the content parameter';
|
||||
$string['filloutallfields'] = 'Please fill out all fields in this form';
|
||||
@@ -1798,6 +1798,7 @@ $string['virusfoundsubject'] = '{$a}: Virus found!';
|
||||
$string['virusfounduser'] = 'The file you have uploaded, {$a->filename}, has been scanned by a virus checker and found to be infected! Your file upload was NOT successful.';
|
||||
$string['virusplaceholder'] = 'This file that has been uploaded was found to contain a virus and has been moved or deleted and the user notified.';
|
||||
$string['visible'] = 'Visible';
|
||||
$string['visible_help'] = 'This setting determines whether the course appears in the list of courses. Apart from teachers and administrators, users are not allowed to enter the course.';
|
||||
$string['visibletostudents'] = 'Visible to {$a}';
|
||||
$string['warning'] = 'Warning';
|
||||
$string['warningdeleteresource'] = 'Warning: {$a} is referred in a resource. Would you like to update the resource?';
|
||||
|
||||
@@ -38,7 +38,7 @@ $string['sectionbackup'] = 'Section backups';
|
||||
$string['activitybackup'] = 'Activity backup';
|
||||
$string['areacategoryintro'] = 'Category introduction';
|
||||
$string['areacourseintro'] = 'Course introduction';
|
||||
$string['areacourseoverviewfiles'] = 'Course overview files';
|
||||
$string['areacourseoverviewfiles'] = 'Course summary files';
|
||||
$string['arearoot'] = 'System';
|
||||
$string['areauserdraft'] = 'Drafts';
|
||||
$string['areauserbackup'] = 'User backup';
|
||||
|
||||
Reference in New Issue
Block a user