GithubHelp home page GithubHelp logo

ccle / moodle-local_recyclebin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unikent/moodle-local_recyclebin

0.0 9.0 1.0 153 KB

Recycle bin for Kent Moodles

License: GNU General Public License v2.0

PHP 87.30% JavaScript 2.29% Gherkin 10.28% CSS 0.13%

moodle-local_recyclebin's Introduction

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

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

moodle-local_recyclebin's People

Contributors

rlorenzo avatar rsivasundaram avatar sk-unikent avatar starrynte avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

danieldyo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.