Merge branch 'm20_MDL-26672_aiccfix' of git://github.com/danmarsden/moodle
[moodle.git] / lib / form / group.php
blob64fe56acbb5227350e8a7217098ba083aa05999d
1 <?php
2 require_once("HTML/QuickForm/group.php");
4 /**
5 * HTML class for a form element group
7 * @author Adam Daniel <adaniel1@eesus.jnj.com>
8 * @author Bertrand Mansion <bmansion@mamasam.com>
9 * @version 1.0
10 * @since PHP4.04pl1
11 * @access public
13 class MoodleQuickForm_group extends HTML_QuickForm_group{
14 /**
15 * html for help button, if empty then no help
17 * @var string
19 var $_helpbutton='';
20 function MoodleQuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true) {
21 parent::HTML_QuickForm_group($elementName, $elementLabel, $elements, $separator, $appendName);
23 //would cause problems with client side validation so will leave for now
24 //var $_elementTemplateType='fieldset';
25 /**
26 * set html for help button
28 * @access public
29 * @param array $help array of arguments to make a help button
30 * @param string $function function name to call to get html
32 function setHelpButton($helpbuttonargs, $function='helpbutton'){
33 debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
35 /**
36 * set html for help button
38 * @access public
39 * @param array $help array of arguments to make a help button
40 * @param string $function function name to call to get html
42 function getHelpButton(){
43 return $this->_helpbutton;
45 function getElementTemplateType(){
46 if ($this->_flagFrozen){
47 if ($this->getGroupType() == 'submit'){
48 return 'nodisplay';
49 } else {
50 return 'static';
52 } else {
53 return 'fieldset';
57 function setElements($elements){
58 parent::setElements($elements);
59 foreach ($this->_elements as $element){
60 if (method_exists($element, 'setHiddenLabel')){
61 $element->setHiddenLabel(true);