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 LegacyColumnsideObject extends XoopsSimpleObject
16: {
17: function LegacyColumnsideObject()
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 LegacyColumnsideHandler extends XoopsObjectHandler
31: {
32: var $_mResults = array();
33:
34: function LegacyColumnsideHandler(&$db)
35: {
36: $t_arr = array (
37: 0 => _AD_LEGACY_LANG_SIDE_BLOCK_LEFT,
38: 1 => _AD_LEGACY_LANG_SIDE_BLOCK_RIGHT,
39: 3 => _AD_LEGACY_LANG_CENTER_BLOCK_LEFT,
40: 4 => _AD_LEGACY_LANG_CENTER_BLOCK_RIGHT,
41: 5 => _AD_LEGACY_LANG_CENTER_BLOCK_CENTER
42: );
43:
44: foreach ($t_arr as $id => $name) {
45: $this->_mResults[$id] =& $this->create();
46: $this->_mResults[$id]->setVar('id', $id);
47: $this->_mResults[$id]->setVar('name', $name);
48: }
49: }
50:
51: function &create()
52: {
53: $ret =new LegacyColumnsideObject();
54: return $ret;
55: }
56:
57: function &get($id)
58: {
59: if (isset($this->_mResults[$id])) {
60: return $this->_mResults[$id];
61: }
62:
63: $ret = null;
64: return $ret;
65: }
66:
67: function &getObjects($criteria = null, $id_as_key = false)
68: {
69: if ($id_as_key) {
70: return $this->_mResults;
71: }
72: else {
73: $ret = array();
74:
75: foreach (array_keys($this->_mResults) as $key) {
76: $ret[] =& $this->_mResults[$key];
77: }
78:
79: return $ret;
80: }
81: }
82:
83: function insert(&$obj)
84: {
85: return false;
86: }
87:
88: function delete(&$obj)
89: {
90: return false;
91: }
92: }
93:
94: ?>
95: