XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
blockctype.php
1<?php
10
11if (!defined('XOOPS_ROOT_PATH')) {
12 exit();
13}
14
16{
17 public function __construct()
18 {
19 $this->initVar('type', XOBJ_DTYPE_STRING, '', true);
20 $this->initVar('label', XOBJ_DTYPE_STRING, '', true, 191);
21 }
22}
23
25{
26 public $_mResults = [];
27
28 public function __construct(&$db)
29 {
30 $t_arr = [
31 'H' => _AD_LEGACY_LANG_CTYPE_HTML,
32 'P' => _AD_LEGACY_LANG_CTYPE_PHP,
33 'S' => _AD_LEGACY_LANG_CTYPE_WITH_SMILIES,
34 'T' => _AD_LEGACY_LANG_CTYPE_WITHOUT_SMILIES
35 ];
36
37 foreach ($t_arr as $id => $name) {
38 $this->_mResults[$id] =& $this->create();
39 $this->_mResults[$id]->setVar('type', $id);
40 $this->_mResults[$id]->setVar('label', $name);
41 }
42 }
43
44 public function &create()
45 {
46 $ret =new LegacyBlockctypeObject();
47 return $ret;
48 }
49
50 public function &get($id)
51 {
52 if (isset($this->_mResults[$id])) {
53 return $this->_mResults[$id];
54 }
55
56 $ret = null;
57 return $ret;
58 }
59
60 public function &getObjects($criteria = null, $id_as_key = false)
61 {
62 if ($id_as_key) {
63 return $this->_mResults;
64 } else {
65 $ret = [];
66
67 foreach (array_keys($this->_mResults) as $key) {
68 $ret[] =& $this->_mResults[$key];
69 }
70
71 return $ret;
72 }
73 }
74
75 public function insert(&$obj)
76 {
77 return false;
78 }
79
80 public function delete(&$obj)
81 {
82 return false;
83 }
84}