Minahito
minah****@users*****
2006年 4月 6日 (木) 12:37:37 JST
Index: xoops2jp/html/modules/base/class/newblocks.php diff -u xoops2jp/html/modules/base/class/newblocks.php:1.1.2.1 xoops2jp/html/modules/base/class/newblocks.php:1.1.2.2 --- xoops2jp/html/modules/base/class/newblocks.php:1.1.2.1 Wed Apr 5 19:58:39 2006 +++ xoops2jp/html/modules/base/class/newblocks.php Thu Apr 6 12:37:37 2006 @@ -6,6 +6,12 @@ { var $mModule = null; + /** + * Array of group objects who can access this object. + * It need lazy loading to access. + */ + var $mGroup = null; + function BaseNewblocksObject() { $this->initVar('bid', XOBJ_DTYPE_INT, '', true); @@ -35,6 +41,27 @@ $handler =& xoops_gethandler('module'); $this->mModule =& $handler->get($this->get('mid')); } + + /** + * Load group objects who can access this object. And, set the objects to mGroup. + * + * TODO Need lock double loading. + */ + function loadGroup() + { + $handler =& xoops_gethandler('groupperm'); + $criteria =& new CriteriaCompo(); + $criteria->add(new Criteria('gperm_modid', 1)); + $criteria->add(new Criteria('gperm_itemid', $this->get('bid'))); + $criteria->add(new Criteria('gperm_name', 'block_read')); + + $gpermArr =& $handler->getObjects($criteria); + + $handler =& xoops_gethandler('group'); + foreach ($gpermArr as $gperm) { + $this->mGroup[] =& $handler->get($gperm->get('gperm_groupid')); + } + } } class BaseNewblocksHandler extends XoopsObjectGenericHandler