-function addleaf(&$tree, $levels, $category='') {
- if(!count($levels)) return;
- $current = array_shift($levels);
+function addleaf(&$tree, $levels, $id, $category='') {
+ if(!count($levels)) {
+ $tree['__ID__'] = $id;
+ return;
+ }
+ $current = array_shift($levels); //echo("$current ".count($levels)."");