Some changes for XHTML and accessibility compliance

This commit is contained in:
moodler 2004-09-28 09:47:14 +00:00
parent 857e46c39a
commit 72b4e28353
3 changed files with 14 additions and 5 deletions

View file

@ -667,9 +667,15 @@ function popup_form($common, $options, $formname, $selected='', $nothing='choose
$output .= " <option value=\"javascript:void(0)\">$nothing</option>\n";
}
$inoptgroup = false;
foreach ($options as $value => $label) {
if (substr($label,0,2) == '--') {
$output .= ' <optgroup label="'. $label .'"></optgroup>'; // Plain labels
if ($inoptgroup) {
$output .= ' </optgroup>';
} else {
$inoptgroup = true;
}
$output .= ' <optgroup label="'. $label .'">'; // Plain labels
continue;
} else {
$output .= ' <option value="'. $common . $value .'"';
@ -683,6 +689,9 @@ function popup_form($common, $options, $formname, $selected='', $nothing='choose
$output .= '>'. $value .'</option>' . "\n";
}
}
if ($inoptgroup) {
$output .= ' </optgroup>';
}
$output .= '</select>';
$output .= '</form>' . "\n";
@ -3390,4 +3399,4 @@ function print_speller_button () {
echo '<input type="button" value="Check spelling" onclick="openSpellChecker();" />'."\n";
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>
?>

View file

@ -103,7 +103,7 @@
if ($course->category) {
print_header("$course->shortname: $discussion->name", "$course->fullname",
"<a href=../../course/view.php?id=$course->id>$course->shortname</a> ->
"<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
$navmiddle -> $navtail", "", "", true, $searchform, navmenu($course, $cm));
} else {
print_header("$course->shortname: $discussion->name", "$course->fullname",

View file

@ -1816,7 +1816,7 @@ function forum_print_search_form($course, $search="", $return=false, $type="") {
$output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td nowrap=\"nowrap\">";
$output .= "<form name=\"search\" action=\"$CFG->wwwroot/mod/forum/search.php\">";
$output .= "<font size=\"-1\">";
$output .= "<input name=\"search\" type=\"text\" size=\"15\" value=\"$search\" />";
$output .= "<input name=\"search\" type=\"text\" size=\"15\" value=\"$search\" alt=\"search\" />";
$output .= "<input value=\"".get_string("searchforums", "forum")."\" type=\"submit\" />";
$output .= "</font>";
$output .= "<input name=\"id\" type=\"hidden\" value=\"$course->id\" />";
@ -1826,7 +1826,7 @@ function forum_print_search_form($course, $search="", $return=false, $type="") {
$output = "<table border=\"0\" cellpadding=\"10\" cellspacing=\"0\"><tr><td align=\"center\">";
$output .= "<form name=\"search\" action=\"$CFG->wwwroot/mod/forum/search.php\">";
$output .= "<font size=\"-1\">";
$output .= "<input name=\"search\" type=\"text\" size=\"15\" value=\"$search\" /><br />";
$output .= "<input name=\"search\" type=\"text\" size=\"15\" value=\"$search\" alt=\"search\" /><br />";
$output .= "<input value=\"".get_string("searchforums", "forum")."\" type=\"submit\" />";
$output .= "</font>";
$output .= "<input name=\"id\" type=\"hidden\" value=\"$course->id\" />";