markn86/moodle-mod_certificate — pull request #20 by jk3us (2012-12-28 19:51:21+00:00)
Title: Use file manager for uploading images

This change uses Moodle's nice file_storage mechanism for management uploaded images.

In the upload_image_form.php form, instead of a dropdown for type and a single file picker, that form now has a file_manager for each image type (border, seal, etc), you can drag multiple files into each and delete old files. (it lets you delete files that are in use, be careful!)

In the mod_form, it lists files that are in the codebase and in this the proper file area (but no longer the hardcoded data_dir directory *)

When generating the pdf, files in the file area get pulled and inserted appropriately.

* Warning: What this doesn't do (yet) is migrate in any images in the hardcoded data_dir from previous versions. That will need to be implemented in the module's upgrade script so no one loses their images.

I can hopefully add the upgrade migration part and test some more next week, but wanted to send this along since I won't be looking at this again until after new year. Feel free to test and provide feedback, or go ahead and do my unfinished work for me :)