Minahito
minah****@users*****
2006年 10月 2日 (月) 19:21:34 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.9 xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php:1.1.2.10 --- xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php:1.1.2.9 Thu Sep 28 10:45:42 2006 +++ xoops2jp/html/modules/base/admin/actions/ImageEditAction.class.php Mon Oct 2 19:21:34 2006 @@ -1,84 +1,37 @@ <?php /** * @package Legacy - * @version $Id: ImageEditAction.class.php,v 1.1.2.9 2006/09/28 01:45:42 minahito Exp $ + * @version $Id: ImageEditAction.class.php,v 1.1.2.10 2006/10/02 10:21:34 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); -require_once XOOPS_MODULE_PATH . "/base/class/AbstractEditAction.class.php"; +require_once XOOPS_MODULE_PATH . "/base/admin/actions/ImageCreateAction.class.php"; require_once XOOPS_MODULE_PATH . "/base/admin/forms/ImageAdminEditForm.class.php"; -class Legacy_ImageEditAction extends Legacy_AbstractEditAction +class Legacy_ImageEditAction extends Legacy_ImageCreateAction { function _getId() { return isset($_REQUEST['image_id']) ? xoops_getrequest('image_id') : 0; } - function &_getHandler() - { - $handler =& xoops_getmodulehandler('image', 'base'); - return $handler; - } - function _setupActionForm() { $this->mActionForm =& new Legacy_ImageAdminEditForm(); $this->mActionForm->prepare(); } - function getDefaultView(&$controller, &$xoopsUser) + function isEnableCreate() { - $flag = parent::getDefaultView($controller, $xoopsUser); - - if ($flag == LEGACY_FRAME_VIEW_INPUT) { - $this->mActionForm->set('imgcat_id', xoops_getrequest('imgcat_id')); - } - - return $flag; - } - - function _doExecute() - { - $handler =& xoops_getmodulehandler('imagecategory', 'base'); - $category =& $handler->get($this->mActionForm->get('imgcat_id')); - - // - // [TODO] - // Should the following procedure be after parent::_doExecute()? - // - if ($category->get('imgcat_storetype') == 'file') { - $this->_storeFile(); - } - else { - $this->_storeDB(); - } - - return parent::_doExecute(); + return false; } - function _storeFile() + function _enableCatchImgcat() { - 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 false; } - function _storeDB() - { - - } - function executeViewInput(&$controller, &$xoopsUser, &$render) { $this->mObject->loadImagecategory(); @@ -88,24 +41,11 @@ $render->setAttribute('object', $this->mObject); $handler =& xoops_getmodulehandler('imagecategory', 'base'); - $categoryArr =& $handler->getObjects(); + $t_category = $handler->get($this->mObject->get('imgcat_id')); + + $categoryArr =& $handler->getObjects(new Criteria('imgcat_storetype', $t_category->get('imgcat_storetype'))); $render->setAttribute('categoryArr', $categoryArr); } - - function executeViewSuccess(&$controller, &$xoopsUser, &$render) - { - $controller->executeForward("./index.php?action=ImageList&imgcat_id=" . $this->mActionForm->get('imgcat_id')); - } - - function executeViewError(&$controller, &$xoopsUser, &$render) - { - $controller->executeRedirect("./index.php?action=ImagecategoryList", 1, _MD_BASE_ERROR_DBUPDATE_FAILED); - } - - function executeViewCancel(&$controller, &$xoopsUser, &$render) - { - $controller->executeForward("./index.php?action=ImageList&imgcat_id=" . $this->mActionForm->get('imgcat_id')); - } } ?>