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) {
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();
$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
}
}
-?>
+
print_error('nopermissiontocomment');
}
- $commentoptions = array('trusttext'=>true, 'maxfiles'=>0);
+ $commentoptions = array('trusttext'=>true, 'maxfiles'=>0, 'context'=>$context);
$comment = new object();
$comment->id = null;
/// print original glossary entry for any comment action (add, update, delete)
glossary_print_entry($course, $cm, $glossary, $entry, 'approval', '', false);
}
-?>
+
$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');
$this->set_data($current);
}
}
-?>
\ No newline at end of file
$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);
print_footer($course);
-?>