Index: modules.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/modules.php,v retrieving revision 1.44 diff -u -r1.44 modules.php --- modules.php 12 Sep 2007 02:56:50 -0000 1.44 +++ modules.php 10 Dec 2007 19:20:51 -0000 @@ -156,6 +156,17 @@ // remove entent handlers and dequeue pending events 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->directory = "$CFG->dirroot/mod/$delete"; notice(get_string("moduledeletefiles", "", $a), "modules.php");