2 require_once('HTML/QuickForm/textarea.php');
5 * HTML class for a textarea type element
10 class MoodleQuickForm_textarea
extends HTML_QuickForm_textarea
{
12 * Need to store id of form as we may need it for helpbutton
18 * html for help button, if empty then no help
24 * set html for help button
27 * @param array $help array of arguments to make a help button
28 * @param string $function function name to call to get html
30 function setHelpButton($helpbuttonargs, $function='helpbutton'){
32 if (!is_array($helpbuttonargs)){
33 $helpbuttonargs=array($helpbuttonargs);
35 $helpbuttonargs=$helpbuttonargs;
37 //we do this to to return html instead of printing it
38 //without having to specify it in every call to make a button.
39 if ('helpbutton' == $function){
40 $defaultargs=array('', '', 'moodle', true, false, '', true);
41 $helpbuttonargs=$helpbuttonargs +
$defaultargs ;
42 } elseif ('editorhelpbutton' == $function){
43 if (in_array('emoticons', $helpbuttonargs)){
44 $SESSION->inserttextform
= $this->_formid
;
45 $SESSION->inserttextfield
= $this->getAttribute('name');
48 $this->_helpbutton
=call_user_func_array($function, $helpbuttonargs);
51 * get html for help button
54 * @return string html for help button
56 function getHelpButton(){
57 return $this->_helpbutton
;
60 * Called by HTML_QuickForm whenever form event is made on this element
62 * @param string $event Name of event
63 * @param mixed $arg event arguments
64 * @param object $caller calling object
69 function onQuickFormEvent($event, $arg, &$caller)
73 $this->_formid
= $caller->getAttribute('id');
76 return parent
::onQuickFormEvent($event, $arg, $caller);
77 } // end func onQuickFormEvent
79 * Slightly different container template when frozen.
83 function getElementTemplateType(){
84 if ($this->_flagFrozen
){