Skip to content

Commit

Permalink
MDL-34778 accessibility compliance for enrol: add label tag for input…
Browse files Browse the repository at this point in the history
… text
  • Loading branch information
Rossiani Wijaya committed Sep 17, 2012
1 parent 4db3699 commit 1096423
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions enrol/authorize/locallib.php
Expand Up @@ -415,8 +415,8 @@ function authorize_print_order($orderid)
} }
$a = new stdClass; $a = new stdClass;
$a->upto = $upto; $a->upto = $upto;
$extrahtml = get_string('howmuch', 'enrol_authorize') . $extrahtml = '<label for="amount">'.get_string('howmuch', 'enrol_authorize').'</label>' .
' <input type="text" size="5" name="amount" value="'.$amount.'" /> ' . '<input id="amount" type="text" size="5" name="amount" value="'.$amount.'" /> ' .
get_string('canbecredit', 'enrol_authorize', $a) . '<br />'; get_string('canbecredit', 'enrol_authorize', $a) . '<br />';
$table->data[] = array("<b>$strs->confirm:</b>", $table->data[] = array("<b>$strs->confirm:</b>",
authorize_print_action_button($orderid, ORDER_REFUND, 0, true, $authstrs->unenrolstudent, $strs->no, $extrahtml)); authorize_print_action_button($orderid, ORDER_REFUND, 0, true, $authstrs->unenrolstudent, $strs->no, $extrahtml));
Expand Down
2 changes: 2 additions & 0 deletions enrol/ldap/lang/en/enrol_ldap.php
Expand Up @@ -93,6 +93,8 @@
$string['pluginname_desc'] = '<p>You can use an LDAP server to control your enrolments. It is assumed your LDAP tree contains groups that map to the courses, and that each of those groups/courses will have membership entries to map to students.</p><p>It is assumed that courses are defined as groups in LDAP, with each group having multiple membership fields (<em>member</em> or <em>memberUid</em>) that contain a uniqueidentification of the user.</p><p>To use LDAP enrolment, your users <strong>must</strong> to have a valid idnumber field. The LDAP groups must have that idnumber in the member fields for a user to be enrolled in the course. This will usually work well if you are already using LDAP Authentication.</p><p>Enrolments will be updated when the user logs in. You can also run a script to keep enrolments in synch. Look in <em>enrol/ldap/cli/sync.php</em>.</p><p>This plugin can also be set to automatically create new courses when new groups appear in LDAP.</p>'; $string['pluginname_desc'] = '<p>You can use an LDAP server to control your enrolments. It is assumed your LDAP tree contains groups that map to the courses, and that each of those groups/courses will have membership entries to map to students.</p><p>It is assumed that courses are defined as groups in LDAP, with each group having multiple membership fields (<em>member</em> or <em>memberUid</em>) that contain a uniqueidentification of the user.</p><p>To use LDAP enrolment, your users <strong>must</strong> to have a valid idnumber field. The LDAP groups must have that idnumber in the member fields for a user to be enrolled in the course. This will usually work well if you are already using LDAP Authentication.</p><p>Enrolments will be updated when the user logs in. You can also run a script to keep enrolments in synch. Look in <em>enrol/ldap/cli/sync.php</em>.</p><p>This plugin can also be set to automatically create new courses when new groups appear in LDAP.</p>';
$string['pluginnotenabled'] = 'Plugin not enabled!'; $string['pluginnotenabled'] = 'Plugin not enabled!';
$string['role_mapping'] = '<p>For each role that you want to assign from LDAP, you need to specify the list of contexts where the role courses\'s groups are located. Separate different contexts with \';\'.</p><p>You also need to specify the attribute your LDAP server uses to hold the members of a group. Usually \'member\' or \'memberUid\'</p>'; $string['role_mapping'] = '<p>For each role that you want to assign from LDAP, you need to specify the list of contexts where the role courses\'s groups are located. Separate different contexts with \';\'.</p><p>You also need to specify the attribute your LDAP server uses to hold the members of a group. Usually \'member\' or \'memberUid\'</p>';
$string['role_mapping_attribute'] = 'LDAP member attribute for {$a}';
$string['role_mapping_context'] = 'LDAP contexts for {$a}';
$string['role_mapping_key'] = 'Map roles from LDAP '; $string['role_mapping_key'] = 'Map roles from LDAP ';
$string['roles'] = 'Role mapping'; $string['roles'] = 'Role mapping';
$string['server_settings'] = 'LDAP server settings'; $string['server_settings'] = 'LDAP server settings';
Expand Down
6 changes: 4 additions & 2 deletions enrol/ldap/settingslib.php
Expand Up @@ -151,7 +151,8 @@ public function output_html($data, $query='') {
foreach ($data as $role) { foreach ($data as $role) {
$contextid = $this->get_id().'['.$role['id'].'][contexts]'; $contextid = $this->get_id().'['.$role['id'].'][contexts]';
$contextname = $this->get_full_name().'['.$role['id'].'][contexts]'; $contextname = $this->get_full_name().'['.$role['id'].'][contexts]';
$return .= '<div style="height: 2em;"><input type="text" size="40" id="'.$contextid.'" name="'.$contextname.'" value="'.s($role['contexts']).'"/></div>'; $return .= '<div style="height: 2em;"><label class="accesshide" for="'.$contextid.'">'.get_string('role_mapping_context', 'enrol_ldap', $role['name']).'</label>';
$return .= '<input type="text" size="40" id="'.$contextid.'" name="'.$contextname.'" value="'.s($role['contexts']).'"/></div>';
} }
$return .= '</div>'; $return .= '</div>';


Expand All @@ -160,7 +161,8 @@ public function output_html($data, $query='') {
foreach ($data as $role) { foreach ($data as $role) {
$memberattrid = $this->get_id().'['.$role['id'].'][memberattribute]'; $memberattrid = $this->get_id().'['.$role['id'].'][memberattribute]';
$memberattrname = $this->get_full_name().'['.$role['id'].'][memberattribute]'; $memberattrname = $this->get_full_name().'['.$role['id'].'][memberattribute]';
$return .= '<div style="height: 2em;"><input type="text" size="15" id="'.$memberattrid.'" name="'.$memberattrname.'" value="'.s($role['memberattribute']).'"/></div>'; $return .= '<div style="height: 2em;"><label class="accesshide" for="'.$memberattrid.'">'.get_string('role_mapping_attribute', 'enrol_ldap', $role['name']).'</label>';
$return .= '<input type="text" size="15" id="'.$memberattrid.'" name="'.$memberattrname.'" value="'.s($role['memberattribute']).'"/></div>';
} }
$return .= '</div>'; $return .= '</div>';
$return .= '<div style="clear:both;"></div>'; $return .= '<div style="clear:both;"></div>';
Expand Down

0 comments on commit 1096423

Please sign in to comment.