1: <?php
2:
3: if (!defined('XOOPS_ROOT_PATH')) exit();
4:
5: require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php";
6: require_once XOOPS_MODULE_PATH . "/user/admin/forms/RanksAdminEditForm.class.php";
7:
8: class User_RanksEditAction extends User_AbstractEditAction
9: {
10: function _getId()
11: {
12: return xoops_getrequest('rank_id');
13: }
14:
15: function &_getHandler()
16: {
17: $handler =& xoops_getmodulehandler('ranks');
18: return $handler;
19: }
20:
21: function _setupActionForm()
22: {
23: $this->mActionForm =new User_RanksAdminEditForm();
24: $this->mActionForm->prepare();
25: }
26:
27: function _doExecute()
28: {
29: if ($this->mActionForm->mFormFile != null) {
30: @unlink(XOOPS_UPLOAD_PATH . "/" . $this->mActionForm->mOldFileName);
31: if (!$this->mActionForm->mFormFile->SaveAs(XOOPS_UPLOAD_PATH)) {
32: return USER_FRAME_VIEW_ERROR;
33: }
34: }
35:
36: return parent::_doExecute();
37: }
38:
39: function executeViewInput(&$controller, &$xoopsUser, &$render)
40: {
41: $render->setTemplateName("ranks_edit.html");
42: $render->setAttribute('actionForm', $this->mActionForm);
43: $render->setAttribute('object', $this->mObject);
44: }
45:
46: function executeViewSuccess(&$controller, &$xoopsUser, &$render)
47: {
48: $controller->executeForward("./index.php?action=RanksList");
49: }
50:
51: function executeViewError(&$controller, &$xoopsUser, &$render)
52: {
53: $controller->executeRedirect("./index.php?action=RanksList", 1, _MD_USER_ERROR_DBUPDATE_FAILED);
54: }
55:
56: function executeViewCancel(&$controller, &$xoopsUser, &$render)
57: {
58: $controller->executeForward("./index.php?action=RanksList");
59: }
60: }
61:
62: ?>
63: