Recycle bin

General plugins (Local) ::: local_recyclebin
Maintained by Picture of Skylar KeltySkylar Kelty
This plugin adds a "recycle bin" for course modules to Moodle.

Recycle bin 3.5 (Build: 2016040601)

Moodle 2.7, 2.8, 2.9, 3.0
Released: Wednesday, April 6, 2016, 10:22 PM

Moodle Recycle Bin Build Status

This plugin adds a "recycle bin" for course modules to Moodle. It requires a core hack.

See plugin pages here: https://moodle.org/plugins/view/local_recyclebin

See documentation here: https://docs.moodle.org/29/en/local/Recycle_bin

Moodle 3.1

Please note - this plugin has been merged into core for Moodle 3.1. If you have this installed you should run cli/migrate.php and then delete the plugin and remove the core hooks.

Installation - course recyclebin

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);

Installation - category recyclebin

As there is no "pre-course-deleted" event, you will need to add a line to '/lib/moodlelib.php' (function delete_course), right after the second "if()".

diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index 456d0f1..aeb0853 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -4683,6 +4683,9 @@ function delete_course($courseorid, $showfeedback = true) {
         return false;
     }

+    // Notify the recycle bin plugin.
+    \local_recyclebin\observer::pre_course_delete($course);
+
     // Make the course completely empty.
     remove_course_contents($courseid, $showfeedback);

Version information

Version build number
2016040601
Version release name
3.5 (Build: 2016040601)
Maturity
Stable version
MD5 Sum
ede43fcff56ca01ea6f3282b532cec86
Supported software
Moodle 2.7, Moodle 2.8, Moodle 2.9, Moodle 3.0
  • Latest release for Moodle 2.7
  • Latest release for Moodle 2.8
  • Latest release for Moodle 2.9
  • Latest release for Moodle 3.0

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS branch
master
VCS tag
3.5

Default installation instructions for plugins of the type General plugins (Local)

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder in the "local" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation.