Skip to content

Commit 0add004

Browse files
author
Rossiani Wijaya
committed
MDL-30843 and MDL-30842 - accessibility compliance: Add <label> for form input text and select tag
1 parent a7899ca commit 0add004

File tree

93 files changed

+339
-193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+339
-193
lines changed

admin/filters.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
242242

243243
// Disable/off/on
244244
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $filterinfo->active, null, 'active' . basename($filter));
245+
$select->set_label(get_accesshide(get_string('isactive', 'filters')));
245246
$row[] = $OUTPUT->render($select);
246247

247248
// Re-order
@@ -263,6 +264,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
263264

264265
// Apply to strings.
265266
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . basename($filter));
267+
$select->set_label(get_accesshide(get_string('applyto', 'filters')));
266268
$select->disabled = $filterinfo->active == TEXTFILTER_DISABLED;
267269
$row[] = $OUTPUT->render($select);
268270

admin/mnet/access_control.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,18 @@
203203
if (!empty($formerror['username'])) {
204204
echo '<span class="error"> * </span>';
205205
}
206-
echo '<input type="text" name="username" size="20" maxlength="100" />';
206+
echo html_writer::label(get_string('username'), 'menuusername', false, array('class' =>'accesshide'));
207+
echo '<input id="menuusername" type="text" name="username" size="20" maxlength="100" />';
207208

208209
// choose a remote host
209-
echo " " . get_string('remotehost', 'mnet') . ":\n";
210+
echo html_writer::label(get_string('remotehost', 'mnet'), 'menumnet_host_id');
210211
if (!empty($formerror['mnet_host_id'])) {
211212
echo '<span class="error"> * </span>';
212213
}
213214
echo html_writer::select($mnethosts, 'mnet_host_id');
214215

215216
// choose an access level
216-
echo " " . get_string('accesslevel', 'mnet') . ":\n";
217+
echo html_writer::label(get_string('accesslevel', 'mnet'), 'menuaccessctrl');
217218
if (!empty($formerror['accessctrl'])) {
218219
echo '<span class="error"> * </span>';
219220
}

admin/portfolio.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ function portfolio_action_url($portfolio) {
197197
$currentaction = 'hide';
198198
}
199199
$select = new single_select(portfolio_action_url($pluginid, 'pf'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . $pluginid);
200+
$select->set_label(get_accesshide(get_string('portfolio', 'portfolio')));
200201
$table->data[] = array($pluginname, $OUTPUT->render($select), $settings);
201202
}
202203
if (!in_array($plugin, $usedplugins)) {

admin/repository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function repository_action_url($repository) {
305305
}
306306

307307
$select = new single_select(repository_action_url($typename, 'repos'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . basename($typename));
308-
308+
$select->set_label(get_accesshide(get_string('action')));
309309
// Display up/down link
310310
$updown = '';
311311
$spacer = $OUTPUT->spacer(array('height'=>15, 'width'=>15)); // should be done with CSS instead
@@ -342,6 +342,7 @@ function repository_action_url($repository) {
342342
// Check that it has not already been listed
343343
if (!in_array($plugin, $alreadyplugins)) {
344344
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
345+
$select->set_label(get_accesshide(get_string('action')));
345346
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
346347
}
347348
}

admin/roles/lib.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,10 @@ protected function get_archetype_field($id) {
721721
foreach(get_role_archetypes() as $type) {
722722
$options[$type] = get_string('archetype'.$type, 'role');
723723
}
724-
return html_writer::select($options, 'archetype', $this->role->archetype, false);
724+
725+
$return = html_writer::label(get_string('archetype'.$type, 'role'), 'menuarchetype', false, array('class' => 'accesshide'));
726+
$return .= html_writer::select($options, 'archetype', $this->role->archetype, false);
727+
return $return;
725728
}
726729

727730
protected function get_assignable_levels_control() {

admin/timezone.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
$timezones = get_list_of_timezones();
4343

4444
echo '<center><form action="timezone.php" method="post">';
45-
echo "$strusers ($strall): ";
45+
echo html_writer::label($strusers . ' (' . $strall . '): ', 'menuzone');
4646
echo html_writer::select($timezones, "zone", $current, array('99'=>get_string("serverlocaltime")));
4747
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
4848
echo '<input type="submit" value="'.s($strsavechanges).'" />';

auth/cas/config.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
9494
</td>
9595
</tr>
9696
<tr valign="top" class="required">
97-
<td align="right"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>:</td>
97+
<td align="right"><label for="hostname"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>: </label></td>
9898
<td>
99-
<input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
99+
<input name="hostname" id="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
100100
<?php if (isset($err['hostname'])) { echo $OUTPUT->error_text($err['hostname']); } ?>
101101
</td>
102102
<td>
@@ -105,10 +105,10 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
105105
</tr>
106106
<tr valign="top" class="required">
107107
<td align="right">
108-
<?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>:
108+
<label for="baseuri"><?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>: </label>
109109
</td>
110110
<td>
111-
<input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
111+
<input name="baseuri" id="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
112112
<?php if (isset($err['baseuri'])) { echo $OUTPUT->error_text($err['baseuri']); } ?>
113113
</td>
114114
<td>
@@ -117,10 +117,10 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
117117
</tr>
118118
<tr valign="top" class="required">
119119
<td align="right">
120-
<?php print_string('auth_cas_port_key', 'auth_cas') ?>:
120+
<label for="port"><?php print_string('auth_cas_port_key', 'auth_cas') ?>: </label>
121121
</td>
122122
<td>
123-
<input name="port" type="text" size="30" value="<?php echo $config->port ?>" />
123+
<input name="port" id="port" type="text" size="30" value="<?php echo $config->port ?>" />
124124
<?php if (isset($err['port'])) { echo $OUTPUT->error_text($err['port']); } ?>
125125
</td>
126126
<td>
@@ -129,7 +129,7 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
129129
</tr>
130130
<tr valign="top" class="required">
131131
<td align="right">
132-
<?php print_string('auth_cas_casversion', 'auth_cas') ?>:
132+
<?php echo html_writer::label(get_string('auth_cas_casversion', 'auth_cas'), 'menucasversion'); ?>:
133133
</td>
134134
<td>
135135
<?php
@@ -145,7 +145,7 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
145145
</td>
146146
</tr>
147147
<tr valign="top" class="required">
148-
<td align="right"><?php print_string('auth_cas_language_key', 'auth_cas') ?>:</td>
148+
<td align="right"><?php echo html_writer::label(get_string('auth_cas_language_key', 'auth_cas'), 'menulanguage'); ?>:</td>
149149
<td>
150150
<?php echo html_writer::select($CASLANGUAGES, 'language', $config->language, false); ?>
151151
</td>
@@ -155,7 +155,7 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
155155
</tr>
156156
<tr valign="top" class="required">
157157
<td align="right">
158-
<?php print_string('auth_cas_proxycas_key', 'auth_cas') ?>:
158+
<?php echo html_writer::label(get_string('auth_cas_proxycas_key', 'auth_cas'), 'menuproxycas'); ?>:
159159
</td>
160160
<td>
161161
<?php echo html_writer::select($yesno, 'proxycas', $config->proxycas, false); ?>
@@ -165,7 +165,7 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
165165
</td>
166166
</tr>
167167
<tr valign="top" class="required">
168-
<td align="right"><?php print_string('auth_cas_logoutcas_key', 'auth_cas') ?>:</td>
168+
<td align="right"><?php echo html_writer::label(get_string('auth_cas_logoutcas_key', 'auth_cas'), 'menulogoutcas'); ?>:</td>
169169
<td>
170170
<?php echo html_writer::select($yesno, 'logoutcas', $config->logoutcas, false); ?>
171171
</td>
@@ -174,7 +174,7 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
174174
</td>
175175
</tr>
176176
<tr valign="top" class="required">
177-
<td align="right"><?php print_string('auth_cas_multiauth_key', 'auth_cas') ?>:</td>
177+
<td align="right"><?php echo html_writer::label(get_string('auth_cas_multiauth_key', 'auth_cas'), 'menumultiauth'); ?>:</td>
178178
<td>
179179
<?php echo html_writer::select($yesno, 'multiauth', $config->multiauth, false); ?>
180180
</td>
@@ -183,7 +183,7 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
183183
</td>
184184
</tr>
185185
<tr valign="top" class="required">
186-
<td align="right"><?php print_string('auth_cas_certificate_check_key', 'auth_cas') ?>:</td>
186+
<td align="right"><?php echo html_writer::label(get_string('auth_cas_certificate_check_key', 'auth_cas'), 'menucertificate_check'); ?>:</td>
187187
<td>
188188
<?php echo html_writer::select($yesno, 'certificate_check', $config->certificate_check, false); ?>
189189
</td>
@@ -192,7 +192,7 @@ <h4><?php print_string('auth_cas_server_settings', 'auth_cas') ?></h4>
192192
</td>
193193
</tr>
194194
<tr valign="top" class="required">
195-
<td align="right"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>:</td>
195+
<td align="right"><label for="certificate_path"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>: </label></td>
196196
<td>
197197
<input name="certificate_path" id="certificate_path" type="text" size="30" value="<?php echo $config->certificate_path ?>" />
198198
<?php if (isset($err['certificate_path'])) echo $OUTPUT->error_text($err['certificate_path']); ?>
@@ -219,7 +219,7 @@ <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4>
219219
</td>
220220
</tr>
221221
<tr valign="top" class="required">
222-
<td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td>
222+
<td align="right"><label for="menuldap_version"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td>
223223
<td>
224224
<?php
225225
$versions = array();

auth/fc/config.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<table cellspacing="0" cellpadding="5" border="0">
2828

2929
<tr valign="top" class="required">
30-
<td align="right"><?php print_string("auth_fchost_key", "auth_fc") ?>:</td>
30+
<td align="right"><label for="host"><?php print_string("auth_fchost_key", "auth_fc") ?>:</label></td>
3131
<td>
32-
<input name="host" type="text" size="30" value="<?php echo $config->host?>" />
32+
<input name="host" id="host" type="text" size="30" value="<?php echo $config->host?>" />
3333
<?php if (isset($err["host"])) echo $OUTPUT->error_text($err["host"]); ?>
3434
</td>
3535
<td>
@@ -38,9 +38,9 @@
3838
</tr>
3939

4040
<tr valign="top" class="required">
41-
<td align="right"><?php print_string("auth_fcfppport_key", "auth_fc") ?>:</td>
41+
<td align="right"><label for="fppport"><?php print_string("auth_fcfppport_key", "auth_fc") ?>: </label></td>
4242
<td>
43-
<input name="fppport" type="text" size="30" value="<?php echo $config->fppport?>" />
43+
<input name="fppport" id="fppport" type="text" size="30" value="<?php echo $config->fppport?>" />
4444
<?php if (isset($err["fppport"])) echo $OUTPUT->error_text($err["host"]); ?>
4545
</td>
4646
<td>
@@ -70,9 +70,9 @@
7070
</tr>
7171

7272
<tr valign="top" class="required">
73-
<td align="right"><?php print_string("auth_fccreators_key", "auth_fc") ?>:</td>
73+
<td align="right"><label for="creators"><?php print_string("auth_fccreators_key", "auth_fc") ?>: </label></td>
7474
<td>
75-
<input name="creators" type="text" size="30" value="<?php echo $config->creators?>" />
75+
<input name="creators" id="creators" type="text" size="30" value="<?php echo $config->creators?>" />
7676
<?php if (isset($err["creators"])) echo $OUTPUT->error_text($err["creators"]); ?>
7777
</td>
7878
<td>
@@ -81,9 +81,9 @@
8181
</tr>
8282

8383
<tr valign="top">
84-
<td align="right"><?php print_string('auth_fcchangepasswordurl', 'auth_fc') ?>: </td>
84+
<td align="right"><label for="changepasswordurl"><?php print_string('auth_fcchangepasswordurl', 'auth_fc') ?>: </label></td>
8585
<td>
86-
<input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
86+
<input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
8787
<?php
8888

8989
if (isset($err['changepasswordurl'])) {

auth/imap/config.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<table cellspacing="0" cellpadding="5" border="0">
1919

2020
<tr valign="top" class="required">
21-
<td align="right"><?php print_string('auth_imaphost_key', 'auth_imap') ?>: </td>
21+
<td align="right"><label for="host"><?php print_string('auth_imaphost_key', 'auth_imap') ?>: </label></td>
2222
<td>
23-
<input name="host" type="text" size="30" value="<?php echo $config->host ?>" />
23+
<input name="host" id="host" type="text" size="30" value="<?php echo $config->host ?>" />
2424
<?php
2525

2626
if (isset($err['host'])) {
@@ -40,7 +40,7 @@
4040
</tr>
4141

4242
<tr valign="top" class="required">
43-
<td align="right"><?php print_string('auth_imaptype_key', 'auth_imap') ?>: </td>
43+
<td align="right"><?php echo html_writer::label(get_string('auth_imaptype_key', 'auth_imap'), 'menutype'); ?>: </td>
4444
<td>
4545
<?php
4646

@@ -56,9 +56,9 @@
5656
</tr>
5757

5858
<tr valign="top" class="required">
59-
<td align="right"><?php print_string('auth_imapport_key', 'auth_imap') ?>: </td>
59+
<td align="right"><label for="port"><?php print_string('auth_imapport_key', 'auth_imap') ?>: </label></td>
6060
<td>
61-
<input name="port" type="text" size="6" value="<?php echo $config->port ?>" />
61+
<input name="port" id="port" type="text" size="6" value="<?php echo $config->port ?>" />
6262
<?php
6363

6464
if (isset($err['port'])) {
@@ -71,9 +71,9 @@
7171
</tr>
7272

7373
<tr valign="top">
74-
<td align="right"><?php print_string('auth_imapchangepasswordurl_key', 'auth_imap') ?>: </td>
74+
<td align="right"><label for="changepasswordurl"><?php print_string('auth_imapchangepasswordurl_key', 'auth_imap') ?>: </label></td>
7575
<td>
76-
<input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
76+
<input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
7777
<?php
7878

7979
if (isset($err['changepasswordurl'])) {

auth/ldap/config.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ <h4><?php print_string('auth_ldap_server_settings', 'auth_ldap') ?></h4>
118118
</tr>
119119
<tr valign="top" class="required">
120120
<td align="right">
121-
<label for="menuversion"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label>
121+
<label for="menuldap_version"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label>
122122
</td>
123123
<td>
124124
<?php

0 commit comments

Comments
 (0)