Minahito
minah****@users*****
2006年 10月 2日 (月) 19:21:55 JST
Index: xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php diff -u xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php:1.1.2.8 xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php:1.1.2.9 --- xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php:1.1.2.8 Fri Aug 18 20:30:01 2006 +++ xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php Mon Oct 2 19:21:55 2006 @@ -1,7 +1,7 @@ <?php /** * @package Legacy - * @version $Id: ImageAdminEditForm.class.php,v 1.1.2.8 2006/08/18 11:30:01 minahito Exp $ + * @version $Id: ImageAdminEditForm.class.php,v 1.1.2.9 2006/10/02 10:21:55 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -10,7 +10,7 @@ require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; require_once XOOPS_MODULE_PATH . "/base/forms/ImageUploadForm.class.php"; -class Legacy_ImageAdminEditForm extends Legacy_ImageUploadForm +class Legacy_ImageAdminCreateForm extends Legacy_ImageUploadForm { var $_mImgcatId = 0; @@ -52,11 +52,6 @@ $this->_mImgcatId = $obj->get('imgcat_id'); } - function getImgcatId() - { - return $this->_mIsNew ? $this->get('imgcat_id') : $this->_mImgcatId; - } - function update(&$obj) { parent::update($obj); @@ -66,4 +61,20 @@ } } +class Legacy_ImageAdminEditForm extends Legacy_ImageAdminCreateForm +{ + function validateImgcat_id() + { + parent::validateImgcat_id(); + + $handler =& xoops_getmodulehandler('imagecategory', 'base'); + $currentCategory =& $handler->get($this->_mImgcatId); + + $specificCategory =& $handler->get($this->get('imgcat_id')); + if ($currentCategory->get('imgcat_storetype') != $specificCategory->get('imgcat_storetype')) { + $this->set('imgcat_id', $this->_mImgcatId); + } + } +} + ?>