1: <?php
2: 3: 4: 5:
6:
7: if (!defined('XOOPS_ROOT_PATH')) exit();
8:
9: require_once XOOPS_MODULE_PATH . "/legacyRender/class/AbstractEditAction.class.php";
10: require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileCloneForm.class.php";
11:
12: class LegacyRender_TplfileCloneAction extends LegacyRender_AbstractEditAction
13: {
14: var $mTargetObject = null;
15:
16: function _getId()
17: {
18: return xoops_getrequest('tpl_id');
19: }
20:
21: function &_getHandler()
22: {
23: $handler =& xoops_getmodulehandler('tplfile');
24: return $handler;
25: }
26:
27: function _setupObject()
28: {
29: $id = $this->_getId();
30:
31: $this->mObjectHandler =& $this->_getHandler();
32: $obj =& $this->mObjectHandler->get($id);
33:
34:
35:
36:
37:
38: if (is_object($obj) && $obj->get('tpl_tplset') == 'default') {
39: $this->mObject =& $obj->createClone(xoops_getrequest('tpl_tplset'));
40: }
41: }
42:
43: function isEnableCreate()
44: {
45: return false;
46: }
47:
48: function _setupActionForm()
49: {
50: $this->mActionForm =new LegacyRender_TplfileCloneForm();
51: $this->mActionForm->prepare();
52: }
53:
54: function executeViewInput(&$controller, &$xoopsUser, &$render)
55: {
56: $render->setTemplateName("tplfile_clone.html");
57: $render->setAttribute('actionForm', $this->mActionForm);
58: $render->setAttribute('object', $this->mObject);
59: $render->setAttribute('tpl_id', xoops_getrequest('tpl_id'));
60: }
61:
62: function executeViewSuccess(&$controller, &$xoopsUser, &$render)
63: {
64: $tplset = $this->mObject->get('tpl_tplset');
65: $module = $this->mObject->get('tpl_module');
66: $controller->executeForward("./index.php?action=TplfileList&tpl_tplset=${tplset}&tpl_module=${module}");
67: }
68:
69: function executeViewError(&$controller, &$xoopsUser, &$render)
70: {
71: $controller->executeRedirect("./index.php?action=TplsetList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
72: }
73: }
74:
75: ?>
76: