mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
manage roles: MDL-8313 face lift allow override/assign, add labels and tooltips to the checkboxes for usability and accessibility.
This commit is contained in:
parent
ad5616a934
commit
587a1ea358
3 changed files with 16 additions and 2 deletions
|
@ -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[] = '<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;
|
||||
}
|
||||
|
|
|
@ -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[] = '<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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue