mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
"MDL-21153, fixed helpbutton debug message when using select & group elements"
This commit is contained in:
parent
15d0fae463
commit
02e7a15db9
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user