MDL-10496:
[moodle-linuxchix.git] / lib / form / static.php
blob4e5503d08fb0fe7b01611488bc7be3b6b3139cb2
1 <?php
2 require_once("HTML/QuickForm/static.php");
4 /**
5 * HTML class for a text type element
7 * @author Jamie Pratt
8 * @access public
9 */
10 class MoodleQuickForm_static extends HTML_QuickForm_static{
11 var $_elementTemplateType='static';
12 /**
13 * html for help button, if empty then no help
15 * @var string
17 var $_helpbutton='';
18 /**
19 * set html for help button
21 * @access public
22 * @param array $help array of arguments to make a help button
23 * @param string $function function name to call to get html
25 function setHelpButton($helpbuttonargs, $function='helpbutton'){
26 if (!is_array($helpbuttonargs)){
27 $helpbuttonargs=array($helpbuttonargs);
28 }else{
29 $helpbuttonargs=$helpbuttonargs;
31 //we do this to to return html instead of printing it
32 //without having to specify it in every call to make a button.
33 if ('helpbutton' == $function){
34 $defaultargs=array('', '', 'moodle', true, false, '', true);
35 $helpbuttonargs=$helpbuttonargs + $defaultargs ;
37 $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
39 /**
40 * get html for help button
42 * @access public
43 * @return string html for help button
45 function getHelpButton(){
46 return $this->_helpbutton;
49 function getElementTemplateType(){
50 return $this->_elementTemplateType;