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

This commit is contained in:
Rossiani Wijaya
2012-07-31 12:07:16 +08:00
parent 55a568fa7d
commit ecc5cc31ae
8 changed files with 39 additions and 9 deletions
+17 -2
View File
@@ -714,6 +714,11 @@ class single_select implements renderable {
*/
var $label = '';
/**
* @var array Button label's
*/
var $labelattributes = array();
/**
* @var string Form submit method post or get
*/
@@ -806,9 +811,12 @@ class single_select implements renderable {
* Sets select's label
*
* @param string $label
* @param array $attributes (optional)
*/
public function set_label($label) {
public function set_label($label, $attributes = array()) {
$this->label = $label;
$this->labelattributes = $attributes;
}
}
@@ -850,6 +858,11 @@ class url_select implements renderable {
*/
var $label = '';
/**
* @var array Button label's attributes
*/
var $labelattributes = array();
/**
* @var string Wrapping div class
*/
@@ -922,9 +935,11 @@ class url_select implements renderable {
* Sets select's label
*
* @param string $label
* @param array $attributes (optional)
*/
public function set_label($label) {
public function set_label($label, $attributes = array()) {
$this->label = $label;
$this->labelattributes = $attributes;
}
}