From 5a4ba49ca7d8cc8870c866f0389ef136b009ae2d Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 24 Jun 2009 22:54:49 +0000 Subject: [PATCH] MDL-19611 fixing regression - video icon disappeared --- lib/form/editor.php | 2 +- mod/forum/post_form.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/form/editor.php b/lib/form/editor.php index 053f3cd1c7..7de814cc39 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -10,7 +10,7 @@ require_once('HTML/QuickForm/element.php'); 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) { diff --git a/mod/forum/post_form.php b/mod/forum/post_form.php index 6ee86b2f90..a3c43fddbf 100644 --- a/mod/forum/post_form.php +++ b/mod/forum/post_form.php @@ -14,7 +14,9 @@ class mod_forum_post_form extends moodleform { $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 @@ -23,7 +25,7 @@ class mod_forum_post_form extends moodleform { $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'); -- 2.39.5