Permalink
Browse files

fix for MDL-10122, accessibility for course search box

  • Loading branch information...
1 parent f7d555d commit 60a66a2bef83447e1044e893e735e45664510100 toyomoyo committed Jun 19, 2007
Showing with 9 additions and 6 deletions.
  1. +9 −6 course/lib.php
View
@@ -1901,20 +1901,23 @@ function print_course_search($value="", $return=false, $format="plain") {
if ($format == 'plain') {
$output = '<form id="'.$id.'" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
- $output .= '<input type="text" size="30" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
- $output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
+ $output .= '<label for="coursesearchbox">'.$strsearchcourses.': </label>';
+ $output .= '<input type="text" id="coursesearchbox" size="30" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
+ $output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
} else if ($format == 'short') {
$output = '<form id="'.$id.'" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
- $output .= '<input type="text" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
- $output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
+ $output .= '<label for="coursesearchbox">'.$strsearchcourses.': </label>';
+ $output .= '<input type="text" id="coursesearchbox" size="12" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
+ $output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
} else if ($format == 'navbar') {
$output = '<form id="coursesearchnavbar" action="'.$CFG->wwwroot.'/course/search.php" method="get">';
$output .= '<fieldset class="coursesearchbox invisiblefieldset">';
- $output .= '<input type="text" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
- $output .= '<input type="submit" value="'.s($strsearchcourses).'" />';
+ $output .= '<label for="coursesearchbox">'.$strsearchcourses.': </label>';
+ $output .= '<input type="text" id="coursesearchbox" size="20" name="search" alt="'.s($strsearchcourses).'" value="'.s($value, true).'" />';
+ $output .= '<input type="submit" value="'.get_string('go').'" />';
$output .= '</fieldset></form>';
}

0 comments on commit 60a66a2

Please sign in to comment.