1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: use Xoops\Core\Kernel\Handlers\XoopsModule;
13: use Xoops\Module\Plugin;
14:
15: 16: 17: 18: 19:
20:
21: function xoops_module_install_notifications(XoopsModule $module)
22: {
23: $xoops = Xoops::getInstance();
24:
25: XoopsLoad::loadFile($xoops->path('modules/notifications/class/helper.php'));
26: $helper = Notifications::getInstance();
27: $plugins = Plugin::getPlugins('notifications');
28:
29: foreach (array_keys($plugins) as $dirname) {
30: $helper->insertModuleRelations($xoops->getModuleByDirname($dirname));
31: }
32:
33: return true;
34: }
35:
36: function xoops_module_pre_uninstall_notifications(XoopsModule $module)
37: {
38: $xoops = Xoops::getInstance();
39: XoopsLoad::loadFile($xoops->path('modules/notifications/class/helper.php'));
40: $helper = Notifications::getInstance();
41: $plugins = Plugin::getPlugins('notifications');
42: foreach (array_keys($plugins) as $dirname) {
43: $helper->deleteModuleRelations($xoops->getModuleByDirname($dirname));
44: }
45:
46: return true;
47: }
48:
49: function xoops_module_update_notifications(XoopsModule $module, $prev_version)
50: {
51: return xoops_module_install_notifications($module);
52: }
53: