1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: use Xoops\Core\Kernel\Handlers\XoopsModule;
13:
14: 15: 16: 17: 18: 19: 20: 21: 22:
23:
24: function xoops_module_update_search(XoopsModule $module)
25: {
26: $xoops = Xoops::getInstance();
27:
28: $config_handler = $xoops->getHandlerConfig();
29: $criteria = new CriteriaCompo();
30: $criteria->add(new Criteria('conf_modid', 0));
31: $criteria->add(new Criteria('conf_catid', 5));
32: $configs = $config_handler->getConfigs($criteria);
33: $confcount = count($configs);
34: if ($confcount > 0) {
35: for ($i = 0; $i < $confcount; ++$i) {
36: $criteria = new CriteriaCompo();
37: $criteria->add(new Criteria('conf_modid', $module->getVar('mid')));
38: $criteria->add(new Criteria('conf_name', $configs[$i]->getVar('conf_name')));
39: $new_configs = $config_handler->getConfigs($criteria);
40: $new_confcount = count($new_configs);
41: if ($new_confcount > 0) {
42: for ($j = 0; $j < $new_confcount; ++$j) {
43: $obj = $config_handler->getConfig($new_configs[$j]->getVar('conf_id'));
44: }
45: $obj->setVar("conf_value", $configs[$i]->getVar('conf_value'));
46: $config_handler->insertConfig($obj);
47: $config_handler->deleteConfig($configs[$i]);
48: }
49:
50: }
51:
52: }
53: return true;
54:
55: }
56: