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_comments(XoopsModule $module)
22: {
23: $xoops = Xoops::getInstance();
24:
25: XoopsLoad::loadFile($xoops->path('modules/comments/class/helper.php'));
26: $helper = Comments::getInstance();
27: $plugins = Plugin::getPlugins('comments');
28: foreach (array_keys($plugins) as $dirname) {
29: $helper->insertModuleRelations($xoops->getModuleByDirname($dirname));
30: }
31:
32: return true;
33: }
34:
35: function xoops_module_pre_uninstall_comments(XoopsModule $module)
36: {
37: $xoops = Xoops::getInstance();
38: XoopsLoad::loadFile($xoops->path('modules/comments/class/helper.php'));
39: $helper = Comments::getInstance();
40: $plugins = Plugin::getPlugins('comments');
41: foreach (array_keys($plugins) as $dirname) {
42: $helper->deleteModuleRelations($xoops->getModuleByDirname($dirname));
43: }
44:
45: return true;
46: }
47:
48: function xoops_module_update_comments(XoopsModule $module, $prev_version)
49: {
50: return xoops_module_install_comments($module);
51: }
52: