Minahito
minah****@users*****
2006年 5月 17日 (水) 18:35:32 JST
Index: xoops2jp/html/modules/legacyRender/class/tplfile.php diff -u xoops2jp/html/modules/legacyRender/class/tplfile.php:1.1.2.8 xoops2jp/html/modules/legacyRender/class/tplfile.php:1.1.2.9 --- xoops2jp/html/modules/legacyRender/class/tplfile.php:1.1.2.8 Wed May 17 16:20:34 2006 +++ xoops2jp/html/modules/legacyRender/class/tplfile.php Wed May 17 18:35:32 2006 @@ -111,6 +111,38 @@ } } + /** + * This method load objects of two template sets by $criteria. Then, build + * the return value from the objects of 'default', and set the objects of + * $tplset to object->mOverride. + */ + function &getObjectsWithOverride($criteria, $tplset) + { + $objs =& $this->getObjects($criteria); + + $ret = array(); + + $i = 0; + foreach (array_keys($objs) as $srckey) { + if ($objs[$srckey]->get('tpl_tplset') == 'default') { + $ret[$i] =& $objs[$srckey]; + + // + // Find the same object in $tplset, set it to mOverride. + // + foreach (array_keys($objs) as $destkey) { + if ($objs[$srckey]->get('tpl_file') == $objs[$destkey]->get('tpl_file') && $objs[$destkey]->get('tpl_tplset') == $tplset) { + $ret[$i]->mOverride =& $objs[$destkey]; + } + } + + $i++; + } + } + + return $ret; + } + function delete(&$obj, $force) { $obj->loadSource();