Permalink
Browse files

MDL-34566 accessibility compliance for glossary module: Add forform i…

…nput text and select tag
  • Loading branch information...
1 parent 02814bf commit 08e03a695ac0a0ce4b4c07991a9d6e749080da41 @rwijaya rwijaya committed Jul 27, 2012
Showing with 19 additions and 17 deletions.
  1. +4 −4 mod/glossary/editcategories.html
  2. +11 −11 mod/glossary/formats.php
  3. +4 −2 mod/glossary/lib.php
View
8 mod/glossary/editcategories.html
@@ -7,15 +7,15 @@
<div>
<table class="generalbox" cellpadding="5">
<tr valign="top">
- <td align="right"><?php echo get_string("name") ?>:</td>
+ <td align="right"><label for="name"><?php echo get_string("name") ?>:</label></td>
<td>
- <input type="text" name="name" size="30" value="<?php p($name) ?>" />
+ <input type="text" name="name" id="name" size="30" value="<?php p($name) ?>" />
</td>
</tr>
<tr valign="top">
- <td align="right"><?php echo get_string("linkcategory","glossary") ?>:</td>
+ <td align="right"><label for="usedynalink"><?php echo get_string("linkcategory","glossary") ?>:</label></td>
<td>
- <select size="1" name="usedynalink">
+ <select size="1" id="usedynalink" name="usedynalink">
<option value="1" <?php
if ( $usedynalink ) {
echo "selected=\"selected\"";
View
22 mod/glossary/formats.php
@@ -69,7 +69,7 @@
</strong></td>
</tr>
<tr valign="top">
- <td align="right" width="20%"><?php print_string('popupformat','glossary'); ?></td>
+ <td align="right" width="20%"><?php echo html_writer::label(get_string('popupformat','glossary'), 'menupopupformatname'); ?></td>
<td>
<?php
//get and update available formats
@@ -92,9 +92,9 @@
</td>
</tr>
<tr valign="top">
- <td align="right" width="20%"><?php print_string('defaultmode','glossary'); ?></td>
+ <td align="right" width="20%"><label for="defaultmode"><?php print_string('defaultmode','glossary'); ?></label></td>
<td>
- <select size="1" name="defaultmode">
+ <select size="1" id="defaultmode" name="defaultmode">
<?php
$sletter = '';
$scat = '';
@@ -129,9 +129,9 @@
</td>
</tr>
<tr valign="top">
- <td align="right" width="20%"><?php print_string('defaulthook','glossary'); ?></td>
+ <td align="right" width="20%"><label for="defaulthook"><?php print_string('defaulthook','glossary'); ?></label></td>
<td>
- <select size="1" name="defaulthook">
+ <select size="1" id="defaulthook" name="defaulthook">
<?php
$sall = '';
$sspecial = '';
@@ -166,9 +166,9 @@
</td>
</tr>
<tr valign="top">
- <td align="right" width="20%"><?php print_string('defaultsortkey','glossary'); ?></td>
+ <td align="right" width="20%"><label for="sortkey"><?php print_string('defaultsortkey','glossary'); ?></label></td>
<td>
- <select size="1" name="sortkey">
+ <select size="1" id="sortkey" name="sortkey">
<?php
$sfname = '';
$slname = '';
@@ -203,9 +203,9 @@
</td>
</tr>
<tr valign="top">
- <td align="right" width="20%"><?php print_string('defaultsortorder','glossary'); ?></td>
+ <td align="right" width="20%"><label for="sortorder"><?php print_string('defaultsortorder','glossary'); ?></label></td>
<td>
- <select size="1" name="sortorder">
+ <select size="1" id="sortorder" name="sortorder">
<?php
$sasc = '';
$sdesc = '';
@@ -228,9 +228,9 @@
</td>
</tr>
<tr valign="top">
- <td align="right" width="20%"><?php print_string("includegroupbreaks", "glossary"); ?>:</td>
+ <td align="right" width="20%"><label for="showgroup"><?php print_string("includegroupbreaks", "glossary"); ?>:</label></td>
<td>
- <select size="1" name="showgroup">
+ <select size="1" id="showgroup" name="showgroup">
<?php
$yselected = "";
$nselected = "";
View
6 mod/glossary/lib.php
@@ -1188,7 +1188,7 @@ function glossary_print_entry_aliases($course, $cm, $glossary, $entry,$mode='',
foreach ($aliases as $alias) {
if (trim($alias->alias)) {
if ($return == '') {
- $return = '<select style="font-size:8pt">';
+ $return = '<select id="keyword" style="font-size:8pt">';
}
$return .= "<option>$alias->alias</option>";
}
@@ -1344,7 +1344,8 @@ function glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $m
echo '<table>';
if ( $aliases ) {
echo '<tr valign="top"><td class="aliases">' .
- get_string('aliases','glossary').': '.$aliases . '</td></tr>';
+ '<label for="keyword">' . get_string('aliases','glossary').': </label>' .
+ $aliases . '</td></tr>';
}
if ($icons) {
echo '<tr valign="top"><td class="icons">'.$icons.'</td></tr>';
@@ -1926,6 +1927,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
echo '<td align="center" style="width:20%">';
$select = new single_select(new moodle_url("/mod/glossary/view.php", array('id'=>$cm->id, 'mode'=>'cat')), 'hook', $menu, $selected, null, "catmenu");
+ $select->set_label(get_string('categories', 'glossary'), array('class' => 'accesshide'));
echo $OUTPUT->render($select);
echo '</td>';

0 comments on commit 08e03a6

Please sign in to comment.