XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
TplfileEditAction.class.php
1<?php
7
8if (!defined('XOOPS_ROOT_PATH')) {
9 exit();
10}
11
12require_once XOOPS_MODULE_PATH . '/legacyRender/class/AbstractEditAction.class.php';
13require_once XOOPS_MODULE_PATH . '/legacyRender/admin/forms/TplfileEditForm.class.php';
14
16{
17 public function _getId()
18 {
19 return xoops_getrequest('tpl_id');
20 }
21
22 public function &_getHandler()
23 {
24 $handler =& xoops_getmodulehandler('tplfile');
25 return $handler;
26 }
27
28 public function _setupObject()
29 {
30 parent::_setupObject();
31
32 if (is_object($this->mObject) && 'default' == $this->mObject->get('tpl_tplset')) {
33 $this->mObject = null;
34 }
35 }
36
37 public function _setupActionForm()
38 {
39 $this->mActionForm =new LegacyRender_TplfileEditForm();
40 $this->mActionForm->prepare();
41 }
42
43 public function isEnableCreate()
44 {
45 return false;
46 }
47
48 public function executeViewInput(&$controller, &$xoopsUser, &$render)
49 {
50 $render->setTemplateName('tplfile_edit.html');
51 $render->setAttribute('actionForm', $this->mActionForm);
52 $render->setAttribute('object', $this->mObject);
53 }
54
55 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
56 {
57 //
58 // This class knows the db template mechanism, because this is in
59 // LegacyRender.
60 //
61 require_once XOOPS_ROOT_PATH . '/class/template.php';
62
63 $xoopsTpl =new XoopsTpl();
64 $xoopsTpl->clear_cache('db:' . $this->mObject->get('tpl_file'));
65 $xoopsTpl->clear_compiled_tpl('db:' . $this->mObject->get('tpl_file'));
66
67 $tplset = $this->mObject->get('tpl_tplset');
68 $module = $this->mObject->get('tpl_module');
69 $controller->executeForward("./index.php?action=TplfileList&tpl_tplset={$tplset}&tpl_module={$module}");
70 }
71
72 public function executeViewError(&$controller, &$xoopsUser, &$render)
73 {
74 $controller->executeRedirect('./index.php?action=TplsetList', 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
75 }
76
77 public function executeViewCancel(&$controller, &$xoopsUser, &$render)
78 {
79 $tplset = $this->mObject->get('tpl_tplset');
80 $module = $this->mObject->get('tpl_module');
81 $controller->executeForward("./index.php?action=TplfileList&tpl_tplset={$tplset}&tpl_module={$module}");
82 }
83}