mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
now wrapping a group element in a fieldset tag, brought id tag on checkboxes and radio boxes in line with moodle universal form structure
This commit is contained in:
parent
f5896f0fb6
commit
ec929cd596
@ -41,5 +41,23 @@ class moodleform_checkbox extends HTML_QuickForm_checkbox{
|
||||
function getHelpButton(){
|
||||
return $this->_helpbutton;
|
||||
}
|
||||
/**
|
||||
* Automatically generates and assigns an 'id' attribute for the element.
|
||||
*
|
||||
* Currently used to ensure that labels work on radio buttons and
|
||||
* checkboxes. Per idea of Alexander Radivanovich.
|
||||
* Overriden in moodleforms to remove qf_ prefix.
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
function _generateId()
|
||||
{
|
||||
static $idx = 1;
|
||||
|
||||
if (!$this->getAttribute('id')) {
|
||||
$this->updateAttributes(array('id' => substr(md5(microtime() . $idx++), 0, 6)));
|
||||
}
|
||||
} // end func _generateId
|
||||
}
|
||||
?>
|
@ -17,7 +17,7 @@ class moodleform_group extends HTML_QuickForm_group{
|
||||
* @var string
|
||||
*/
|
||||
var $_helpbutton='';
|
||||
var $_elementTemplateType='default';
|
||||
var $_elementTemplateType='fieldset';
|
||||
//would cause problems with client side validation so will leave for now
|
||||
//var $_elementTemplateType='fieldset';
|
||||
/**
|
||||
|
@ -41,5 +41,23 @@ class moodleform_radio extends HTML_QuickForm_radio{
|
||||
function getHelpButton(){
|
||||
return $this->_helpbutton;
|
||||
}
|
||||
/**
|
||||
* Automatically generates and assigns an 'id' attribute for the element.
|
||||
*
|
||||
* Currently used to ensure that labels work on radio buttons and
|
||||
* checkboxes. Per idea of Alexander Radivanovich.
|
||||
* Overriden in moodleforms to remove qf_ prefix.
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
function _generateId()
|
||||
{
|
||||
static $idx = 1;
|
||||
|
||||
if (!$this->getAttribute('id')) {
|
||||
$this->updateAttributes(array('id' => substr(md5(microtime() . $idx++), 0, 6)));
|
||||
}
|
||||
} // end func _generateId
|
||||
}
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user