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/TplfileEditForm.class.php";
11:
12: class LegacyRender_TplfileEditAction extends LegacyRender_AbstractEditAction
13: {
14: function _getId()
15: {
16: return xoops_getrequest('tpl_id');
17: }
18:
19: function &_getHandler()
20: {
21: $handler =& xoops_getmodulehandler('tplfile');
22: return $handler;
23: }
24:
25: function _setupObject()
26: {
27: parent::_setupObject();
28:
29: if (is_object($this->mObject) && $this->mObject->get('tpl_tplset') == 'default') {
30: $this->mObject = null;
31: }
32: }
33:
34: function _setupActionForm()
35: {
36: $this->mActionForm =new LegacyRender_TplfileEditForm();
37: $this->mActionForm->prepare();
38: }
39:
40: function isEnableCreate()
41: {
42: return false;
43: }
44:
45: function executeViewInput(&$controller, &$xoopsUser, &$render)
46: {
47: $render->setTemplateName("tplfile_edit.html");
48: $render->setAttribute('actionForm', $this->mActionForm);
49: $render->setAttribute('object', $this->mObject);
50: }
51:
52: function executeViewSuccess(&$controller, &$xoopsUser, &$render)
53: {
54:
55:
56:
57:
58: require_once XOOPS_ROOT_PATH . "/class/template.php";
59:
60: $xoopsTpl =new XoopsTpl();
61: $xoopsTpl->clear_cache('db:' . $this->mObject->get('tpl_file'));
62: $xoopsTpl->clear_compiled_tpl('db:' . $this->mObject->get('tpl_file'));
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: function executeViewCancel(&$controller, &$xoopsUser, &$render)
75: {
76: $tplset = $this->mObject->get('tpl_tplset');
77: $module = $this->mObject->get('tpl_module');
78: $controller->executeForward("./index.php?action=TplfileList&tpl_tplset=${tplset}&tpl_module=${module}");
79: }
80: }
81:
82: ?>
83: