XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
ImagecategoryEditAction.class.php
1<?php
11
12if (!defined('XOOPS_ROOT_PATH')) {
13 exit();
14}
15
16require_once XOOPS_MODULE_PATH . '/legacy/class/AbstractEditAction.class.php';
17require_once XOOPS_MODULE_PATH . '/legacy/admin/forms/ImagecategoryAdminEditForm.class.php';
18require_once XOOPS_MODULE_PATH . '/legacy/admin/forms/ImagecategoryAdminNewForm.class.php';
19
21{
22 public function _getId()
23 {
24 return isset($_REQUEST['imgcat_id']) ? xoops_getrequest('imgcat_id') : 0;
25 }
26
27 public function &_getHandler()
28 {
29 $handler =& xoops_getmodulehandler('imagecategory');
30 return $handler;
31 }
32
33 public function _setupObject()
34 {
35 parent::_setupObject();
36 $this->mObject->loadReadGroups();
37 $this->mObject->loadUploadGroups();
38 }
39
40 public function _setupActionForm()
41 {
42 $this->mActionForm = $this->mObject->isNew() ? new Legacy_ImagecategoryAdminNewForm()
44
45 $this->mActionForm->prepare();
46 }
47
48 public function executeViewInput(&$controller, &$xoopsUser, &$render)
49 {
50 $render->setTemplateName('imagecategory_edit.html');
51 $render->setAttribute('actionForm', $this->mActionForm);
52 $render->setAttribute('object', $this->mObject);
53
54 $handler =& xoops_gethandler('group');
55 $groupArr =& $handler->getObjects();
56 $render->setAttribute('groupArr', $groupArr);
57 }
58
59 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
60 {
61 $controller->executeForward('./index.php?action=ImagecategoryList');
62 }
63
64 public function executeViewError(&$controller, &$xoopsUser, &$render)
65 {
66 $controller->executeRedirect('./index.php?action=ImagecategoryList', 1, _MD_LEGACY_ERROR_DBUPDATE_FAILED);
67 }
68
69 public function executeViewCancel(&$controller, &$xoopsUser, &$render)
70 {
71 $controller->executeForward('./index.php?action=ImagecategoryList');
72 }
73}