Permalink
Browse files

MDL-30843 and MDL-30842 - accessibility compliance: Add <label> for f…

…orm input text and select tag
  • Loading branch information...
1 parent a7899ca commit 0add004b0ed1d93b9ee7396b64a60af8de33784d @rwijaya rwijaya committed Mar 30, 2012
Showing with 339 additions and 193 deletions.
  1. +2 −0 admin/filters.php
  2. +4 −3 admin/mnet/access_control.php
  3. +1 −0 admin/portfolio.php
  4. +2 −1 admin/repository.php
  5. +4 −1 admin/roles/lib.php
  6. +1 −1 admin/timezone.php
  7. +14 −14 auth/cas/config.html
  8. +8 −8 auth/fc/config.html
  9. +7 −7 auth/imap/config.html
  10. +1 −1 auth/ldap/config.html
  11. +3 −3 auth/mnet/config.html
  12. +6 −6 auth/nntp/config.html
  13. +9 −9 auth/pop3/config.html
  14. +9 −9 auth/radius/config.html
  15. +11 −11 auth/shibboleth/config.html
  16. +2 −2 auth/shibboleth/index_form.html
  17. +10 −1 backup/util/ui/renderer.php
  18. +2 −2 blocks/section_links/config_instance.html
  19. +2 −2 blocks/tags/block_tags.php
  20. +1 −0 calendar/lib.php
  21. +3 −1 calendar/renderer.php
  22. +1 −0 course/index.php
  23. +3 −0 course/scales.php
  24. +5 −1 enrol/authorize/locallib.php
  25. +3 −3 enrol/manual/manage.php
  26. +3 −3 filter/algebra/algebradebug.php
  27. +4 −1 filter/manage.php
  28. +1 −0 grade/edit/tree/calculation.php
  29. +1 −1 grade/edit/tree/index.php
  30. +2 −1 grade/edit/tree/lib.php
  31. +1 −1 grade/lib.php
  32. +2 −1 grade/report/grader/lib.php
  33. +2 −0 lang/en/moodle.php
  34. +18 −6 lib/adminlib.php
  35. +3 −3 lib/deprecatedlib.php
  36. +3 −2 lib/form/editor.php
  37. +13 −1 lib/outputrenderers.php
  38. +2 −1 lib/portfoliolib.php
  39. +1 −1 lib/questionlib.php
  40. +1 −0 lib/tablelib.php
  41. +1 −0 lib/weblib.php
  42. +4 −3 message/lib.php
  43. +6 −2 mod/assignment/lib.php
  44. +1 −1 mod/chat/gui_ajax/index.php
  45. +1 −0 mod/chat/gui_header_js/chatinput.php
  46. +1 −0 mod/chat/gui_sockets/chatinput.php
  47. +1 −0 mod/data/field.php
  48. +2 −1 mod/data/field/file/field.class.php
  49. +1 −0 mod/data/field/file/mod.html
  50. +6 −2 mod/data/field/latlong/field.class.php
  51. +4 −2 mod/data/field/menu/field.class.php
  52. +3 −1 mod/data/field/multimenu/field.class.php
  53. +2 −1 mod/data/field/number/field.class.php
  54. +2 −1 mod/data/field/picture/field.class.php
  55. +1 −0 mod/data/field/picture/mod.html
  56. +3 −1 mod/data/field/radiobutton/field.class.php
  57. +1 −1 mod/data/field/text/field.class.php
  58. +4 −2 mod/data/field/textarea/field.class.php
  59. +6 −2 mod/data/field/url/field.class.php
  60. +4 −4 mod/feedback/analysis_course.php
  61. +2 −1 mod/feedback/item/multichoice/lib.php
  62. +2 −1 mod/feedback/item/multichoicerated/lib.php
  63. +1 −1 mod/feedback/mapcourse.php
  64. +1 −0 mod/feedback/show_nonrespondents.php
  65. +2 −0 mod/forum/lib.php
  66. +12 −2 mod/forum/search.php
  67. +4 −4 mod/glossary/editcategories.html
  68. +11 −11 mod/glossary/formats.php
  69. +4 −2 mod/glossary/lib.php
  70. +6 −3 mod/lesson/pagetypes/matching.php
  71. +1 −0 mod/lesson/report.php
  72. +7 −2 mod/quiz/editlib.php
  73. +2 −1 mod/quiz/report/statistics/report.php
  74. +2 −1 mod/scorm/locallib.php
  75. +2 −1 mod/wiki/editors/wikieditor.php
  76. +6 −3 mod/wiki/renderer.php
  77. +1 −0 question/behaviour/rendererbase.php
  78. +2 −1 question/format/xhtml/format.php
  79. +8 −4 question/type/calculated/questiontype.php
  80. +1 −0 question/type/essay/renderer.php
  81. +1 −0 question/type/match/renderer.php
  82. +3 −3 question/type/multianswer/renderer.php
  83. +4 −2 question/type/numerical/renderer.php
  84. +2 −2 question/type/shortanswer/renderer.php
  85. +1 −1 repository/alfresco/lib.php
  86. +3 −1 repository/draftfiles_manager.php
  87. +2 −2 repository/filepicker.php
  88. +7 −4 tag/coursetags_edit.php
  89. +5 −2 tag/manage.php
  90. +5 −4 user/addnote.php
  91. +1 −0 user/groupaddnote.php
  92. +2 −1 user/index.php
  93. +1 −1 user/message.html
View
@@ -242,6 +242,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
// Disable/off/on
$select = new single_select(filters_action_url($filter, 'setstate'), 'newstate', $activechoices, $filterinfo->active, null, 'active' . basename($filter));
+ $select->set_label(get_accesshide(get_string('isactive', 'filters')));
$row[] = $OUTPUT->render($select);
// Re-order
@@ -263,6 +264,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
// Apply to strings.
$select = new single_select(filters_action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, $applytostrings, null, 'applyto' . basename($filter));
+ $select->set_label(get_accesshide(get_string('applyto', 'filters')));
$select->disabled = $filterinfo->active == TEXTFILTER_DISABLED;
$row[] = $OUTPUT->render($select);
@@ -203,17 +203,18 @@
if (!empty($formerror['username'])) {
echo '<span class="error"> * </span>';
}
-echo '<input type="text" name="username" size="20" maxlength="100" />';
+echo html_writer::label(get_string('username'), 'menuusername', false, array('class' =>'accesshide'));
+echo '<input id="menuusername" type="text" name="username" size="20" maxlength="100" />';
// choose a remote host
-echo " " . get_string('remotehost', 'mnet') . ":\n";
+echo html_writer::label(get_string('remotehost', 'mnet'), 'menumnet_host_id');
if (!empty($formerror['mnet_host_id'])) {
echo '<span class="error"> * </span>';
}
echo html_writer::select($mnethosts, 'mnet_host_id');
// choose an access level
-echo " " . get_string('accesslevel', 'mnet') . ":\n";
+echo html_writer::label(get_string('accesslevel', 'mnet'), 'menuaccessctrl');
if (!empty($formerror['accessctrl'])) {
echo '<span class="error"> * </span>';
}
View
@@ -197,6 +197,7 @@ function portfolio_action_url($portfolio) {
$currentaction = 'hide';
}
$select = new single_select(portfolio_action_url($pluginid, 'pf'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . $pluginid);
+ $select->set_label(get_accesshide(get_string('portfolio', 'portfolio')));
$table->data[] = array($pluginname, $OUTPUT->render($select), $settings);
}
if (!in_array($plugin, $usedplugins)) {
@@ -305,7 +305,7 @@ function repository_action_url($repository) {
}
$select = new single_select(repository_action_url($typename, 'repos'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . basename($typename));
-
+ $select->set_label(get_accesshide(get_string('action')));
// Display up/down link
$updown = '';
$spacer = $OUTPUT->spacer(array('height'=>15, 'width'=>15)); // should be done with CSS instead
@@ -342,6 +342,7 @@ function repository_action_url($repository) {
// Check that it has not already been listed
if (!in_array($plugin, $alreadyplugins)) {
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
+ $select->set_label(get_accesshide(get_string('action')));
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
}
}
View
@@ -721,7 +721,10 @@ protected function get_archetype_field($id) {
foreach(get_role_archetypes() as $type) {
$options[$type] = get_string('archetype'.$type, 'role');
}
- return html_writer::select($options, 'archetype', $this->role->archetype, false);
+
+ $return = html_writer::label(get_string('archetype'.$type, 'role'), 'menuarchetype', false, array('class' => 'accesshide'));
+ $return .= html_writer::select($options, 'archetype', $this->role->archetype, false);
+ return $return;
}
protected function get_assignable_levels_control() {
View
@@ -42,7 +42,7 @@
$timezones = get_list_of_timezones();
echo '<center><form action="timezone.php" method="post">';
- echo "$strusers ($strall): ";
+ echo html_writer::label($strusers . ' (' . $strall . '): ', 'menuzone');
echo html_writer::select($timezones, "zone", $current, array('99'=>get_string("serverlocaltime")));
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
echo '<input type="submit" value="'.s($strsavechanges).'" />';
View
@@ -94,9 +94,9 @@
</td>
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>:</td>
+ <td align="right"><label for="hostname"><?php print_string('auth_cas_hostname_key', 'auth_cas') ?>: </label></td>
<td>
- <input name="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
+ <input name="hostname" id="hostname" type="text" size="30" value="<?php echo $config->hostname ?>" />
<?php if (isset($err['hostname'])) { echo $OUTPUT->error_text($err['hostname']); } ?>
</td>
<td>
@@ -105,10 +105,10 @@
</tr>
<tr valign="top" class="required">
<td align="right">
- <?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>:
+ <label for="baseuri"><?php print_string('auth_cas_baseuri_key', 'auth_cas') ?>: </label>
</td>
<td>
- <input name="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
+ <input name="baseuri" id="baseuri" type="text" size="30" value="<?php echo $config->baseuri ?>" />
<?php if (isset($err['baseuri'])) { echo $OUTPUT->error_text($err['baseuri']); } ?>
</td>
<td>
@@ -117,10 +117,10 @@
</tr>
<tr valign="top" class="required">
<td align="right">
- <?php print_string('auth_cas_port_key', 'auth_cas') ?>:
+ <label for="port"><?php print_string('auth_cas_port_key', 'auth_cas') ?>: </label>
</td>
<td>
- <input name="port" type="text" size="30" value="<?php echo $config->port ?>" />
+ <input name="port" id="port" type="text" size="30" value="<?php echo $config->port ?>" />
<?php if (isset($err['port'])) { echo $OUTPUT->error_text($err['port']); } ?>
</td>
<td>
@@ -129,7 +129,7 @@
</tr>
<tr valign="top" class="required">
<td align="right">
- <?php print_string('auth_cas_casversion', 'auth_cas') ?>:
+ <?php echo html_writer::label(get_string('auth_cas_casversion', 'auth_cas'), 'menucasversion'); ?>:
</td>
<td>
<?php
@@ -145,7 +145,7 @@
</td>
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_language_key', 'auth_cas') ?>:</td>
+ <td align="right"><?php echo html_writer::label(get_string('auth_cas_language_key', 'auth_cas'), 'menulanguage'); ?>:</td>
<td>
<?php echo html_writer::select($CASLANGUAGES, 'language', $config->language, false); ?>
</td>
@@ -155,7 +155,7 @@
</tr>
<tr valign="top" class="required">
<td align="right">
- <?php print_string('auth_cas_proxycas_key', 'auth_cas') ?>:
+ <?php echo html_writer::label(get_string('auth_cas_proxycas_key', 'auth_cas'), 'menuproxycas'); ?>:
</td>
<td>
<?php echo html_writer::select($yesno, 'proxycas', $config->proxycas, false); ?>
@@ -165,7 +165,7 @@
</td>
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_logoutcas_key', 'auth_cas') ?>:</td>
+ <td align="right"><?php echo html_writer::label(get_string('auth_cas_logoutcas_key', 'auth_cas'), 'menulogoutcas'); ?>:</td>
<td>
<?php echo html_writer::select($yesno, 'logoutcas', $config->logoutcas, false); ?>
</td>
@@ -174,7 +174,7 @@
</td>
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_multiauth_key', 'auth_cas') ?>:</td>
+ <td align="right"><?php echo html_writer::label(get_string('auth_cas_multiauth_key', 'auth_cas'), 'menumultiauth'); ?>:</td>
<td>
<?php echo html_writer::select($yesno, 'multiauth', $config->multiauth, false); ?>
</td>
@@ -183,7 +183,7 @@
</td>
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_certificate_check_key', 'auth_cas') ?>:</td>
+ <td align="right"><?php echo html_writer::label(get_string('auth_cas_certificate_check_key', 'auth_cas'), 'menucertificate_check'); ?>:</td>
<td>
<?php echo html_writer::select($yesno, 'certificate_check', $config->certificate_check, false); ?>
</td>
@@ -192,7 +192,7 @@
</td>
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>:</td>
+ <td align="right"><label for="certificate_path"><?php print_string('auth_cas_certificate_path_key', 'auth_cas') ?>: </label></td>
<td>
<input name="certificate_path" id="certificate_path" type="text" size="30" value="<?php echo $config->certificate_path ?>" />
<?php if (isset($err['certificate_path'])) echo $OUTPUT->error_text($err['certificate_path']); ?>
@@ -219,7 +219,7 @@
</td>
</tr>
<tr valign="top" class="required">
- <td align="right"><label for="menuversion"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td>
+ <td align="right"><label for="menuldap_version"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label></td>
<td>
<?php
$versions = array();
View
@@ -27,9 +27,9 @@
<table cellspacing="0" cellpadding="5" border="0">
<tr valign="top" class="required">
- <td align="right"><?php print_string("auth_fchost_key", "auth_fc") ?>:</td>
+ <td align="right"><label for="host"><?php print_string("auth_fchost_key", "auth_fc") ?>:</label></td>
<td>
- <input name="host" type="text" size="30" value="<?php echo $config->host?>" />
+ <input name="host" id="host" type="text" size="30" value="<?php echo $config->host?>" />
<?php if (isset($err["host"])) echo $OUTPUT->error_text($err["host"]); ?>
</td>
<td>
@@ -38,9 +38,9 @@
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string("auth_fcfppport_key", "auth_fc") ?>:</td>
+ <td align="right"><label for="fppport"><?php print_string("auth_fcfppport_key", "auth_fc") ?>: </label></td>
<td>
- <input name="fppport" type="text" size="30" value="<?php echo $config->fppport?>" />
+ <input name="fppport" id="fppport" type="text" size="30" value="<?php echo $config->fppport?>" />
<?php if (isset($err["fppport"])) echo $OUTPUT->error_text($err["host"]); ?>
</td>
<td>
@@ -70,9 +70,9 @@
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string("auth_fccreators_key", "auth_fc") ?>:</td>
+ <td align="right"><label for="creators"><?php print_string("auth_fccreators_key", "auth_fc") ?>: </label></td>
<td>
- <input name="creators" type="text" size="30" value="<?php echo $config->creators?>" />
+ <input name="creators" id="creators" type="text" size="30" value="<?php echo $config->creators?>" />
<?php if (isset($err["creators"])) echo $OUTPUT->error_text($err["creators"]); ?>
</td>
<td>
@@ -81,9 +81,9 @@
</tr>
<tr valign="top">
- <td align="right"><?php print_string('auth_fcchangepasswordurl', 'auth_fc') ?>: </td>
+ <td align="right"><label for="changepasswordurl"><?php print_string('auth_fcchangepasswordurl', 'auth_fc') ?>: </label></td>
<td>
- <input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
+ <input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
<?php
if (isset($err['changepasswordurl'])) {
View
@@ -18,9 +18,9 @@
<table cellspacing="0" cellpadding="5" border="0">
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_imaphost_key', 'auth_imap') ?>: </td>
+ <td align="right"><label for="host"><?php print_string('auth_imaphost_key', 'auth_imap') ?>: </label></td>
<td>
- <input name="host" type="text" size="30" value="<?php echo $config->host ?>" />
+ <input name="host" id="host" type="text" size="30" value="<?php echo $config->host ?>" />
<?php
if (isset($err['host'])) {
@@ -40,7 +40,7 @@
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_imaptype_key', 'auth_imap') ?>: </td>
+ <td align="right"><?php echo html_writer::label(get_string('auth_imaptype_key', 'auth_imap'), 'menutype'); ?>: </td>
<td>
<?php
@@ -56,9 +56,9 @@
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_imapport_key', 'auth_imap') ?>: </td>
+ <td align="right"><label for="port"><?php print_string('auth_imapport_key', 'auth_imap') ?>: </label></td>
<td>
- <input name="port" type="text" size="6" value="<?php echo $config->port ?>" />
+ <input name="port" id="port" type="text" size="6" value="<?php echo $config->port ?>" />
<?php
if (isset($err['port'])) {
@@ -71,9 +71,9 @@
</tr>
<tr valign="top">
- <td align="right"><?php print_string('auth_imapchangepasswordurl_key', 'auth_imap') ?>: </td>
+ <td align="right"><label for="changepasswordurl"><?php print_string('auth_imapchangepasswordurl_key', 'auth_imap') ?>: </label></td>
<td>
- <input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
+ <input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
<?php
if (isset($err['changepasswordurl'])) {
@@ -118,7 +118,7 @@
</tr>
<tr valign="top" class="required">
<td align="right">
- <label for="menuversion"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label>
+ <label for="menuldap_version"><?php print_string('auth_ldap_version_key', 'auth_ldap') ?></label>
</td>
<td>
<?php
@@ -22,9 +22,9 @@
<table cellspacing="0" cellpadding="5">
<tr valign="top" class="required">
- <td align="right"><?php print_string('rpc_negotiation_timeout', 'auth_mnet'); ?>: </td>
+ <td align="right"><label for="rpc_negotiation_timeout"><?php print_string('rpc_negotiation_timeout', 'auth_mnet'); ?>: </label></td>
<td>
- <input name="rpc_negotiation_timeout" type="text" size="5" value="<?php echo $config->rpc_negotiation_timeout ?>" />
+ <input name="rpc_negotiation_timeout" id="rpc_negotiation_timeout" type="text" size="5" value="<?php echo $config->rpc_negotiation_timeout ?>" />
<?php
if (isset($err['rpc_negotiation_timeout'])) {
@@ -45,7 +45,7 @@
<?php /*
See MDL-21327 for why this is commented out
<tr valign="top" class="required">
- <td align="right"><?php print_string('auto_add_remote_users', 'auth_mnet'); ?>: </td>
+ <td align="right"><?php echo html_writer::label(get_string('auto_add_remote_users', 'auth_mnet'), 'menuauto_add_remote_users'); ?>: </td>
<td>
<?php
View
@@ -15,9 +15,9 @@
<table cellspacing="0" cellpadding="5" border="0">
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_nntphost_key', 'auth_nntp') ?>: </td>
+ <td align="right"><label for="host"><?php print_string('auth_nntphost_key', 'auth_nntp') ?>: </label></td>
<td>
- <input name="host" type="text" size="30" value="<?php echo $config->host ?>" />
+ <input name="host" id="host" type="text" size="30" value="<?php echo $config->host ?>" />
<?php
if (isset($err["host"])) {
@@ -37,9 +37,9 @@
</tr>
<tr valign="top" class="required">
- <td align="right"><?php print_string('auth_nntpport_key', 'auth_nntp') ?>: </td>
+ <td align="right"><label for="port"><?php print_string('auth_nntpport_key', 'auth_nntp') ?>: </label></td>
<td>
- <input name="port" type="text" size="6" value="<?php echo $config->port ?>" />
+ <input name="port" id="port" type="text" size="6" value="<?php echo $config->port ?>" />
<?php
if (isset($err["port"])) {
@@ -52,9 +52,9 @@
</tr>
<tr valign="top">
- <td align="right"><?php print_string('auth_nntpchangepasswordurl_key', 'auth_nntp') ?>: </td>
+ <td align="right"><label for="changepasswordurl"><?php print_string('auth_nntpchangepasswordurl_key', 'auth_nntp') ?>: </label></td>
<td>
- <input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
+ <input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
<?php
if (isset($err['changepasswordurl'])) {
Oops, something went wrong. Retry.

0 comments on commit 0add004

Please sign in to comment.