mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-21217, MDL-21198 simplified/improved outputlib help icon related apis + several fixed regresions
This commit is contained in:
parent
48a67d9f01
commit
4bcc51185c
113 changed files with 442 additions and 970 deletions
|
@ -34,29 +34,7 @@ class MoodleQuickForm_textarea extends HTML_QuickForm_textarea{
|
|||
* @param string $function function name to call to get html
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
global $SESSION;
|
||||
if (!is_array($helpbuttonargs)) {
|
||||
$helpbuttonargs = array($helpbuttonargs);
|
||||
} else {
|
||||
$helpbuttonargs = $helpbuttonargs;
|
||||
}
|
||||
//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){
|
||||
$defaultargs = array('', '', 'moodle', true, false, '', true);
|
||||
$helpbuttonargs = $helpbuttonargs + $defaultargs ;
|
||||
if (in_array($helpbuttonargs[0], array('emoticons2', 'text2', 'richtext2'))) {
|
||||
$SESSION->inserttextform = $this->_formid;
|
||||
$SESSION->inserttextfield = $this->getAttribute('name');
|
||||
}
|
||||
} else if ('editorhelpbutton' == $function) {
|
||||
$specialhelp = array_intersect($helpbuttonargs, array('emoticons2', 'text2', 'richtext2'));
|
||||
if (!empty($specialhelp)) {
|
||||
$SESSION->inserttextform = $this->_formid;
|
||||
$SESSION->inserttextfield = $this->getAttribute('name');
|
||||
}
|
||||
}
|
||||
$this->_helpbutton = call_user_func_array($function, $helpbuttonargs);
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
/**
|
||||
* get html for help button
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue