mardi 24 mars 2015

Moodle Load existing files into draft area

I have developed a plugin that allows users to upload files to Moodle and I am able to display these files on the screen when they visit the view.php file but I am having problems allowing them to edit/update their entries.


I have read the documentation here but I still cannot figure out where this code should go? How this work? How do I actually retrieve the files and show them on the filemanager area?


If I use this line



$draftitemid = file_get_submitted_draft_itemid('attachments');


$draftitemid is always 0, and this is logical because I haven't submit the form yet.


When I am editing the entry I have the following information to locate the file



courseid
entryid
itemid
filearea name
component


Could you please point me to the right direction?


Thanks


Aucun commentaire:

Enregistrer un commentaire