Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

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