4 require_once 'HTML/QuickForm/header.php';
7 * A pseudo-element used for adding headers to form
10 class MoodleQuickForm_header
extends HTML_QuickForm_header
13 * html for help button, if empty then no help
24 * @param object An HTML_QuickForm_Renderer object
28 function accept(&$renderer)
30 $this->_text
.= $this->getHelpButton();
31 $renderer->renderHeader($this);
36 * set html for help button
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 setHelpButton($helpbuttonargs, $function='helpbutton'){
43 if (!is_array($helpbuttonargs)){
44 $helpbuttonargs=array($helpbuttonargs);
46 $helpbuttonargs=$helpbuttonargs;
48 //we do this to to return html instead of printing it
49 //without having to specify it in every call to make a button.
50 if ('helpbutton' == $function){
51 $defaultargs=array('', '', 'moodle', true, false, '', true);
52 $helpbuttonargs=$helpbuttonargs +
$defaultargs ;
54 $this->_helpbutton
=call_user_func_array($function, $helpbuttonargs);
57 * get html for help button
60 * @return string html for help button
62 function getHelpButton(){
63 return $this->_helpbutton
;
65 } //end class MoodleQuickForm_header