24 public $mCategory =
null;
26 public function prepare(&$controller, &$xoopsUser)
28 parent::prepare($controller, $xoopsUser);
29 $controller->setDialogMode(
true);
31 $root =& $controller->mRoot;
32 $root->mLanguageManager->loadModuleMessageCatalog(
'legacy');
35 public function &_getHandler()
37 $handler =& xoops_getmodulehandler(
'image',
'legacy');
41 public function _setupObject()
43 $this->mObjectHandler =& $this->_getHandler();
44 $this->mObject =& $this->mObjectHandler->create();
45 $this->mObject->set(
'imgcat_id', xoops_getrequest(
'imgcat_id'));
48 public function _setupActionForm()
51 $this->mActionForm->prepare();
54 public function hasPermission(&$controller, &$xoopsUser)
57 if (is_object($xoopsUser)) {
58 $groups = $xoopsUser->getGroups();
60 $groups = [XOOPS_GROUP_ANONYMOUS];
63 $handler =& xoops_getmodulehandler(
'imagecategory',
'legacy');
64 $this->mCategory =& $handler->get(xoops_getrequest(
'imgcat_id'));
65 if (!is_object($this->mCategory) || (is_object($this->mCategory) && !$this->mCategory->hasUploadPerm($groups))) {
72 public function executeViewInput(&$controller, &$xoopsUser, &$render)
74 $render->setTemplateName(
'legacy_image_upload.html');
75 $render->setAttribute(
'actionForm', $this->mActionForm);
76 $render->setAttribute(
'object', $this->mObject);
78 $render->setAttribute(
'category', $this->mCategory);
79 $render->setAttribute(
'target', xoops_getrequest(
'target'));
82 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
84 $controller->executeForward(XOOPS_URL .
'/imagemanager.php?imgcat_id=' . $this->mActionForm->get(
'imgcat_id') .
'&target=' . xoops_getrequest(
'target'));
87 public function executeViewError(&$controller, &$xoopsUser, &$render)
89 redirect_header(XOOPS_URL .
'/imagemanager.php', 1, _MD_LEGACY_ERROR_DBUPDATE_FAILED);