PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_Menu » Bug #4391

I would like to be able to force expansion of part of a tree.

Details

Request #4391I would like to be able to force expansion of part of a tree.
Submitted2005-05-20 00:26 UTC
Fromprices at dflytech dot com
Assignedavb
StatusClosed
PackageHTML_Menu
PHP Version5.0.4
OSFreeBSD 5.3
Roadmaps(Not assigned)

Comments

[2005-05-20 00:26 UTC] prices at dflytech dot com

Description:
------------
I would like to be able to force expansion of part of a tree. I have headings in my menu that don't have links and the sub menu needs to be always expanded.

Reproduce code:
---------------
in:
function _renderTree($menu, $level = 0)

...SNIP...
// follow the subtree if the active menu item is in it or if we want the full menu
if (('sitemap' == $this->_menuType || HTML_MENU_ENTRY_INACTIVE != $type || $node['forceExpand']) && isset($node['sub'])) {
$this->_renderTree($node['sub'], $level + 1);

...SNIP...
}

I added the "|| $node['forceExpand']" to force the expansion. That works well for me.