This commit is contained in:
Eloy Lafuente (stronk7)
2015-12-03 11:13:07 +01:00
4 changed files with 24 additions and 10 deletions
+12 -9
View File
@@ -288,16 +288,19 @@ class course_edit_form extends moodleform {
$options[0] = get_string('none');
$mform->addElement('select', 'defaultgroupingid', get_string('defaultgrouping', 'group'), $options);
// Customizable role names in this course.
$mform->addElement('header','rolerenaming', get_string('rolerenaming'));
$mform->addHelpButton('rolerenaming', 'rolerenaming');
if ((empty($course->id) && guess_if_creator_will_have_course_capability('moodle/course:renameroles', $categorycontext))
|| (!empty($course->id) && has_capability('moodle/course:renameroles', $coursecontext))) {
// Customizable role names in this course.
$mform->addElement('header', 'rolerenaming', get_string('rolerenaming'));
$mform->addHelpButton('rolerenaming', 'rolerenaming');
if ($roles = get_all_roles()) {
$roles = role_fix_names($roles, null, ROLENAME_ORIGINAL);
$assignableroles = get_roles_for_contextlevels(CONTEXT_COURSE);
foreach ($roles as $role) {
$mform->addElement('text', 'role_'.$role->id, get_string('yourwordforx', '', $role->localname));
$mform->setType('role_'.$role->id, PARAM_TEXT);
if ($roles = get_all_roles()) {
$roles = role_fix_names($roles, null, ROLENAME_ORIGINAL);
$assignableroles = get_roles_for_contextlevels(CONTEXT_COURSE);
foreach ($roles as $role) {
$mform->addElement('text', 'role_' . $role->id, get_string('yourwordforx', '', $role->localname));
$mform->setType('role_' . $role->id, PARAM_TEXT);
}
}
}