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 . "/core/XCube_ActionForm.class.php";
14:
15: class Legacy_AbstractCommentAdminEditForm extends XCube_ActionForm
16: {
17: function getTokenName()
18: {
19: return "module.legacy.CommentAdminEditForm.TOKEN" . $this->get('com_id');
20: }
21:
22: function prepare()
23: {
24:
25:
26:
27: $this->mFormProperties['com_id'] =new XCube_IntProperty('com_id');
28: $this->mFormProperties['com_icon'] =new XCube_StringProperty('com_icon');
29: $this->mFormProperties['com_title'] =new XCube_StringProperty('com_title');
30: $this->mFormProperties['com_text'] =new XCube_TextProperty('com_text');
31: $this->mFormProperties['com_sig'] =new XCube_BoolProperty('com_sig');
32: $this->mFormProperties['com_status'] =new XCube_IntProperty('com_status');
33: $this->mFormProperties['dohtml'] =new XCube_BoolProperty('dohtml');
34: $this->mFormProperties['dosmiley'] =new XCube_BoolProperty('dosmiley');
35: $this->mFormProperties['doxcode'] =new XCube_BoolProperty('doxcode');
36: $this->mFormProperties['doimage'] =new XCube_BoolProperty('doimage');
37: $this->mFormProperties['dobr'] =new XCube_BoolProperty('dobr');
38:
39:
40:
41:
42:
43: $this->mFieldProperties['com_id'] =new XCube_FieldProperty($this);
44: $this->mFieldProperties['com_id']->setDependsByArray(array('required'));
45: $this->mFieldProperties['com_id']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _MD_LEGACY_LANG_COM_ID);
46:
47: $this->mFieldProperties['com_icon'] =new XCube_FieldProperty($this);
48: $this->mFieldProperties['com_icon']->setDependsByArray(array('maxlength'));
49: $this->mFieldProperties['com_icon']->addMessage('maxlength', _MD_LEGACY_ERROR_MAXLENGTH, _MD_LEGACY_LANG_COM_ICON, '25');
50: $this->mFieldProperties['com_icon']->addVar('maxlength', '25');
51:
52: $this->mFieldProperties['com_title'] =new XCube_FieldProperty($this);
53: $this->mFieldProperties['com_title']->setDependsByArray(array('required','maxlength'));
54: $this->mFieldProperties['com_title']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _MD_LEGACY_LANG_COM_TITLE, '255');
55: $this->mFieldProperties['com_title']->addMessage('maxlength', _MD_LEGACY_ERROR_MAXLENGTH, _MD_LEGACY_LANG_COM_TITLE, '255');
56: $this->mFieldProperties['com_title']->addVar('maxlength', '255');
57:
58: $this->mFieldProperties['com_text'] =new XCube_FieldProperty($this);
59: $this->mFieldProperties['com_text']->setDependsByArray(array('required'));
60: $this->mFieldProperties['com_text']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _MD_LEGACY_LANG_COM_TEXT);
61: }
62:
63: function load(&$obj)
64: {
65: $this->set('com_id', $obj->get('com_id'));
66: $this->set('com_icon', $obj->get('com_icon'));
67: $this->set('com_title', $obj->get('com_title'));
68: $this->set('com_text', $obj->get('com_text'));
69: $this->set('com_sig', $obj->get('com_sig'));
70: $this->set('com_status', $obj->get('com_status'));
71: $this->set('dohtml', $obj->get('dohtml'));
72: $this->set('dosmiley', $obj->get('dosmiley'));
73: $this->set('doxcode', $obj->get('doxcode'));
74: $this->set('doimage', $obj->get('doimage'));
75: $this->set('dobr', $obj->get('dobr'));
76: }
77:
78: function update(&$obj)
79: {
80: $obj->set('com_id', $this->get('com_id'));
81: $obj->set('com_icon', $this->get('com_icon'));
82: $obj->set('com_title', $this->get('com_title'));
83: $obj->set('com_text', $this->get('com_text'));
84: $obj->set('com_sig', $this->get('com_sig'));
85: $obj->set('com_status', $this->get('com_status'));
86: $obj->set('dohtml', $this->get('dohtml'));
87: $obj->set('dosmiley', $this->get('dosmiley'));
88: $obj->set('doxcode', $this->get('doxcode'));
89: $obj->set('doimage', $this->get('doimage'));
90: $obj->set('dobr', $this->get('dobr'));
91: }
92: }
93:
94: class Legacy_PendingCommentAdminEditForm extends Legacy_AbstractCommentAdminEditForm
95: {
96: function prepare()
97: {
98: parent::prepare();
99:
100: $this->mFieldProperties['com_status'] =new XCube_FieldProperty($this);
101: $this->mFieldProperties['com_status']->setDependsByArray(array('required','intRange'));
102: $this->mFieldProperties['com_status']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_COM_STATUS);
103: $this->mFieldProperties['com_status']->addMessage('intRange', _AD_LEGACY_ERROR_INTRANGE, _AD_LEGACY_LANG_COM_STATUS);
104: $this->mFieldProperties['com_status']->addVar('min', '1');
105: $this->mFieldProperties['com_status']->addVar('max', '3');
106: }
107: }
108:
109: class Legacy_ApprovalCommentAdminEditForm extends Legacy_AbstractCommentAdminEditForm
110: {
111: function prepare()
112: {
113: parent::prepare();
114:
115: $this->mFieldProperties['com_status'] =new XCube_FieldProperty($this);
116: $this->mFieldProperties['com_status']->setDependsByArray(array('required','intRange'));
117: $this->mFieldProperties['com_status']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_COM_STATUS);
118: $this->mFieldProperties['com_status']->addMessage('intRange', _AD_LEGACY_ERROR_INTRANGE, _AD_LEGACY_LANG_COM_STATUS);
119: $this->mFieldProperties['com_status']->addVar('min', '2');
120: $this->mFieldProperties['com_status']->addVar('max', '3');
121: }
122: }
123:
124:
125: ?>
126: