MDL-34650 - accessibility compliance: Add <label> for form input text and select tag

This commit is contained in:
Rossiani Wijaya
2012-07-31 12:09:18 +08:00
parent 6975216336
commit 2a336b5ef1
8 changed files with 39 additions and 9 deletions
+3 -3
View File
@@ -1334,7 +1334,7 @@ class core_renderer extends renderer_base {
}
if ($select->label) {
$output .= html_writer::label($select->label, $select->attributes['id']);
$output .= html_writer::label($select->label, $select->attributes['id'], false, $select->labelattributes);
}
if ($select->helpicon instanceof help_icon) {
@@ -1342,7 +1342,6 @@ class core_renderer extends renderer_base {
} else if ($select->helpicon instanceof old_help_icon) {
$output .= $this->render($select->helpicon);
}
$output .= html_writer::select($select->options, $select->name, $select->selected, $select->nothing, $select->attributes);
$go = html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('go')));
@@ -1412,7 +1411,7 @@ class core_renderer extends renderer_base {
$output = '';
if ($select->label) {
$output .= html_writer::label($select->label, $select->attributes['id']);
$output .= html_writer::label($select->label, $select->attributes['id'], false, $select->labelattributes);
}
if ($select->helpicon instanceof help_icon) {
@@ -1629,6 +1628,7 @@ class core_renderer extends renderer_base {
$scalearray = array(RATING_UNSET_RATING => $strrate.'...') + $rating->settings->scale->scaleitems;
$scaleattrs = array('class'=>'postratingmenu ratinginput','id'=>'menurating'.$rating->itemid);
$ratinghtml .= html_writer::label($rating->rating, 'menurating'.$rating->itemid, false, array('class' => 'accesshide'));
$ratinghtml .= html_writer::select($scalearray, 'rating', $rating->rating, false, $scaleattrs);
//output submit button