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/ImagecategoryAdminEditForm.class.php";
15: require_once XOOPS_MODULE_PATH . "/legacy/admin/forms/ImagecategoryAdminNewForm.class.php";
16:
17: class Legacy_ImagecategoryEditAction extends Legacy_AbstractEditAction
18: {
19: function _getId()
20: {
21: return isset($_REQUEST['imgcat_id']) ? xoops_getrequest('imgcat_id') : 0;
22: }
23:
24: function &_getHandler()
25: {
26: $handler =& xoops_getmodulehandler('imagecategory');
27: return $handler;
28: }
29:
30: function _setupObject()
31: {
32: parent::_setupObject();
33: $this->mObject->loadReadGroups();
34: $this->mObject->loadUploadGroups();
35: }
36:
37: function _setupActionForm()
38: {
39: $this->mActionForm = $this->mObject->isNew() ? new Legacy_ImagecategoryAdminNewForm()
40: : new Legacy_ImagecategoryAdminEditForm();
41:
42: $this->mActionForm->prepare();
43: }
44:
45: function executeViewInput(&$controller, &$xoopsUser, &$render)
46: {
47: $render->setTemplateName("imagecategory_edit.html");
48: $render->setAttribute('actionForm', $this->mActionForm);
49: $render->setAttribute('object', $this->mObject);
50:
51: $handler =& xoops_gethandler('group');
52: $groupArr =& $handler->getObjects();
53: $render->setAttribute('groupArr', $groupArr);
54: }
55:
56: function executeViewSuccess(&$controller, &$xoopsUser, &$render)
57: {
58: $controller->executeForward("./index.php?action=ImagecategoryList");
59: }
60:
61: function executeViewError(&$controller, &$xoopsUser, &$render)
62: {
63: $controller->executeRedirect("./index.php?action=ImagecategoryList", 1, _MD_LEGACY_ERROR_DBUPDATE_FAILED);
64: }
65:
66: function executeViewCancel(&$controller, &$xoopsUser, &$render)
67: {
68: $controller->executeForward("./index.php?action=ImagecategoryList");
69: }
70: }
71:
72: ?>
73: