XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
TplfileEditForm.class.php
1<?php
6
7if (!defined('XOOPS_ROOT_PATH')) {
8 exit();
9}
10
11require_once XOOPS_ROOT_PATH . '/core/XCube_ActionForm.class.php';
12
13/***
14 * @internal
15 * This class is generated by makeActionForm tool.
16 */
18{
19 public function getTokenName()
20 {
21 return 'module.legacyRender.TplfileEditForm.TOKEN.' . $this->get('tpl_id');
22 }
23
24 public function prepare()
25 {
26 //
27 // Set form properties
28 //
29 $this->mFormProperties['tpl_id'] =new XCube_IntProperty('tpl_id');
30 $this->mFormProperties['tpl_desc'] =new XCube_StringProperty('tpl_desc');
31 $this->mFormProperties['tpl_source'] =new XCube_TextProperty('tpl_source');
32
33 //
34 // Set field properties
35 //
36 $this->mFieldProperties['tpl_id'] =new XCube_FieldProperty($this);
37 $this->mFieldProperties['tpl_id']->setDependsByArray(['required']);
38 $this->mFieldProperties['tpl_id']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_ID);
39
40 $this->mFieldProperties['tpl_desc'] =new XCube_FieldProperty($this);
41 $this->mFieldProperties['tpl_desc']->setDependsByArray(['maxlength']);
42 $this->mFieldProperties['tpl_desc']->addMessage('maxlength', _AD_LEGACYRENDER_ERROR_MAXLENGTH, _AD_LEGACYRENDER_LANG_TPL_DESC, '255');
43 $this->mFieldProperties['tpl_desc']->addVar('maxlength', 255);
44
45 $this->mFieldProperties['tpl_source'] =new XCube_FieldProperty($this);
46 $this->mFieldProperties['tpl_source']->setDependsByArray(['required']);
47 $this->mFieldProperties['tpl_source']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_SOURCE);
48 }
49
50 public function load(&$obj)
51 {
52 $obj->loadSource();
53
54 $this->set('tpl_id', $obj->get('tpl_id'));
55 $this->set('tpl_desc', $obj->get('tpl_desc'));
56 $this->set('tpl_source', $obj->Source->get('tpl_source'));
57 }
58
59 public function update(&$obj)
60 {
61 $obj->loadSource();
62
63 $obj->set('tpl_id', $this->get('tpl_id'));
64 $obj->set('tpl_desc', $this->get('tpl_desc'));
65
66 $obj->set('tpl_lastmodified', time());
67
68 $obj->Source->set('tpl_source', $this->get('tpl_source'));
69 }
70}
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.
[Abstract] Used for validating member property values of XCube_ActionForm.
Represents int property.
Represents string property.
Represents string property which allows CR and LF.