mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-36985 core_files: added option to remove draft files on save
text areas can now specify $options['removeorphaneddrafts'] when saving their data using file_postupdate_standard_editor(). If set to true, this option clears all user drafts which are not referenced in the text
This commit is contained in:
parent
27466d7548
commit
f3c2afd0e8
3 changed files with 91 additions and 6 deletions
|
@ -169,12 +169,13 @@ class assign_submission_onlinetext extends assign_submission_plugin {
|
|||
* @return array
|
||||
*/
|
||||
private function get_edit_options() {
|
||||
$editoroptions = array(
|
||||
'noclean' => false,
|
||||
'maxfiles' => EDITOR_UNLIMITED_FILES,
|
||||
'maxbytes' => $this->assignment->get_course()->maxbytes,
|
||||
'context' => $this->assignment->get_context(),
|
||||
'return_types' => (FILE_INTERNAL | FILE_EXTERNAL | FILE_CONTROLLED_LINK)
|
||||
$editoroptions = array(
|
||||
'noclean' => false,
|
||||
'maxfiles' => EDITOR_UNLIMITED_FILES,
|
||||
'maxbytes' => $this->assignment->get_course()->maxbytes,
|
||||
'context' => $this->assignment->get_context(),
|
||||
'return_types' => (FILE_INTERNAL | FILE_EXTERNAL | FILE_CONTROLLED_LINK),
|
||||
'removeorphaneddrafts' => true // Whether or not to remove any draft files which aren't referenced in the text.
|
||||
);
|
||||
return $editoroptions;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue