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