2 require_once("HTML/QuickForm/static.php");
5 * HTML class for a text type element
10 class MoodleQuickForm_static
extends HTML_QuickForm_static
{
11 var $_elementTemplateType='static';
13 * html for help button, if empty then no help
18 function MoodleQuickForm_static($elementName=null, $elementLabel=null, $text=null) {
19 parent
::HTML_QuickForm_static($elementName, $elementLabel, $text);
22 * set html for help button
25 * @param array $help array of arguments to make a help button
26 * @param string $function function name to call to get html
28 function setHelpButton($helpbuttonargs, $function='helpbutton'){
29 if (!is_array($helpbuttonargs)){
30 $helpbuttonargs=array($helpbuttonargs);
32 $helpbuttonargs=$helpbuttonargs;
34 //we do this to to return html instead of printing it
35 //without having to specify it in every call to make a button.
36 if ('helpbutton' == $function){
37 $defaultargs=array('', '', 'moodle', true, false, '', true);
38 $helpbuttonargs=$helpbuttonargs +
$defaultargs ;
40 $this->_helpbutton
=call_user_func_array($function, $helpbuttonargs);
43 * get html for help button
46 * @return string html for help button
48 function getHelpButton(){
49 return $this->_helpbutton
;
52 function getElementTemplateType(){
53 return $this->_elementTemplateType
;