$item) { $href = $item[0]; $selected = $href == $pageUrl; if (isset($item[1]) && $item[1] !== null && $item[1] !== []) { // If the element contains children, push them to the tree as well TreeView::generateBulletTree($item[1]); } // Push the text and link to the element on the tree array_push($tree, ["text" => $key, "a_attr" => ["href" => $href == "" ? "/Default.aspx" : $href], "children" => $item[1] ?? [], "state" => ["selected" => $selected]]); } unset($item); TreeView::stampBulletTree($tree); } } // EOF