/// 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[] = '<input type="checkbox" name="s_' . $fromrole->id . '_' . $targetrole->id . '" value="1"' . $checked . ' />';
+ $a->targetrole = $targetrole->localname;
+ $name = 's_' . $fromrole->id . '_' . $targetrole->id;
+ $tooltip = get_string('allowroletoassign', 'role', $a);
+ $row[] = '<input type="checkbox" name="' . $name . '" id="' . $name . '" title="' . $tooltip . '" value="1"' . $checked . ' />' .
+ '<label for="' . $name . '" class="accesshide">' . $tooltip . '</label>';
}
$table->data[] = $row;
}
/// 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[] = '<input type="checkbox" name="s_' . $fromrole->id . '_' . $targetrole->id . '" value="1"' . $checked . ' />';
+ $a->targetrole = $targetrole->localname;
+ $name = 's_' . $fromrole->id . '_' . $targetrole->id;
+ $tooltip = get_string('allowroletooverride', 'role', $a);
+ $row[] = '<input type="checkbox" name="' . $name . '" id="' . $name . '" title="' . $tooltip . '" value="1"' . $checked . ' />' .
+ '<label for="' . $name . '" class="accesshide">' . $tooltip . '</label>';
}
$table->data[] = $row;
}
$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.';