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