mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-28094 fix subdirs support in module intro editor
This commit is contained in:
parent
5e95223e86
commit
f9beaf4472
@ -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
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user