Note: You are currently viewing documentation for Moodle 2.6. Up-to-date documentation for the latest stable version of Moodle may be available here: Using the File API in Moodle forms.

Development:Using the File API in Moodle forms

From MoodleDocs
Revision as of 08:46, 27 March 2009 by Dongsheng Cai (talk | contribs) (New page: In Moodle 2.o onward, we introduced Repository API to fetch files from external sources, Repository API will move to files int...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In Moodle 2.o onward, we introduced Repository API to fetch files from external sources, Repository API will move to files into draft areas, then modules will process moving draft area files into a proper fileareas, this documentation will demonstrate how to do that.

There are three form elements involved with Repository API, they are file manager, file picker and editor, the legacy upload button will be replaced by file picker or file manager, file picker and file manager work similar, the only difference is file manager can fetch multiple files, file picker only fetch one file. Editor element is introduced to replace legacy htmleditor element, I will talk about them respectively.

editor element

changes on formlib

process draft area files

process draft area url in content

file picker

file manager