30/local/Recycle bin

De MoodleDocs
Revisión del 16:24 25 ago 2015 de German Valero (discusión | contribs.) ({{EnTraduccion}})


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:

lib php file in a local moodle server.png

lib php original file opened in notepad plus plus.png

  • You need to find exactly these lines:
function course_delete_module($cmid) {
         return true;
     }
  • 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 658 and 1659 with the added text::

lib php modified file opened in notepad plus plus.png

  • You will then have a Recycle bin available inside the Administration block:

Recycle bin is available.png