1: <?php
2: 3: 4: 5:
6:
7: if (!defined('XOOPS_ROOT_PATH')) exit();
8:
9: require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileEditForm.class.php";
10: require_once XOOPS_MODULE_PATH . "/legacy/class/Legacy_Validator.class.php";
11:
12: class LegacyRender_TplfileCloneForm extends LegacyRender_TplfileEditForm
13: {
14: function getTokenName()
15: {
16: return "module.legacyRender.TplfileCloneForm.TOKEN";
17: }
18:
19: function prepare()
20: {
21: parent::prepare();
22:
23:
24:
25:
26: $this->mFormProperties['tpl_tplset'] =new XCube_StringProperty('tpl_tplset');
27:
28:
29:
30:
31: $this->mFieldProperties['tpl_tplset'] =new XCube_FieldProperty($this);
32: $this->mFieldProperties['tpl_tplset']->setDependsByArray(array('required'));
33: $this->mFieldProperties['tpl_tplset']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_TPLSET);
34: }
35:
36: function validateTpl_tplset()
37: {
38: $tplset = $this->get('tpl_tplset');
39:
40: $handler =& xoops_getmodulehandler('tplset', 'legacyRender');
41: $criteria =new Criteria('tplset_name', $this->get('tpl_tplset'));
42: $objs =& $handler->getObjects($criteria);
43:
44: if (count($objs) == 0) {
45: $this->addErrorMessage(_AD_LEGACYRENDER_ERROR_TPLSET_WRONG);
46: }
47: }
48:
49: function load(&$obj)
50: {
51: parent::load($obj);
52: $this->set('tpl_tplset', $obj->get('tpl_tplset'));
53: }
54:
55: function update(&$obj)
56: {
57: $obj->loadSource();
58:
59: $obj->set('tpl_desc', $this->get('tpl_desc'));
60: $obj->set('tpl_lastmodified', time());
61:
62: $obj->Source->set('tpl_source', $this->get('tpl_source'));
63: }
64: }
65:
66: ?>
67: