From edffb15cea5a76ef26fa030d7acd953f3d979ac2 Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Fri, 9 Dec 2011 22:17:33 +0100 Subject: [PATCH] Pridany linky do stromu kategorii --- assistants/category-tree.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/assistants/category-tree.inc.php b/assistants/category-tree.inc.php index b41b547..05d426d 100644 --- a/assistants/category-tree.inc.php +++ b/assistants/category-tree.inc.php @@ -25,7 +25,18 @@ function render_tree($tree, $index_path='__PATH__', $index_id='__ID__') { if(!is_array($tree)) return ''; $html=''; foreach($tree as $name => $subtree) if($name != $index_path && $name != $index_id) { - @$html.='
  • '.$name.' ('.$subtree[$index_id].' => '.$subtree[$index_path].')'.render_tree($subtree).'
  • '; + $link = isset($subtree[$index_id]); + $hidden = $link && $subtree[$index_id] <= 0; + + $html.='
  • '; + if($link) $html.= ''; + if($hidden) $html.=''; + $html.="$name"; + if($hidden) $html.=''; + if($link) $html.= ''; + @$html.=' ('.$subtree[$index_id].' => '.$subtree[$index_path].')'; + $html.=render_tree($subtree); + $html.='
  • '; } $html.='
    '; return $html; -- 2.30.2