function outputSubcatsSelecti on subcats category_id level echo ul for

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function outputSubcatsSelection( $subcats, $category_id = 0, $level = 1 ) {
echo "<ul>";
for($i=0;$i<count($subcats);$i++){
$subcats1 = CategoryHelper::getCategoriesByParentId ( $subcats[$i]->id );
$onclick = "onclick=\"onCategorySelect({$subcats[$i]->id}, {$level}, '{$subcats[$i]->catname}', this); return false;\"";
$link_cat = '#';
if ($subcats[$i]->id == $category_id) {
$className = 'class="selected three_lnk"';
}else {
$className = 'class="three_lnk"';
}
if (count($subcats1)>0){
echo "<li style='list-style:none'><span class='folder category_css'><a $className class=\"three_lnk\" $onclick href='$link_cat'>".$subcats[$i]->catname."</a></span>";
ilookHTML::outputSubcatsSelection($subcats1, $category_id, $level + 1);
}else{
echo "<li style='list-style:none'><span class='file products_css'><a $className class=\"three_lnk\" $onclick href='$link_cat'>".$subcats[$i]->catname."</a></span>";
}
}
echo "</ul>";