2006-09-24 17:04:51 +00:00
|
|
|
<?php
|
|
|
|
require_once('HTML/QuickForm/textarea.php');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* HTML class for a textarea type element
|
2006-11-13 07:43:22 +00:00
|
|
|
*
|
2006-09-24 17:04:51 +00:00
|
|
|
* @author Jamie Pratt
|
|
|
|
* @access public
|
|
|
|
*/
|
2006-10-12 07:33:57 +00:00
|
|
|
class MoodleQuickForm_textarea extends HTML_QuickForm_textarea{
|
2006-09-24 17:04:51 +00:00
|
|
|
/**
|
|
|
|
* html for help button, if empty then no help
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $_helpbutton='';
|
|
|
|
/**
|
|
|
|
* set html for help button
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @param array $help array of arguments to make a help button
|
2006-11-13 07:43:22 +00:00
|
|
|
* @param string $function function name to call to get html
|
2006-09-24 17:04:51 +00:00
|
|
|
*/
|
2006-11-13 07:43:22 +00:00
|
|
|
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
2006-09-24 17:04:51 +00:00
|
|
|
if (!is_array($helpbuttonargs)){
|
|
|
|
$helpbuttonargs=array($helpbuttonargs);
|
|
|
|
}else{
|
|
|
|
$helpbuttonargs=$helpbuttonargs;
|
|
|
|
}
|
2006-11-13 07:43:22 +00:00
|
|
|
//we do this to to return html instead of printing it
|
2006-09-24 17:04:51 +00:00
|
|
|
//without having to specify it in every call to make a button.
|
|
|
|
$defaultargs=array('', '', 'moodle', true, false, '', true);
|
|
|
|
$helpbuttonargs=$helpbuttonargs + $defaultargs ;
|
2006-11-13 07:43:22 +00:00
|
|
|
$this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
|
2006-09-24 17:04:51 +00:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* get html for help button
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return string html for help button
|
|
|
|
*/
|
|
|
|
function getHelpButton(){
|
|
|
|
return $this->_helpbutton;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|