A suggestion of hierarchical submenu

Date 2007-03-08 03:43:25 | Category: XOOPS

in englishin japanese
$modversino['sub'] can be extended as RECURSIVE like ...

array(
	'name' => (name of this node)
	'url' => (relative link from XOOPS_URL/modules/dirname/ )
	'sub' => (array of sub nodes)
) ,

Then you can get hierarchical submenus for theme's power.

When you assign the submenus for your theme, you should call XoopsModule::getInfo('sub') instead of XoopsModule::subLink().

$module->subLink()
$module->getInfo('sub')


This code flagment will be useful for the agility of your module.
In function of dirname_get_submenu, you should cache the result as a static variable.

xoops_version.php

$modversion['sub'] = array() ;
if( is_object( @$GLOBALS['xoopsModule'] ) && $GLOBALS['xoopsModule']->getVar('dirname') == dirname ) {
	require_once dirname(__FILE__).'/include/common_functions.php' ;
	$modversion['sub'] = dirname_get_submenu( $mydirname ) ;
}


You can find the latest d3forum and pico offer this kind of submenus.
I'll be happy if a lot of themes supporting hierarchical submenus are released.




You can read more news at PEAK XOOPS.
http://xoops.peak.ne.jp

The URL for this story is:
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=408