From 587a1ea358826b0020d60670e0e5ab0a0aac792c Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 18 Nov 2008 10:33:38 +0000 Subject: [PATCH] manage roles: MDL-8313 face lift allow override/assign, add labels and tooltips to the checkboxes for usability and accessibility. --- admin/roles/allowassign.php | 8 +++++++- admin/roles/allowoverride.php | 8 +++++++- lang/en_utf8/role.php | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/admin/roles/allowassign.php b/admin/roles/allowassign.php index bb2e3b1697..d0ced251dc 100755 --- a/admin/roles/allowassign.php +++ b/admin/roles/allowassign.php @@ -99,13 +99,19 @@ /// Now the rest of the table. foreach ($roles as $fromrole) { $row = array($fromrole->localname); + $a = new stdClass; + $a->fromrole = $fromrole->localname; foreach ($roles as $targetrole) { if ($allowed[$fromrole->id][$targetrole->id]) { $checked = ' checked="checked"'; } else { $checked = ''; } - $row[] = ''; + $a->targetrole = $targetrole->localname; + $name = 's_' . $fromrole->id . '_' . $targetrole->id; + $tooltip = get_string('allowroletoassign', 'role', $a); + $row[] = '' . + ''; } $table->data[] = $row; } diff --git a/admin/roles/allowoverride.php b/admin/roles/allowoverride.php index 77b9ea5ffd..25272d650e 100755 --- a/admin/roles/allowoverride.php +++ b/admin/roles/allowoverride.php @@ -97,13 +97,19 @@ /// Now the rest of the table. foreach ($roles as $fromrole) { $row = array($fromrole->localname); + $a = new stdClass; + $a->fromrole = $fromrole->localname; foreach ($roles as $targetrole) { if ($allowed[$fromrole->id][$targetrole->id]) { $checked = ' checked="checked"'; } else { $checked = ''; } - $row[] = ''; + $a->targetrole = $targetrole->localname; + $name = 's_' . $fromrole->id . '_' . $targetrole->id; + $tooltip = get_string('allowroletooverride', 'role', $a); + $row[] = '' . + ''; } $table->data[] = $row; } diff --git a/lang/en_utf8/role.php b/lang/en_utf8/role.php index ed1c1b8c31..cde696c1ff 100644 --- a/lang/en_utf8/role.php +++ b/lang/en_utf8/role.php @@ -9,6 +9,8 @@ $string['allow'] = 'Allow'; $string['allowassign'] = 'Allow role assignments'; $string['allowed'] = 'Allowed'; $string['allowoverride'] = 'Allow role overrides'; +$string['allowroletoassign'] = 'Allow users with role $a->fromrole to assign the role $a->targetrole'; +$string['allowroletooverride'] = 'Allow users with role $a->fromrole to override the role $a->targetrole'; $string['allsiteusers'] = 'All site users'; $string['assignanotherrole'] = 'Assign another role'; $string['assignerror'] = 'Error while assigning the role $a->role to user $a->user.'; -- 2.39.5