1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: if (!defined('XOOPS_ROOT_PATH')) exit();
12:
13: class LegacyBlockctypeObject extends XoopsSimpleObject
14: {
15: function LegacyBlockctypeObject()
16: {
17: $this->initVar('type', XOBJ_DTYPE_STRING, '', true);
18: $this->initVar('label', XOBJ_DTYPE_STRING, '', true, 255);
19: }
20: }
21:
22: class LegacyBlockctypeHandler extends XoopsObjectHandler
23: {
24: var $_mResults = array();
25:
26: function LegacyBlockctypeHandler(&$db)
27: {
28: $t_arr = array (
29: 'H' => _AD_LEGACY_LANG_CTYPE_HTML,
30: 'P' => _AD_LEGACY_LANG_CTYPE_PHP,
31: 'S' => _AD_LEGACY_LANG_CTYPE_WITH_SMILIES,
32: 'T' => _AD_LEGACY_LANG_CTYPE_WITHOUT_SMILIES
33: );
34:
35: foreach ($t_arr as $id => $name) {
36: $this->_mResults[$id] =& $this->create();
37: $this->_mResults[$id]->setVar('type', $id);
38: $this->_mResults[$id]->setVar('label', $name);
39: }
40: }
41:
42: function &create()
43: {
44: $ret =new LegacyBlockctypeObject();
45: return $ret;
46: }
47:
48: function &get($id)
49: {
50: if (isset($this->_mResults[$id])) {
51: return $this->_mResults[$id];
52: }
53:
54: $ret = null;
55: return $ret;
56: }
57:
58: function &getObjects($criteria = null, $id_as_key = false)
59: {
60: if ($id_as_key) {
61: return $this->_mResults;
62: }
63: else {
64: $ret = array();
65:
66: foreach (array_keys($this->_mResults) as $key) {
67: $ret[] =& $this->_mResults[$key];
68: }
69:
70: return $ret;
71: }
72: }
73:
74: function insert(&$obj)
75: {
76: return false;
77: }
78:
79: function delete(&$obj)
80: {
81: return false;
82: }
83: }
84:
85: ?>
86: