Skip to content

Commit

Permalink
MDL-64523 core_access: Improve the title of the delete role links
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed May 24, 2019
1 parent a866c5c commit 6786f6b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions admin/roles/classes/permissions_table.php
Expand Up @@ -96,7 +96,7 @@ protected function add_row_cells($capability) {
"linkclass" => "preventlink", "adminurl" => $adminurl->out(), "icon" => "", "iconalt" => "");
if (isset($overridableroles[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
$templatecontext['icon'] = 't/delete';
$templatecontext['iconalt'] = get_string('delete');
$templatecontext['iconalt'] = get_string('deletexrole', 'core_role', $name);
}
$neededroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
}
Expand All @@ -109,7 +109,7 @@ protected function add_row_cells($capability) {
"icon" => "", "iconalt" => "");
if (isset($overridableroles[$id]) and prohibit_is_removable($id, $context, $capability->name)) {
$templatecontext['icon'] = 't/delete';
$templatecontext['iconalt'] = get_string('delete');
$templatecontext['iconalt'] = get_string('deletexrole', 'core_role', $name);
}
$forbiddenroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
}
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/permissions.php
Expand Up @@ -213,7 +213,7 @@
$PAGE->requires->strings_for_js(
array('roleprohibitinfo', 'roleprohibitheader', 'roleallowinfo', 'roleallowheader',
'confirmunassigntitle', 'confirmroleunprohibit', 'confirmroleprevent', 'confirmunassignyes',
'confirmunassignno'), 'core_role');
'confirmunassignno', 'deletexrole'), 'core_role');
$PAGE->requires->js_call_amd('core/permissionmanager', 'initialize', array($arguments));
$table = new core_role_permissions_table($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles);
echo $OUTPUT->box_start('generalbox capbox');
Expand Down
2 changes: 1 addition & 1 deletion lib/amd/build/permissionmanager.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/amd/src/permissionmanager.js
Expand Up @@ -105,12 +105,14 @@ define(['jquery', 'core/config', 'core/notification', 'core/templates', 'core/yu
templatedata.linkclass = 'preventlink';
templatedata.action = 'prevent';
templatedata.icon = 't/delete';
templatedata.iconalt = M.util.get_string('deletexrole', 'core_role', overideableroles[roleid]);
break;
case 'prohibit':
templatedata.spanclass = 'forbidden';
templatedata.linkclass = 'unprohibitlink';
templatedata.action = 'unprohibit';
templatedata.icon = 't/delete';
templatedata.iconalt = M.util.get_string('deletexrole', 'core_role', overideableroles[roleid]);
break;
case 'prevent':
row.find('a[data-role-id="' + roleid + '"]').first().closest('.allowed').remove();
Expand Down

0 comments on commit 6786f6b

Please sign in to comment.