manage roles: MDL-8313 face lift allow override/assign, add labels and tooltips to...
authortjhunt <tjhunt>
Tue, 18 Nov 2008 10:33:38 +0000 (10:33 +0000)
committertjhunt <tjhunt>
Tue, 18 Nov 2008 10:33:38 +0000 (10:33 +0000)
admin/roles/allowassign.php
admin/roles/allowoverride.php
lang/en_utf8/role.php

index bb2e3b16971698393f7f5bdfd3e03c30a6d8034f..d0ced251dc4d8f920373ed510b70eb1c2ffdb635 100755 (executable)
 /// 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;
     }
index 77b9ea5ffd574a4d05a59bb762c9b3c53a743422..25272d650eb853840abc0313846149c0d2b7b578 100755 (executable)
 /// 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;
     }
index ed1c1b8c31390a927f40b7fa8fd9af45f370f4bc..cde696c1ff6d1c8b1e3a7e2310bd35af3f4ccc08 100644 (file)
@@ -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.';