Filemanager - Filearea related question

Re: Filemanager - Filearea related question

Davo Smith
Number of replies: 0
Core developers 사진 Particularly helpful Moodlers 사진 Peer reviewers 사진 Plugin developers 사진
"hs_attachment" is just the name of the form element. It is used to store the draft itemid, which is used to identify the draft area where files are stored whilst the form is being displayed (if the form is saved, the draft area is synchronised back into the real file area).

As per: https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#Element_preparation

By far the easiest way to use the filemanager element is to make sure it is called "SOMENAME_filemanager" (where SOMENAME is a name of your choosing). That way you can use the file_prepare_standard_filemanager($data, 'SOMENAME', ...) function to copy existing files into the draft area, before you display the form, then call file_postupdate_standard_filemanager($data, 'SOMENAME', ...) function to transfer the files back out of the draft area, once the form has been submitted.
평균 등급 :Useful (1)