class MoodleQuickForm_editor extends HTML_QuickForm_element {
protected $_helpbutton = '';
protected $_options = array('subdirs'=>0, 'maxbytes'=>0, 'maxfiles'=>0, 'changeformat'=>0,
- 'context'=>null, 'noclean'=>0, 'trusttext'=>0);
+ 'context'=>null, 'noclean'=>0, 'trusted'=>0);
protected $_values = array('text'=>null, 'format'=>null, 'itemid'=>null);
function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
$coursecontext = $this->_customdata['coursecontext'];
$modcontext = $this->_customdata['modcontext'];
$forum = $this->_customdata['forum'];
- $post = $this->_customdata['post']; // hack alert
+ $post = $this->_customdata['post'];
+ // TODO: add max files and max size support
+ $editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'trusted'=>trusttext_trusted($modcontext), 'context'=>$modcontext);
$mform->addElement('header', 'general', '');//fill in the data depending on page params
//later using set_data
$mform->addRule('subject', get_string('required'), 'required', null, 'client');
$mform->addRule('subject', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
- $mform->addElement('editor', 'message', get_string('message', 'forum'), null, array('maxfiles' => EDITOR_UNLIMITED_FILES));
+ $mform->addElement('editor', 'message', get_string('message', 'forum'), null, $editoroptions);
$mform->setType('message', PARAM_RAW);
$mform->addRule('message', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('message', array('reading', 'writing', 'questions', 'richtext2'), false, 'editorhelpbutton');