2 require_once("HTML/QuickForm/group.php");
5 * HTML class for a form element group
7 * @author Adam Daniel <adaniel1@eesus.jnj.com>
8 * @author Bertrand Mansion <bmansion@mamasam.com>
13 class MoodleQuickForm_group
extends HTML_QuickForm_group
{
15 * html for help button, if empty then no help
20 var $_elementTemplateType='fieldset';
21 //would cause problems with client side validation so will leave for now
22 //var $_elementTemplateType='fieldset';
24 * set html for help button
27 * @param array $help array of arguments to make a help button
28 * @param string $function function name to call to get html
30 function setHelpButton($helpbuttonargs, $function='helpbutton'){
31 if (!is_array($helpbuttonargs)){
32 $helpbuttonargs=array($helpbuttonargs);
34 $helpbuttonargs=$helpbuttonargs;
36 //we do this to to return html instead of printing it
37 //without having to specify it in every call to make a button.
38 if ('helpbutton' == $function){
39 $defaultargs=array('', '', 'moodle', true, false, '', true);
40 $helpbuttonargs=$helpbuttonargs +
$defaultargs ;
42 $this->_helpbutton
=call_user_func_array($function, $helpbuttonargs);
45 * set html for help button
48 * @param array $help array of arguments to make a help button
49 * @param string $function function name to call to get html
51 function getHelpButton(){
52 return $this->_helpbutton
;
54 function getElementTemplateType(){
55 return $this->_elementTemplateType
;
57 function setElements($elements){
58 parent
::setElements($elements);
59 foreach ($this->_elements
as $element){
60 if (method_exists($element, 'setHiddenLabel')){
61 $element->setHiddenLabel(true);