1: <?php
2: 3: 4: 5:
6:
7: if (!defined('XOOPS_ROOT_PATH')) exit();
8:
9: require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
10:
11: 12: 13: 14:
15: class LegacyRender_TplfileEditForm extends XCube_ActionForm
16: {
17: function getTokenName()
18: {
19: return "module.legacyRender.TplfileEditForm.TOKEN." . $this->get('tpl_id');
20: }
21:
22: function prepare()
23: {
24:
25:
26:
27: $this->mFormProperties['tpl_id'] =new XCube_IntProperty('tpl_id');
28: $this->mFormProperties['tpl_desc'] =new XCube_StringProperty('tpl_desc');
29: $this->mFormProperties['tpl_source'] =new XCube_TextProperty('tpl_source');
30:
31:
32:
33:
34: $this->mFieldProperties['tpl_id'] =new XCube_FieldProperty($this);
35: $this->mFieldProperties['tpl_id']->setDependsByArray(array('required'));
36: $this->mFieldProperties['tpl_id']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_ID);
37:
38: $this->mFieldProperties['tpl_desc'] =new XCube_FieldProperty($this);
39: $this->mFieldProperties['tpl_desc']->setDependsByArray(array('maxlength'));
40: $this->mFieldProperties['tpl_desc']->addMessage('maxlength', _AD_LEGACYRENDER_ERROR_MAXLENGTH, _AD_LEGACYRENDER_LANG_TPL_DESC, '255');
41: $this->mFieldProperties['tpl_desc']->addVar('maxlength', 255);
42:
43: $this->mFieldProperties['tpl_source'] =new XCube_FieldProperty($this);
44: $this->mFieldProperties['tpl_source']->setDependsByArray(array('required'));
45: $this->mFieldProperties['tpl_source']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_SOURCE);
46: }
47:
48: function load(&$obj)
49: {
50: $obj->loadSource();
51:
52: $this->set('tpl_id', $obj->get('tpl_id'));
53: $this->set('tpl_desc', $obj->get('tpl_desc'));
54: $this->set('tpl_source', $obj->Source->get('tpl_source'));
55: }
56:
57: function update(&$obj)
58: {
59: $obj->loadSource();
60:
61: $obj->set('tpl_id', $this->get('tpl_id'));
62: $obj->set('tpl_desc', $this->get('tpl_desc'));
63:
64: $obj->set('tpl_lastmodified', time());
65:
66: $obj->Source->set('tpl_source', $this->get('tpl_source'));
67: }
68: }
69:
70: ?>
71: