Moodle Plugins directory: Recycle bin | Moodle.org
Recycle bin
Local plugins ::: local_recyclebin
Maintained by
Skylar Kelty
This plugin adds a "recycle bin" for course modules to Moodle.
Latest release:
55 sites
9 downloads
16 fans
Current versions available: 1
This plugin adds a "recycle bin" for course modules to Moodle.
It requires a core hack as there is no pre-cm-deleted event, you will need to add a line to '/course/lib.php' (function course_delete_module), right after the first "if()".
diff --git a/course/lib.php b/course/lib.php index e49bdf1..5f8d6e6 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1654,6 +1654,9 @@ function course_delete_module($cmid) { return true; } + // Notify the recycle bin plugin. + \local_recyclebin\observer::pre_cm_delete($cm); + // Get the module context. $modcontext = context_module::instance($cm->id);
Contributors
Skylar Kelty (Lead maintainer)
Please login to view contributors details and/or to contact them
thanks for this useful plugin!
I think you could improve the necessary core hack by a) throwing a general event in course_delete_module() and catching this event within your plugin instead of notifying your module directly b) creating an issue on tracker.moodle.org to include throwing this event into Moodle core.
How do you think about that?
Thanks,
Alex
Thanks for releasing this, its a bit of a lifesaver!
This kind of feature should have been in core a long time ago! (as it is with other LMS's)
The plugin is nice. Thank you. As we concern our disk space, may I ask if you can add "14 days and 21 days" as an option for recycle bin retention time? Currently it has 2, 5, 10, 35 days... etc. as the options.
So because the migration copies the recycled files rather than moves them, we are left with the original recycled content in moodledata/recyclebin.
Is it safe to delete these files once you have migrated? We have not uninstalled the original local/recyclebin plugin (although we have disabled it), so I was wondering if there was any dependency on the original files?
Thanks
Raad
Any plans for a 3.5 version? (I expect you're busy, but I'm also happy not to see "Part of set 'Looking for new maintainer'"!)
Ta, Devon