Minahito
minah****@users*****
2006年 10月 10日 (火) 17:10:50 JST
Index: xoops2jp/html/modules/base/kernel/Legacy_PublicControllerStrategy.class.php diff -u xoops2jp/html/modules/base/kernel/Legacy_PublicControllerStrategy.class.php:1.1.2.3 xoops2jp/html/modules/base/kernel/Legacy_PublicControllerStrategy.class.php:1.1.2.4 --- xoops2jp/html/modules/base/kernel/Legacy_PublicControllerStrategy.class.php:1.1.2.3 Fri Oct 6 18:48:45 2006 +++ xoops2jp/html/modules/base/kernel/Legacy_PublicControllerStrategy.class.php Tue Oct 10 17:10:49 2006 @@ -1,7 +1,7 @@ <?php /** * @package Legacy - * @version $Id: Legacy_PublicControllerStrategy.class.php,v 1.1.2.3 2006/10/06 09:48:45 minahito Exp $ + * @version $Id: Legacy_PublicControllerStrategy.class.php,v 1.1.2.4 2006/10/10 08:10:49 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -72,9 +72,34 @@ $showFlag = SHOW_SIDEBLOCK_LEFT | $showRightFlag | $showCenterFlag; $groups = is_object($this->mController->mRoot->mContext->mXoopsUser) ? $this->mController->mRoot->mContext->mXoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; - $blockObjects=&$blockHandler->getBlocks($groups, $mid, $showFlag); + $blockObjects =& $blockHandler->getBlocks($groups, $mid, $showFlag); foreach($blockObjects as $blockObject) { - $block =& new Legacy_BlockProcedureAdapter($blockObject); + // + // IMPORTANT CONVENTION + // + $block = null; + $func = $blockObject->get('show_func'); + if (substr($func, 0, 4) == 'cl::') { + $className = substr($func, 4); + if (!class_exists($className)) { + $filePath = XOOPS_ROOT_PATH . '/modules/' . $blockObject->get('dirname') . '/blocks/' . $blockObject->get('func_file'); + if (!file_exists($filePath)) { + continue; + } + + require_once $filePath; + + if (!class_exists($className)) { + continue; + } + } + + $block =& new $className($blockObject); + } + else { + $block =& new Legacy_BlockProcedureAdapter($blockObject); + } + if ($block->prepare() !== false) { $this->mController->_mBlockChain[] =& $block; }