timeline: if a section is set to hidden and the user is not capable of editing a...
[moodle-blog-course-format.git] / lib / form / static.php
blob56274c09c5a3a3080eac597b476501a3b7d6f7be
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 function MoodleQuickForm_static($elementName=null, $elementLabel=null, $text=null) {
19 parent::HTML_QuickForm_static($elementName, $elementLabel, $text);
21 /**
22 * set html for help button
24 * @access public
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);
31 }else{
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);
42 /**
43 * get html for help button
45 * @access public
46 * @return string html for help button
48 function getHelpButton(){
49 return $this->_helpbutton;
52 function getElementTemplateType(){
53 return $this->_elementTemplateType;