21 public function _getId()
26 public function &_getHandler()
28 $handler =& xoops_getmodulehandler(
'image',
'legacy');
32 public function _setupActionForm()
35 $this->mActionForm->prepare();
38 public function getDefaultView(&$controller, &$xoopsUser)
40 $flag = parent::getDefaultView($controller, $xoopsUser);
42 if (LEGACY_FRAME_VIEW_INPUT === $flag && $this->_enableCatchImgcat()) {
43 $this->mActionForm->set(
'imgcat_id', xoops_getrequest(
'imgcat_id'));
49 public function _enableCatchImgcat()
54 public function _doExecute()
56 $handler =& xoops_getmodulehandler(
'imagecategory',
'legacy');
57 $category =& $handler->get($this->mActionForm->get(
'imgcat_id'));
63 if (
'file' === $category->get(
'imgcat_storetype')) {
69 return parent::_doExecute();
72 public function _storeFile()
74 if (
null === $this->mActionForm->mFormFile) {
81 if (
null !== $this->mActionForm->mOldFileName) {
82 @unlink(XOOPS_UPLOAD_PATH .
'/' . $this->mActionForm->mOldFileName);
86 if (preg_match(
"/(.+)\.\w+$/", $this->mActionForm->mOldFileName, $match)) {
87 $this->mActionForm->mFormFile->setBodyName($match[1]);
91 $this->mObject->set(
'image_name', $this->mActionForm->mFormFile->getFileName());
93 return $this->mActionForm->mFormFile->saveAs(XOOPS_UPLOAD_PATH);
96 public function _storeDB()
100 public function executeViewInput(&$controller, &$xoopsUser, &$render)
102 $this->mObject->loadImagecategory();
104 $render->setTemplateName(
'image_edit.html');
105 $render->setAttribute(
'actionForm', $this->mActionForm);
106 $render->setAttribute(
'object', $this->mObject);
108 $handler =& xoops_getmodulehandler(
'imagecategory',
'legacy');
109 $categoryArr =& $handler->getObjects();
110 $render->setAttribute(
'categoryArr', $categoryArr);
113 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
115 $controller->executeForward(
'./index.php?action=ImageList&imgcat_id=' . $this->mActionForm->get(
'imgcat_id'));
118 public function executeViewError(&$controller, &$xoopsUser, &$render)
120 $controller->executeRedirect(
'./index.php?action=ImagecategoryList', 1, _MD_LEGACY_ERROR_DBUPDATE_FAILED);
123 public function executeViewCancel(&$controller, &$xoopsUser, &$render)
125 $controller->executeForward(
'./index.php?action=ImagecategoryList');