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:
8840ec3
)
Pridany linky do stromu kategorii
author
Thomas Mudrunka
<tomas@mudrunka.cz>
Fri, 9 Dec 2011 21:17:33 +0000
(22:17 +0100)
committer
Thomas Mudrunka
<tomas@mudrunka.cz>
Fri, 9 Dec 2011 21:17:33 +0000
(22:17 +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 b41b5471ac2d658d670021431eb278f09fd171b5..05d426d232c8c253b288bc6b91ddbd89265c6bd5 100644
(file)
--- 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='<menu>';
foreach($tree as $name => $subtree) if($name != $index_path && $name != $index_id) {
if(!is_array($tree)) return '';
$html='<menu>';
foreach($tree as $name => $subtree) if($name != $index_path && $name != $index_id) {
- @$html.='<li><b>'.$name.'</b> <small>('.$subtree[$index_id].' => '.$subtree[$index_path].')</small>'.render_tree($subtree).'</li>';
+ $link = isset($subtree[$index_id]);
+ $hidden = $link && $subtree[$index_id] <= 0;
+
+ $html.='<li>';
+ if($link) $html.= '<a href="'.$_SERVER['SCRIPT_NAME'].'/model/?where[category_id]=='.$subtree[$index_id].'">';
+ if($hidden) $html.='<font color="grey">';
+ $html.="<b>$name</b>";
+ if($hidden) $html.='</font>';
+ if($link) $html.= '</a>';
+ @$html.=' <small>('.$subtree[$index_id].' => '.$subtree[$index_path].')</small>';
+ $html.=render_tree($subtree);
+ $html.='</li>';
}
$html.='</menu>';
return $html;
}
$html.='</menu>';
return $html;
This page took
0.193481 seconds
and
4
git commands to generate.