timeline: if a section is set to hidden and the user is not capable of editing a...
[moodle-blog-course-format.git] / lib / form / password.php
bloba17b8327a61b4b30b279e9c222ae0805974f0d4e
1 <?php
2 require_once('HTML/QuickForm/password.php');
4 /**
5 * HTML class for a password type element
7 * @author Jamie Pratt
8 * @access public
9 */
10 class MoodleQuickForm_password extends HTML_QuickForm_password{
11 /**
12 * html for help button, if empty then no help
14 * @var string
16 var $_helpbutton='';
17 function MoodleQuickForm_password($elementName=null, $elementLabel=null, $attributes=null) {
18 parent::HTML_QuickForm_password($elementName, $elementLabel, $attributes);
20 /**
21 * set html for help button
23 * @access public
24 * @param array $help array of arguments to make a help button
25 * @param string $function function name to call to get html
27 function setHelpButton($helpbuttonargs, $function='helpbutton'){
28 if (!is_array($helpbuttonargs)){
29 $helpbuttonargs=array($helpbuttonargs);
30 }else{
31 $helpbuttonargs=$helpbuttonargs;
33 //we do this to to return html instead of printing it
34 //without having to specify it in every call to make a button.
35 if ('helpbutton' == $function){
36 $defaultargs=array('', '', 'moodle', true, false, '', true);
37 $helpbuttonargs=$helpbuttonargs + $defaultargs ;
39 $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
41 /**
42 * get html for help button
44 * @access public
45 * @return string html for help button
47 function getHelpButton(){
48 return $this->_helpbutton;