diff --git a/lib/form/editor.php b/lib/form/editor.php index 7de814cc394..d891c547408 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, 'trusted'=>0); + 'context'=>null, 'noclean'=>0, 'trusttext'=>0); protected $_values = array('text'=>null, 'format'=>null, 'itemid'=>null); function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attributes=null, $options=null) { @@ -29,6 +29,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { if (!$this->_options['context']) { $this->_options['context'] = get_context_instance(CONTEXT_SYSTEM); } + $this->_options['trusted'] = trusttext_trusted($this->_options['context']); parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes); repository_head_setup(); diff --git a/mod/forum/post_form.php b/mod/forum/post_form.php index a3c43fddbfc..227b8205015 100644 --- a/mod/forum/post_form.php +++ b/mod/forum/post_form.php @@ -16,7 +16,7 @@ class mod_forum_post_form extends moodleform { $forum = $this->_customdata['forum']; $post = $this->_customdata['post']; // TODO: add max files and max size support - $editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'trusted'=>trusttext_trusted($modcontext), 'context'=>$modcontext); + $editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'trusttext'=>true, 'context'=>$modcontext); $mform->addElement('header', 'general', '');//fill in the data depending on page params //later using set_data @@ -138,4 +138,4 @@ class mod_forum_post_form extends moodleform { } } -?> + diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php index befe17f585e..66a1c1237eb 100644 --- a/mod/glossary/comment.php +++ b/mod/glossary/comment.php @@ -52,7 +52,7 @@ function glossary_comment_add() { print_error('nopermissiontocomment'); } - $commentoptions = array('trusttext'=>true, 'maxfiles'=>0); + $commentoptions = array('trusttext'=>true, 'maxfiles'=>0, 'context'=>$context); $comment = new object(); $comment->id = null; @@ -233,4 +233,4 @@ function glossary_comment_print_header($course, $cm, $glossary, $entry, $action) /// print original glossary entry for any comment action (add, update, delete) glossary_print_entry($course, $cm, $glossary, $entry, 'approval', '', false); } -?> + diff --git a/mod/glossary/comment_form.php b/mod/glossary/comment_form.php index 30c52f2e9e1..5498da5817e 100644 --- a/mod/glossary/comment_form.php +++ b/mod/glossary/comment_form.php @@ -8,7 +8,7 @@ class mod_glossary_comment_form extends moodleform { $current = $this->_customdata['current']; $commentoptions = $this->_customdata['commentoptions']; - + // visible elements $mform->addElement('editor', 'entrycomment_editor', get_string('comment', 'glossary'), null, $commentoptions); $mform->addRule('entrycomment_editor', get_string('required'), 'required', null, 'client'); @@ -32,4 +32,3 @@ class mod_glossary_comment_form extends moodleform { $this->set_data($current); } } -?> \ No newline at end of file diff --git a/mod/glossary/edit.php b/mod/glossary/edit.php index 22b4c80c720..3e1406afecf 100644 --- a/mod/glossary/edit.php +++ b/mod/glossary/edit.php @@ -59,7 +59,7 @@ if ($id) { // if entry is specified $maxfiles = 99; // TODO: add some setting $maxbytes = $course->maxbytes; // TODO: add some setting -$definitionoptions = array('trusttext'=>true, 'subdirs'=>false, 'maxfiles'=>$maxfiles, 'maxbytes'=>$maxbytes); +$definitionoptions = array('trusttext'=>true, 'subdirs'=>false, 'maxfiles'=>$maxfiles, 'maxbytes'=>$maxbytes, 'trusttext'=>true, 'context'=>$context); $attachmentoptions = array('subdirs'=>false, 'maxfiles'=>$maxfiles, 'maxbytes'=>$maxbytes); $entry = file_prepare_standard_editor($entry, 'definition', $definitionoptions, $context, 'glossary_entry', $entry->id); @@ -175,4 +175,3 @@ $mform->display(); print_footer($course); -?>