Difference between revisions of "local/Recycle bin"

Jump to: navigation, search
(tidy up)
m (added link to spanish translation)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Infobox plugin
+
#redirect [[Recycle bin]]
|type = Local
 
|entry = https://moodle.org/plugins/view/local_recyclebin
 
|tracker = https://github.com/unikent/moodle-local_recyclebin/issues
 
|discussion = https://moodle.org/plugins/view/local_recyclebin
 
|maintainer = [[User:Skylar Kelty|Skylar Kelty]]
 
|float = right
 
}}
 
This is a [[:Category:Contributed_code|contributed (third party)]] plugin for Moodle written by Skylar Kelty and shared on Moodle.org
 
 
 
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()".
 
 
 
* You must first find the moodle/course folder and locate there the lib.php file that you will need to modify:
 
 
 
[[File:lib_php file in a local moodle server.png|600px]]
 
 
 
* You can edit the lib.php file easily with [https://notepad-plus-plus.org/ Notepad ++ for Windows].
 
 
 
[[File:lib_php original file opened in notepad plus plus.png|600px]]
 
 
 
* You need to find exactly these lines:
 
 
 
function course_delete_module($cmid) {
 
          return true;
 
      }
 
 
 
* And after those lines You will be adding exactly these two lines:
 
 
 
    // Notify the recycle bin plugin.
 
    \local_recyclebin\Observer::pre_cm_delete($cm);
 
 
 
Your modified (hacked file) must look exactly like this lines 1658 and 1659 with the added text::
 
 
 
[[File:lib_php modified file opened in notepad plus plus.png|600px]]
 
 
 
* You will then have a Recycle bin available inside the Administration block:
 
 
 
[[File:Recycle bin is available.png|300px]]
 
  
 
[[es:local/Recycle bin]]
 
[[es:local/Recycle bin]]

Latest revision as of 15:40, 12 June 2016

Redirect to: