MDL-28094 fix subdirs support in module intro editor

This commit is contained in:
Petr Škoda 2013-08-25 15:24:19 +02:00
parent 5e95223e86
commit f9beaf4472
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ if (!empty($add)) {
if (plugin_supports('mod', $data->modulename, FEATURE_MOD_INTRO, true)) {
$draftid_editor = file_get_submitted_draft_itemid('introeditor');
file_prepare_draft_area($draftid_editor, null, null, null, null);
file_prepare_draft_area($draftid_editor, null, null, null, null, array('subdirs'=>true));
$data->introeditor = array('text'=>'', 'format'=>FORMAT_HTML, 'itemid'=>$draftid_editor); // TODO: add better default
}

View File

@ -821,7 +821,7 @@ abstract class moodleform_mod extends moodleform {
$label = is_null($customlabel) ? get_string('moduleintro') : $customlabel;
$mform->addElement('editor', 'introeditor', $label, array('rows' => 10), array('maxfiles' => EDITOR_UNLIMITED_FILES,
'noclean' => true, 'context' => $this->context));
'noclean' => true, 'context' => $this->context, 'subdirs' => true));
$mform->setType('introeditor', PARAM_RAW); // no XSS prevention here, users must be trusted
if ($required) {
$mform->addRule('introeditor', get_string('required'), 'required', null, 'client');