local/Recycle bin: Difference between revisions
From MoodleDocs
(tidy up) |
(tidy up) |
||
Line 18: | Line 18: | ||
} | } | ||
* You will be adding exactly these two lines: | * And after those lines You will be adding exactly these two lines: | ||
// Notify the recycle bin plugin. | // Notify the recycle bin plugin. | ||
\local_recyclebin\Observer::pre_cm_delete($cm); | \local_recyclebin\Observer::pre_cm_delete($cm); | ||
Your modified (hacked file) must look exactly like this lines | 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]] | [[File:lib_php modified file opened in notepad plus plus.png|600px]] |
Revision as of 16:31, 25 August 2015
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:
- You can edit the lib.php file easily with Notepad ++ for Windows.
- 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::
- You will then have a Recycle bin available inside the Administration block: