Minahito
minah****@users*****
2006年 8月 1日 (火) 19:36:56 JST
Index: xoops2jp/html/modules/base/admin/forms/BlockEditForm.class.php diff -u xoops2jp/html/modules/base/admin/forms/BlockEditForm.class.php:1.1.2.4 xoops2jp/html/modules/base/admin/forms/BlockEditForm.class.php:1.1.2.5 --- xoops2jp/html/modules/base/admin/forms/BlockEditForm.class.php:1.1.2.4 Mon Apr 10 21:42:32 2006 +++ xoops2jp/html/modules/base/admin/forms/BlockEditForm.class.php Tue Aug 1 19:36:55 2006 @@ -29,7 +29,6 @@ // // Set field properties // - $this->mFieldProperties['bid'] =& new XCube_FieldProperty($this); $this->mFieldProperties['bid']->setDependsByArray(array('required')); $this->mFieldProperties['bid']->addMessage('required', _AD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_BID); @@ -41,16 +40,29 @@ $this->mFieldProperties['title']->addVar('maxlength', '255'); $this->mFieldProperties['side'] =& new XCube_FieldProperty($this); - $this->mFieldProperties['side']->setDependsByArray(array('required')); + $this->mFieldProperties['side']->setDependsByArray(array('required', 'objectExist')); $this->mFieldProperties['side']->addMessage('required', _AD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_SIDE); + $this->mFieldProperties['side']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_SIDE); + $this->mFieldProperties['side']->addVar('handler', 'columnside'); + $this->mFieldProperties['side']->addVar('module', 'base'); $this->mFieldProperties['weight'] =& new XCube_FieldProperty($this); - $this->mFieldProperties['weight']->setDependsByArray(array('required')); + $this->mFieldProperties['weight']->setDependsByArray(array('required', 'intRange')); $this->mFieldProperties['weight']->addMessage('required', _AD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_WEIGHT); + $this->mFieldProperties['weight']->addMessage('intRange', _AD_BASE_ERROR_INTRANGE, _AD_BASE_LANG_WEIGHT); + $this->mFieldProperties['weight']->addVar('min', '0'); + $this->mFieldProperties['weight']->addVar('max', '255'); $this->mFieldProperties['bcachetime'] =& new XCube_FieldProperty($this); - $this->mFieldProperties['bcachetime']->setDependsByArray(array('required')); + $this->mFieldProperties['bcachetime']->setDependsByArray(array('required', 'objectExist')); $this->mFieldProperties['bcachetime']->addMessage('required', _AD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_BCACHETIME); + $this->mFieldProperties['bcachetime']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_BCACHETIME); + $this->mFieldProperties['bcachetime']->addVar('handler', 'cachetime'); + + $this->mFieldProperties['groupid'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['groupid']->setDependsByArray(array('objectExist')); + $this->mFieldProperties['groupid']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_GROUPID); + $this->mFieldProperties['groupid']->addVar('handler', 'group'); } function validateBmodule() @@ -59,6 +71,15 @@ if (!(count($bmodule))) { $this->addErrorMessage(_AD_BASE_ERROR_BMODULE); } + else { + $handler =& xoops_gethandler('module'); + foreach ($this->get('bmodule') as $mid) { + $module =& $handler->get($mid); + if ($mid != -1 && $mid != 0 && !is_object($module)) { + $this->addErrorMessage(XCube_Utils::formatMessage(_AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_BMODULE)); + } + } + } } function validateGroupid()