Using the File API in Moodle forms

Från MoodleDocs
Version från den 27 mars 2009 kl. 08.46 av Dongsheng Cai (diskussion | bidrag) (New page: In Moodle 2.o onward, we introduced Repository API to fetch files from external sources, Repository API will move to files int...)
(skillnad) ← Äldre version | Nuvarande version (skillnad) | Nyare version → (skillnad)
Hoppa till:navigering, sök

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