some changes to setHelpButton methods on elements and MoodleQuickForm to allow non standard help buttons such as the grades pop up window.

This commit is contained in:
jamiesensei 2006-11-13 07:43:22 +00:00
parent 3d436d5974
commit d4fe14d3e4
12 changed files with 68 additions and 56 deletions

View file

@ -3,7 +3,7 @@ require_once('HTML/QuickForm/password.php');
/**
* HTML class for a password type element
*
*
* @author Jamie Pratt
* @access public
*/
@ -19,18 +19,19 @@ class MoodleQuickForm_password extends HTML_QuickForm_password{
*
* @access public
* @param array $help array of arguments to make a help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs){
function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){
$helpbuttonargs=array($helpbuttonargs);
}else{
$helpbuttonargs=$helpbuttonargs;
}
//we do this to to return html instead of printing it
//we do this to to return html instead of printing it
//without having to specify it in every call to make a button.
$defaultargs=array('', '', 'moodle', true, false, '', true);
$helpbuttonargs=$helpbuttonargs + $defaultargs ;
$this->_helpbutton=call_user_func_array('helpbutton', $helpbuttonargs);
$this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
}
/**
* get html for help button