function showBranch($tree, $path, $treeId, $enabledOnly, $disabled) { if ($tree) { foreach ($tree[$path] as $page) { $dsbl = is_array($enabledOnly) && !in_array($page['id'], $enabledOnly) || is_array($disabled) && in_array($page['id'], $disabled); if ($dsbl) { $data = ' rel="disabled"'; } else { $data = $page['id'] == 1 ? ' rel="mainpage"' : ''; } echo '<li id="' . $treeId . '-' . $page['id'] . '" ' . $data . ' ><a rev="page" rel="' . $page['id'] . '" href="#"><ins> </ins>' . ($dsbl ? '<s>' : '') . $page['title'] . ($dsbl ? '</s>' : '') . "</a>\n"; if ($tree[$path . ',' . $page['id']]) { echo "<ul>\n"; showBranch($tree, $path . ',' . $page['id'], $treeId, $enabledOnly, $disabled); echo "</ul>\n"; } echo "</li>\n"; } } }
function showBranch($tree, $path) { if ($tree && isset($tree[$path]) && is_array($tree[$path])) { foreach ($tree[$path] as $page) { $data = $page['id'] == 1 ? ' rel="mainpage"' : ''; echo '<li id="page-' . $page['id'] . '" ' . $data . ' ><a rev="page" rel="' . $page['id'] . '" href="#' . $page['id'] . '"><ins> </ins>' . $page['title'] . "</a>\n"; if ($tree[$path . ',' . $page['id']]) { echo "<ul>\n"; showBranch($tree, $path . ',' . $page['id']); echo "</ul>\n"; } echo "</li>\n"; } } }