Minahito
minah****@users*****
2006年 5月 15日 (月) 14:26:42 JST
Index: xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php diff -u xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php:1.1.2.1 xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php:1.1.2.2 --- xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php:1.1.2.1 Fri May 12 19:13:28 2006 +++ xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php Mon May 15 14:26:42 2006 @@ -5,7 +5,7 @@ require_once XOOPS_MODULE_PATH . "/base/class/AbstractEditAction.class.php"; require_once XOOPS_MODULE_PATH . "/base/admin/forms/ImageAdminEditForm.class.php"; -class Base_ImageEditAction extends Base_AbstractEditAction +class Legacy_ImageEditAction extends Legacy_AbstractEditAction { function _getId() { @@ -20,16 +20,37 @@ function _setupActionForm() { - $this->mActionForm =& new Base_ImageAdminEditForm(); + $this->mActionForm =& new Legacy_ImageAdminEditForm(); $this->mActionForm->prepare(); } + function _doExecute() + { + if ($this->mActionForm->mFormFile != null) { + if (!$this->mActionForm->mFormFile->saveAs(XOOPS_UPLOAD_PATH)) { + return false; + } + } + + // + // If there is a old file, delete it + // + if ($this->mActionForm->mOldFilename != null) { + @unlink(XOOPS_UPLOAD_PATH . "/" . $this->mActionForm->mOldFilename); + } + + return parent::_doExecute(); + } + function executeViewInput(&$controller, &$xoopsUser, &$render) { $render->setTemplateName("image_edit.html"); $render->setAttribute('actionForm', $this->mActionForm); - #cubson::lazy_load('image', $this->mObject) $render->setAttribute('object', $this->mObject); + + $handler =& xoops_getmodulehandler('imagecategory'); + $categoryArr =& $handler->getObjects(); + $render->setAttribute('categoryArr', $categoryArr); } function executeViewSuccess(&$controller, &$xoopsUser, &$render)