XCL Web Application Platform
2.5.0
The XoopsCube Legacy Project
📘
Loading...
Searching...
No Matches
CommentAdminEditForm.class.php
1
<?php
11
12
if
(!defined(
'XOOPS_ROOT_PATH'
)) {
13
exit();
14
}
15
16
require_once XOOPS_ROOT_PATH .
'/core/XCube_ActionForm.class.php'
;
17
18
class
Legacy_AbstractCommentAdminEditForm
extends
XCube_ActionForm
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
97
class
Legacy_PendingCommentAdminEditForm
extends
Legacy_AbstractCommentAdminEditForm
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
112
class
Legacy_ApprovalCommentAdminEditForm
extends
Legacy_AbstractCommentAdminEditForm
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
}
Legacy_AbstractCommentAdminEditForm
Definition
CommentAdminEditForm.class.php:19
Legacy_AbstractCommentAdminEditForm\update
update(&$obj)
[Abstract] Updates an object with properties values.
Definition
CommentAdminEditForm.class.php:81
Legacy_AbstractCommentAdminEditForm\getTokenName
getTokenName()
Gets the token name of this actionform's token.
Definition
CommentAdminEditForm.class.php:20
Legacy_AbstractCommentAdminEditForm\prepare
prepare()
[Abstract] Set up form properties and field properties.
Definition
CommentAdminEditForm.class.php:25
Legacy_AbstractCommentAdminEditForm\load
load(&$obj)
[Abstract] Initializes properties' values from an object.
Definition
CommentAdminEditForm.class.php:66
Legacy_ApprovalCommentAdminEditForm
Definition
CommentAdminEditForm.class.php:113
Legacy_ApprovalCommentAdminEditForm\prepare
prepare()
[Abstract] Set up form properties and field properties.
Definition
CommentAdminEditForm.class.php:114
Legacy_PendingCommentAdminEditForm
Definition
CommentAdminEditForm.class.php:98
Legacy_PendingCommentAdminEditForm\prepare
prepare()
[Abstract] Set up form properties and field properties.
Definition
CommentAdminEditForm.class.php:99
XCube_ActionForm
Definition
XCube_ActionForm.class.php:51
XCube_BoolProperty
Represents bool property.
Definition
XCube_Property.class.php:440
XCube_FieldProperty
[Abstract] Used for validating member property values of XCube_ActionForm.
Definition
XCube_ActionForm.class.php:438
XCube_IntProperty
Represents int property.
Definition
XCube_Property.class.php:461
XCube_StringProperty
Represents string property.
Definition
XCube_Property.class.php:506
XCube_TextProperty
Represents string property which allows CR and LF.
Definition
XCube_Property.class.php:540
html
modules
legacy
admin
forms
CommentAdminEditForm.class.php
Generated by
1.13.2