XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
CommentAdminEditForm.class.php
1<?php
11
12if (!defined('XOOPS_ROOT_PATH')) {
13 exit();
14}
15
16require_once XOOPS_ROOT_PATH . '/core/XCube_ActionForm.class.php';
17
19{
20 public function getTokenName()
21 {
22 return 'module.legacy.CommentAdminEditForm.TOKEN' . $this->get('com_id');
23 }
24
25 public function prepare()
26 {
27 //
28 // Set form properties
29 //
30 $this->mFormProperties['com_id'] =new XCube_IntProperty('com_id');
31 $this->mFormProperties['com_icon'] =new XCube_StringProperty('com_icon');
32 $this->mFormProperties['com_title'] =new XCube_StringProperty('com_title');
33 $this->mFormProperties['com_text'] =new XCube_TextProperty('com_text');
34 $this->mFormProperties['com_sig'] =new XCube_BoolProperty('com_sig');
35 $this->mFormProperties['com_status'] =new XCube_IntProperty('com_status');
36 $this->mFormProperties['dohtml'] =new XCube_BoolProperty('dohtml');
37 $this->mFormProperties['dosmiley'] =new XCube_BoolProperty('dosmiley');
38 $this->mFormProperties['doxcode'] =new XCube_BoolProperty('doxcode');
39 $this->mFormProperties['doimage'] =new XCube_BoolProperty('doimage');
40 $this->mFormProperties['dobr'] =new XCube_BoolProperty('dobr');
41
42 //
43 // Set field properties
44 //
45
46 $this->mFieldProperties['com_id'] =new XCube_FieldProperty($this);
47 $this->mFieldProperties['com_id']->setDependsByArray(['required']);
48 $this->mFieldProperties['com_id']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _MD_LEGACY_LANG_COM_ID);
49
50 $this->mFieldProperties['com_icon'] =new XCube_FieldProperty($this);
51 $this->mFieldProperties['com_icon']->setDependsByArray(['maxlength']);
52 $this->mFieldProperties['com_icon']->addMessage('maxlength', _MD_LEGACY_ERROR_MAXLENGTH, _MD_LEGACY_LANG_COM_ICON, '25');
53 $this->mFieldProperties['com_icon']->addVar('maxlength', '25');
54
55 $this->mFieldProperties['com_title'] =new XCube_FieldProperty($this);
56 $this->mFieldProperties['com_title']->setDependsByArray(['required', 'maxlength']);
57 $this->mFieldProperties['com_title']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _MD_LEGACY_LANG_COM_TITLE, '191');
58 $this->mFieldProperties['com_title']->addMessage('maxlength', _MD_LEGACY_ERROR_MAXLENGTH, _MD_LEGACY_LANG_COM_TITLE, '191');
59 $this->mFieldProperties['com_title']->addVar('maxlength', '191');
60
61 $this->mFieldProperties['com_text'] =new XCube_FieldProperty($this);
62 $this->mFieldProperties['com_text']->setDependsByArray(['required']);
63 $this->mFieldProperties['com_text']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _MD_LEGACY_LANG_COM_TEXT);
64 }
65
66 public function load(&$obj)
67 {
68 $this->set('com_id', $obj->get('com_id'));
69 $this->set('com_icon', $obj->get('com_icon'));
70 $this->set('com_title', $obj->get('com_title'));
71 $this->set('com_text', $obj->get('com_text'));
72 $this->set('com_sig', $obj->get('com_sig'));
73 $this->set('com_status', $obj->get('com_status'));
74 $this->set('dohtml', $obj->get('dohtml'));
75 $this->set('dosmiley', $obj->get('dosmiley'));
76 $this->set('doxcode', $obj->get('doxcode'));
77 $this->set('doimage', $obj->get('doimage'));
78 $this->set('dobr', $obj->get('dobr'));
79 }
80
81 public function update(&$obj)
82 {
83 $obj->set('com_id', $this->get('com_id'));
84 $obj->set('com_icon', $this->get('com_icon'));
85 $obj->set('com_title', $this->get('com_title'));
86 $obj->set('com_text', $this->get('com_text'));
87 $obj->set('com_sig', $this->get('com_sig'));
88 $obj->set('com_status', $this->get('com_status'));
89 $obj->set('dohtml', $this->get('dohtml'));
90 $obj->set('dosmiley', $this->get('dosmiley'));
91 $obj->set('doxcode', $this->get('doxcode'));
92 $obj->set('doimage', $this->get('doimage'));
93 $obj->set('dobr', $this->get('dobr'));
94 }
95}
96
98{
99 public function prepare()
100 {
101 parent::prepare();
102
103 $this->mFieldProperties['com_status'] =new XCube_FieldProperty($this);
104 $this->mFieldProperties['com_status']->setDependsByArray(['required', 'intRange']);
105 $this->mFieldProperties['com_status']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_COM_STATUS);
106 $this->mFieldProperties['com_status']->addMessage('intRange', _AD_LEGACY_ERROR_INTRANGE, _AD_LEGACY_LANG_COM_STATUS);
107 $this->mFieldProperties['com_status']->addVar('min', '1');
108 $this->mFieldProperties['com_status']->addVar('max', '3');
109 }
110}
111
113{
114 public function prepare()
115 {
116 parent::prepare();
117
118 $this->mFieldProperties['com_status'] =new XCube_FieldProperty($this);
119 $this->mFieldProperties['com_status']->setDependsByArray(['required', 'intRange']);
120 $this->mFieldProperties['com_status']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_COM_STATUS);
121 $this->mFieldProperties['com_status']->addMessage('intRange', _AD_LEGACY_ERROR_INTRANGE, _AD_LEGACY_LANG_COM_STATUS);
122 $this->mFieldProperties['com_status']->addVar('min', '2');
123 $this->mFieldProperties['com_status']->addVar('max', '3');
124 }
125}
update(&$obj)
[Abstract] Updates an object with properties values.
getTokenName()
Gets the token name of this actionform's token.
prepare()
[Abstract] Set up form properties and field properties.
load(&$obj)
[Abstract] Initializes properties' values from an object.
prepare()
[Abstract] Set up form properties and field properties.
prepare()
[Abstract] Set up form properties and field properties.
Represents bool property.
[Abstract] Used for validating member property values of XCube_ActionForm.
Represents int property.
Represents string property.
Represents string property which allows CR and LF.