"MDL-21153, fixed helpbutton debug message when using select & group elements"

This commit is contained in:
Dongsheng Cai 2009-12-18 07:09:59 +00:00
parent 15d0fae463
commit 02e7a15db9
2 changed files with 9 additions and 3 deletions

View File

@ -30,6 +30,7 @@ class MoodleQuickForm_group extends HTML_QuickForm_group{
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
global $OUTPUT;
if (!is_array($helpbuttonargs)){
$helpbuttonargs=array($helpbuttonargs);
}else{
@ -37,11 +38,13 @@ class MoodleQuickForm_group extends HTML_QuickForm_group{
}
//we do this to to return html instead of printing it
//without having to specify it in every call to make a button.
if ('helpbutton' == $function){
if ($function == 'helpbutton') {
$defaultargs=array('', '', 'moodle', true, false, '', true);
$helpbuttonargs=$helpbuttonargs + $defaultargs ;
$this->_helpbutton=$OUTPUT->help_icon(call_user_func_array('moodle_help_icon::make', $helpbuttonargs));
} else {
$this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
}
$this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
}
/**
* set html for help button

View File

@ -57,6 +57,7 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
global $OUTPUT;
if (!is_array($helpbuttonargs)){
$helpbuttonargs=array($helpbuttonargs);
}else{
@ -67,8 +68,10 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{
if ('helpbutton' == $function){
$defaultargs=array('', '', 'moodle', true, false, '', true);
$helpbuttonargs=$helpbuttonargs + $defaultargs ;
$this->_helpbutton=$OUTPUT->help_icon(call_user_func_array('moodle_help_icon::make', $helpbuttonargs));
} else {
$this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
}
$this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
}
/**
* get html for help button