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 //would cause problems with client side validation so will leave for now
21 //var $_elementTemplateType='fieldset';
23 * set html for help button
26 * @param array $help array of arguments to make a help button
27 * @param string $function function name to call to get html
29 function setHelpButton($helpbuttonargs, $function='helpbutton'){
30 if (!is_array($helpbuttonargs)){
31 $helpbuttonargs=array($helpbuttonargs);
33 $helpbuttonargs=$helpbuttonargs;
35 //we do this to to return html instead of printing it
36 //without having to specify it in every call to make a button.
37 if ('helpbutton' == $function){
38 $defaultargs=array('', '', 'moodle', true, false, '', true);
39 $helpbuttonargs=$helpbuttonargs +
$defaultargs ;
41 $this->_helpbutton
=call_user_func_array($function, $helpbuttonargs);
44 * set html for help button
47 * @param array $help array of arguments to make a help button
48 * @param string $function function name to call to get html
50 function getHelpButton(){
51 return $this->_helpbutton
;
53 function getElementTemplateType(){
54 if ($this->_flagFrozen
){
55 if ($this->getGroupType() == 'submit'){
66 function setElements($elements){
67 parent
::setElements($elements);
68 foreach ($this->_elements
as $element){
69 if (method_exists($element, 'setHiddenLabel')){
70 $element->setHiddenLabel(true);