XCL Web Application Platform
2.5.0
The XoopsCube Legacy Project
📘
Loading...
Searching...
No Matches
TplsetCloneForm.class.php
1
<?php
6
7
if
(!defined(
'XOOPS_ROOT_PATH'
)) {
8
exit();
9
}
10
11
require_once XOOPS_MODULE_PATH .
'/legacyRender/admin/forms/TplsetEditForm.class.php'
;
12
require_once XOOPS_MODULE_PATH .
'/legacy/class/Legacy_Validator.class.php'
;
13
14
/***
15
* @internal
16
* This class is generated by makeActionForm tool.
17
*/
18
class
LegacyRender_TplsetCloneForm
extends
LegacyRender_TplsetEditForm
19
{
20
public
function
getTokenName
()
21
{
22
return
'module.legacyRender.TplsetCloneForm.TOKEN'
. $this->
get
(
'tplset_id'
);
23
}
24
25
public
function
prepare
()
26
{
27
parent::prepare();
28
//
29
// Set form properties
30
//
31
$this->mFormProperties[
'tplset_id'
] =
new
XCube_IntProperty
(
'tplset_id'
);
32
$this->mFormProperties[
'tplset_name'
] =
new
XCube_StringProperty
(
'tplset_name'
);
33
$this->mFormProperties[
'tplset_credits'
] =
new
XCube_TextProperty
(
'tplset_credits'
);
34
35
//
36
// Set field properties
37
//
38
$this->mFieldProperties[
'tplset_name'
] =
new
XCube_FieldProperty
($this);
39
$this->mFieldProperties[
'tplset_name'
]->setDependsByArray([
'required'
,
'maxlength'
]);
40
$this->mFieldProperties[
'tplset_name'
]->addMessage(
'required'
, _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPLSET_NAME,
'50'
);
41
$this->mFieldProperties[
'tplset_name'
]->addMessage(
'maxlength'
, _AD_LEGACYRENDER_ERROR_MAXLENGTH, _AD_LEGACYRENDER_LANG_TPLSET_NAME,
'50'
);
42
$this->mFieldProperties[
'tplset_name'
]->addVar(
'maxlength'
, 50);
43
}
44
45
public
function
validateTplset_name()
46
{
47
//
48
// Check unique name
49
//
50
$handler = xoops_getmodulehandler(
'tplset'
);
51
52
if
(
null
!= $this->
get
(
'tplset_name'
)) {
53
if
($handler->getCount(
new
Criteria
(
'tplset_name'
, $this->
get
(
'tplset_name'
))) > 0) {
54
$this->
addErrorMessage
(_AD_LEGACYRENDER_ERROR_UNIQUE_NAME);
55
}
56
if
(!preg_match(
"/^[a-z0-9\_]+$/i"
, $this->
get
(
'tplset_name'
))) {
57
$this->
addErrorMessage
(_AD_LEGACYRENDER_ERROR_TPLSET_NAME_RULE);
58
}
59
}
60
}
61
62
public
function
load
(&$obj)
63
{
64
parent::load($obj);
65
$this->
set
(
'tplset_name'
, $obj->get(
'tplset_name'
));
66
}
67
68
public
function
update
(&$obj)
69
{
70
parent::update($obj);
71
$obj->set(
'tplset_name'
, $this->
get
(
'tplset_name'
));
72
$obj->set(
'tplset_id'
, 0);
73
}
74
}
Criteria
Definition
criteria.php:402
LegacyRender_TplsetCloneForm
Definition
TplsetCloneForm.class.php:19
LegacyRender_TplsetCloneForm\update
update(&$obj)
[Abstract] Updates an object with properties values.
Definition
TplsetCloneForm.class.php:68
LegacyRender_TplsetCloneForm\getTokenName
getTokenName()
Gets the token name of this actionform's token.
Definition
TplsetCloneForm.class.php:20
LegacyRender_TplsetCloneForm\prepare
prepare()
[Abstract] Set up form properties and field properties.
Definition
TplsetCloneForm.class.php:25
LegacyRender_TplsetCloneForm\load
load(&$obj)
[Abstract] Initializes properties' values from an object.
Definition
TplsetCloneForm.class.php:62
LegacyRender_TplsetEditForm
Definition
TplsetEditForm.class.php:15
XCube_ActionForm\addErrorMessage
addErrorMessage( $message)
Adds a message to the form's error message buffer.
Definition
XCube_ActionForm.class.php:386
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
legacyRender
admin
forms
TplsetCloneForm.class.php
Generated by
1.13.2