MDL-77145 enrol: Removed course shortname from unenrolme string

This commit is contained in:
David Woloszyn 2023-02-10 11:10:15 +11:00
parent 0780e87f06
commit 694b3ef878
3 changed files with 4 additions and 4 deletions

View File

@ -137,6 +137,6 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
And I press "Enrol me"
And I should see "You are enrolled in the course"
And I am on the "C1" "course" page
And I navigate to "Unenrol me from C1" in current page administration
And I navigate to "Unenrol me from this course" in current page administration
And I click on "Continue" "button" in the "Confirm" "dialogue"
Then I should see "You are unenrolled from the course \"Course 1\""

View File

@ -144,7 +144,7 @@ $string['unassignnotpermitted'] = 'You do not have permission to unassign roles
$string['unenrol'] = 'Unenrol';
$string['unenrolleduser'] = 'The user "{$a->fullname}" was unenrolled from the course';
$string['unenrolconfirm'] = 'Do you really want to unenrol "{$a->user}" (previously enrolled via "{$a->enrolinstancename}") from "{$a->course}"?';
$string['unenrolme'] = 'Unenrol me from {$a}';
$string['unenrolme'] = 'Unenrol me from this course';
$string['unenrolnotpermitted'] = 'You do not have permission to unenrol this user from the course.';
$string['unenrolroleusers'] = 'Unenrol users';
$string['uninstallmigrating'] = 'Migrating "{$a}" enrolments';

View File

@ -530,8 +530,8 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
}
$plugin = $plugins[$instance->enrol];
if ($unenrollink = $plugin->get_unenrolself_link($instance)) {
$shortname = format_string($course->shortname, true, array('context' => $coursecontext));
$coursenode->add(get_string('unenrolme', 'core_enrol', $shortname), $unenrollink, navigation_node::TYPE_SETTING, null, 'unenrolself', new pix_icon('i/user', ''));
$coursenode->add(get_string('unenrolme', 'core_enrol'), $unenrollink,
navigation_node::TYPE_SETTING, null, 'unenrolself', new pix_icon('i/user', ''));
$coursenode->get('unenrolself')->set_force_into_more_menu(true);
break;
//TODO. deal with multiple unenrol links - not likely case, but still...