1: <?php
2:
3: if (!defined('XOOPS_ROOT_PATH')) exit();
4:
5: require_once XOOPS_MODULE_PATH . "/legacyRender/class/AbstractDeleteAction.class.php";
6: require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileAdminDeleteForm.class.php";
7:
8: class LegacyRender_TplfileDeleteAction extends LegacyRender_AbstractDeleteAction
9: {
10: function _getId()
11: {
12: return xoops_getrequest('tpl_id');
13: }
14:
15: function &_getHandler()
16: {
17: $handler =& xoops_getmodulehandler('tplfile');
18: return $handler;
19: }
20:
21: function _setupObject()
22: {
23: parent::_setupObject();
24: if ($this->mObject != null && $this->mObject->get('tpl_tplset') == 'default') {
25: $this->mObject = null;
26: }
27: }
28:
29: function _setupActionForm()
30: {
31: $this->mActionForm =new LegacyRender_TplfileAdminDeleteForm();
32: $this->mActionForm->prepare();
33: }
34:
35: function executeViewInput(&$controller, &$xoopsUser, &$render)
36: {
37: $render->setTemplateName("tplfile_delete.html");
38: $render->setAttribute('actionForm', $this->mActionForm);
39: $this->mObject->loadSource();
40: $render->setAttribute('object', $this->mObject);
41: }
42:
43: function executeViewSuccess(&$controller, &$xoopsUser, &$render)
44: {
45: require_once XOOPS_ROOT_PATH . "/class/template.php";
46:
47: $xoopsTpl =new XoopsTpl();
48: $xoopsTpl->clear_cache('db:' . $this->mObject->get('tpl_file'));
49: $xoopsTpl->clear_compiled_tpl('db:' . $this->mObject->get('tpl_file'));
50:
51: $tplset = $this->mObject->get('tpl_tplset');
52: $module = $this->mObject->get('tpl_module');
53: $controller->executeForward("./index.php?action=TplfileList&tpl_tplset=${tplset}&tpl_module=${module}");
54: }
55:
56: function executeViewError(&$controller, &$xoopsUser, &$render)
57: {
58: $controller->executeRedirect("./index.php?action=TplfileList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
59: }
60:
61: function executeViewCancel(&$controller, &$xoopsUser, &$render)
62: {
63: $tplset = $this->mObject->get('tpl_tplset');
64: $module = $this->mObject->get('tpl_module');
65: $controller->executeForward("./index.php?action=TplfileList&tpl_tplset=${tplset}&tpl_module=${module}");
66: }
67: }
68:
69: ?>
70: