Actions

API16

JHtmlMenu/treerecurse

From Joomla! Documentation

< API16:JHtmlMenu
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Contents

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>&nbsp;';
                                $spacer = '.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
                        } else {
                                $pre    = '- ';
                                $spacer = '&nbsp;&nbsp;';
                        }
 
                        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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />