1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: if (!defined('XOOPS_ROOT_PATH')) exit();
12:
13: require_once XOOPS_MODULE_PATH . "/legacy/class/AbstractEditAction.class.php";
14: require_once XOOPS_MODULE_PATH . "/legacy/admin/forms/SmilesAdminEditForm.class.php";
15:
16: class Legacy_SmilesEditAction extends Legacy_AbstractEditAction
17: {
18: function _getId()
19: {
20: return isset($_REQUEST['id']) ? xoops_getrequest('id') : 0;
21: }
22:
23: function &_getHandler()
24: {
25: $handler =& xoops_getmodulehandler('smiles');
26: return $handler;
27: }
28:
29: function _setupActionForm()
30: {
31: $this->mActionForm =new Legacy_SmilesAdminEditForm();
32: $this->mActionForm->prepare();
33: }
34:
35:
36: function _doExecute()
37: {
38: if ($this->mActionForm->mFormFile != null) {
39: if (!$this->mActionForm->mFormFile->saveAs(XOOPS_UPLOAD_PATH)) {
40: return false;
41: }
42: }
43:
44:
45:
46:
47: if ($this->mActionForm->mOldFilename != null && $this->mActionForm->mOldFilename != "blank.gif") {
48: @unlink(XOOPS_UPLOAD_PATH . "/" . $this->mActionForm->mOldFilename);
49: }
50:
51: return parent::_doExecute();
52: }
53:
54: function executeViewInput(&$controller, &$xoopsUser, &$render)
55: {
56: $render->setTemplateName("smiles_edit.html");
57: $render->setAttribute('actionForm', $this->mActionForm);
58: $render->setAttribute('object', $this->mObject);
59: }
60:
61: function executeViewSuccess(&$controller, &$xoopsUser, &$render)
62: {
63: $controller->executeForward("./index.php?action=SmilesList");
64: }
65:
66: function executeViewError(&$controller, &$xoopsUser, &$render)
67: {
68: $controller->executeRedirect("./index.php?action=SmilesList", 1, _MD_LEGACY_ERROR_DBUPDATE_FAILED);
69: }
70:
71: function executeViewCancel(&$controller, &$xoopsUser, &$render)
72: {
73: $controller->executeForward("./index.php?action=SmilesList");
74: }
75: }
76:
77: ?>
78: