Hi,
I'm trying to develop my own block and I first followed theses tutorials to learn how to do it correctly :
http://docs.moodle.org/dev/Blocks
http://docs.moodle.org/dev/Blocks_Advanced
I've attached the final block to this topic.
For the moment this block stores an INT in the database when I submit the form.
It looks like it is the id of the file in a draft directory, and the url of the file in the filepicker is something like :
{myWebsite}/draftfile.php/5/user/draft/605087011/{Filename}.pdf
I would like to display the uploaded file name and a link to download it on the view.php page.
I studyed some APIs like theses :
http://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#Using_the_filepicker_element
http://docs.moodle.org/dev/File_API
But nothing seems to work like I want.
When I want to get the name of the file chosend by the filepicker with :
$name = $mform->get_new_filename('filename');
The function get_new_filename is not found and otherwise I get a blank screen.
Can someone help me or give me some advices ?
Thank you
Julien