API16:JHtmlMenu/treerecurse
From Joomla! Documentation
<! removed transcluded page call, red link never existed >
Syntax
static treerecurse($id, $indent, $list, &$children, $maxlevel=9999, $level=0, $type=1)
Parameter Name | Default Value | Description |
---|---|---|
$id | ||
$indent | ||
$list | ||
&$children | ||
$maxlevel | 9999 | |
$level | 0 | |
$type | 1 |
Defined in
libraries/joomla/html/html/menu.php
Importing
jimport( 'joomla.html.html.menu' );
Source Body
public static function treerecurse($id, $indent, $list, &$children, $maxlevel=9999, $level=0, $type=1)
{
if (@$children[$id] && $level <= $maxlevel)
{
foreach ($children[$id] as $v)
{
$id = $v->id;
if ($type) {
$pre = '<sup>|_</sup> ';
$spacer = '. ';
} else {
$pre = '- ';
$spacer = ' ';
}
if ($v->parent_id == 0) {
$txt = $v->title;
} else {
$txt = $pre . $v->title;
}
$pt = $v->parent_id;
$list[$id] = $v;
$list[$id]->treename = "$indent$txt";
$list[$id]->children = count(@$children[$id]);
$list = JHtmlMenu::TreeRecurse($id, $indent . $spacer, $list, $children, $maxlevel, $level+1, $type);
}
}
return $list;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples