GIT.Harvie.CZ
/
mirrors
/
SokoMan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d62adf
)
Vylepsena verze stromu kategorii
author
Thomas Mudrunka
<tomas@mudrunka.cz>
Fri, 9 Dec 2011 20:15:22 +0000
(21:15 +0100)
committer
Thomas Mudrunka
<tomas@mudrunka.cz>
Fri, 9 Dec 2011 20:15:22 +0000
(21:15 +0100)
assistants/category-tree.inc.php
patch
|
blob
|
blame
|
history
diff --git
a/assistants/category-tree.inc.php
b/assistants/category-tree.inc.php
index f268ca774582abc8f482f49c5046ea40e885d608..ce6c4c38043d004ef766263dded0b510e8c1905c 100644
(file)
--- a/
assistants/category-tree.inc.php
+++ b/
assistants/category-tree.inc.php
@@
-16,4
+16,14
@@
foreach($result as $row) {
addleaf($tree, $row_parts);
}
-print_r($tree);
+function render_tree($tree, $pathindex='__PATH__') {
+ if(!is_array($tree)) return '';
+ $html='<menu>';
+ foreach($tree as $name => $subtree) if($name != $pathindex) {
+ $html.='<li><b>'.$name.'</b> <small>('.$subtree[$pathindex].')</small>'.render_tree($subtree).'</li>';
+ }
+ $html.='</menu>';
+ return $html;
+}
+echo render_tree($tree);
+//print_r($tree);
This page took
0.154982 seconds
and
4
git commands to generate.