Minahito
minah****@users*****
2007年 4月 18日 (水) 15:17:45 JST
Index: xoops2jp/html/kernel/block.php diff -u xoops2jp/html/kernel/block.php:1.2.8.10.2.4.2.3 xoops2jp/html/kernel/block.php:1.2.8.10.2.4.2.4 --- xoops2jp/html/kernel/block.php:1.2.8.10.2.4.2.3 Wed Apr 18 15:07:29 2007 +++ xoops2jp/html/kernel/block.php Wed Apr 18 15:17:45 2007 @@ -1,5 +1,5 @@ <?php -// $Id: block.php,v 1.2.8.10.2.4.2.3 2007/04/18 06:07:29 minahito Exp $ +// $Id: block.php,v 1.2.8.10.2.4.2.4 2007/04/18 06:17:45 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -717,12 +717,16 @@ return $ret; } + /** + * Gets block objects by groups & modules. + * @remark This is the special API for base modules like Legacy. + */ function &getAllByGroupModule($groupid, $module_id=0, $toponlyblock=false, $visible=null, $orderby='b.weight,b.bid', $isactive=1) { $ret = array(); $sql = "SELECT DISTINCT gperm_itemid FROM ".$this->db->prefix('group_permission')." WHERE gperm_name = 'block_read' AND gperm_modid = 1"; if ( is_array($groupid) ) { - $sql .= ' AND gperm_groupid IN ('.addslashes(implode(',', $groupid)).')'; + $sql .= ' AND gperm_groupid IN ('.addslashes(implode(',', array_map('intval', $groupid))).')'; } else { if (intval($groupid) > 0) { $sql .= ' AND gperm_groupid='.intval($groupid); @@ -768,8 +772,8 @@ /** * Return block instance array by $groupid, $mid and $blockFlag. * This function is new function of Cube and used from controller. - * @author minahito - */ + * @remark This is the special API for base modules like Legacy. + **/ function &getBlocks($groupid, $mid=false, $blockFlag=SHOW_BLOCK_ALL, $orderby='b.weight,b.bid') { $root =& XCube_Root::getSingleton(); @@ -835,6 +839,9 @@ return $ret; } + /** + * @remark This is the special API for base modules like Legacy. + */ function &getNonGroupedBlocks($module_id=0, $toponlyblock=false, $visible=null, $orderby='b.weight,b.bid', $isactive=1) { $ret = array(); @@ -909,7 +916,7 @@ /** * Changes 'isactive' value of the module specified by $moduleId. - * @remark This method should be called by only the base modules. + * @remark This method should be called by only the base modules like Legacy. */ function syncIsActive($moduleId, $isActive, $force = false) {