mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Adding the ability to perform custom uninstall tasks in modules. MDL-12520
Merged from MOODLE_19_STABLE
This commit is contained in:
parent
89d7d96279
commit
6030279805
@ -156,6 +156,17 @@
|
|||||||
// remove entent handlers and dequeue pending events
|
// remove entent handlers and dequeue pending events
|
||||||
events_uninstall('mod/'.$module->name);
|
events_uninstall('mod/'.$module->name);
|
||||||
|
|
||||||
|
// Perform any custom uninstall tasks
|
||||||
|
if (file_exists($CFG->dirroot . '/mod/' . $module->name . '/lib.php')) {
|
||||||
|
require_once($CFG->dirroot . '/mod/' . $module->name . '/lib.php');
|
||||||
|
$uninstallfunction = $module->name . '_uninstall';
|
||||||
|
if (function_exists($uninstallfunction)) {
|
||||||
|
if (! $uninstallfunction() ) {
|
||||||
|
notify('Encountered a problem running uninstall function for '. $module->name.'!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$a->module = $strmodulename;
|
$a->module = $strmodulename;
|
||||||
$a->directory = "$CFG->dirroot/mod/$delete";
|
$a->directory = "$CFG->dirroot/mod/$delete";
|
||||||
notice(get_string("moduledeletefiles", "", $a), "modules.php");
|
notice(get_string("moduledeletefiles", "", $a), "modules.php");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user