1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: if (!defined('XOOPS_ROOT_PATH')) exit();
12:
13: require_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
14:
15: class LegacyCommentstatusObject extends XoopsSimpleObject
16: {
17: function LegacyCommentstatusObject()
18: {
19: static $initVars;
20: if (isset($initVars)) {
21: $this->mVars = $initVars;
22: return;
23: }
24: $this->initVar('id', XOBJ_DTYPE_INT, '', true);
25: $this->initVar('name', XOBJ_DTYPE_STRING, '', true, 255);
26: $initVars=$this->mVars;
27: }
28: }
29:
30: class LegacyCommentstatusHandler extends XoopsObjectHandler
31: {
32: var $_mResults = array();
33:
34: function LegacyCommentstatusHandler(&$db)
35: {
36: $root =& XCube_Root::getSingleton();
37: $language = $root->mContext->getXoopsConfig('language');
38: $root->mLanguageManager->loadPageTypeMessageCatalog('comment');
39:
40: $this->_mResults[XOOPS_COMMENT_PENDING] =& $this->create();
41: $this->_mResults[XOOPS_COMMENT_PENDING]->setVar('id', XOOPS_COMMENT_PENDING);
42: $this->_mResults[XOOPS_COMMENT_PENDING]->setVar('name', _CM_PENDING);
43:
44: $this->_mResults[XOOPS_COMMENT_ACTIVE] =& $this->create();
45: $this->_mResults[XOOPS_COMMENT_ACTIVE]->setVar('id', XOOPS_COMMENT_ACTIVE);
46: $this->_mResults[XOOPS_COMMENT_ACTIVE]->setVar('name', _CM_ACTIVE);
47:
48: $this->_mResults[XOOPS_COMMENT_HIDDEN] =& $this->create();
49: $this->_mResults[XOOPS_COMMENT_HIDDEN]->setVar('id', XOOPS_COMMENT_HIDDEN);
50: $this->_mResults[XOOPS_COMMENT_HIDDEN]->setVar('name', _CM_HIDDEN);
51: }
52:
53: function &create()
54: {
55: $ret =new LegacyCommentstatusObject();
56: return $ret;
57: }
58:
59: function &get($id)
60: {
61: if (isset($this->_mResults[$id])) {
62: return $this->_mResults[$id];
63: }
64:
65: $ret = null;
66: return $ret;
67: }
68:
69: function &getObjects($criteria = null, $id_as_key = false)
70: {
71: if ($id_as_key) {
72: return $this->_mResults;
73: }
74: else {
75: $ret = array();
76:
77: foreach (array_keys($this->_mResults) as $key) {
78: $ret[] =& $this->_mResults[$key];
79: }
80:
81: return $ret;
82: }
83: }
84:
85: function insert(&$obj)
86: {
87: return false;
88: }
89:
90: function delete(&$obj)
91: {
92: return false;
93: }
94: }
95:
96: ?>
97: