function pdp_tmp_show_cat($parentid, $cat_array, $level, $sel_this) { $retval = ""; foreach ($cat_array as $myid => $thiscat) { if ($thiscat['parentcat'] == $parentid && checkgroup($thiscat['access'])) { $retval .= "<option value='{$myid}'" . ($sel_this == $myid ? " selected" : "") . ">" . str_repeat(" ", $level * 4) . $thiscat['name'] . "</option>"; $retval .= pdp_tmp_show_cat($myid, $cat_array, $level + 1, $sel_this); } } return $retval; }
function pdp_tmp_show_cat($parentid, $cat_array, $level, $sel_this, &$ret_array, &$maxlevel, $dont_follow_this_cat) { $retval = ""; foreach ($cat_array as $myid => $thiscat) { if ($thiscat['parentcat'] == $parentid) { $ret_array[$myid] = array('name' => $thiscat['name'], 'access' => $thiscat['access'], 'upload_access' => $thiscat['upload_access'], 'download_access' => $thiscat['download_access'], 'sorting' => $thiscat['sorting'], 'level' => $level, 'order' => $thiscat['order']); if ($level > $maxlevel) { $maxlevel = $level; } //FIXME if($myid!=$dont_follow_this_cat) { $retval .= "<option value='{$myid}'" . ($sel_this == $myid ? " selected" : "") . ">" . str_repeat(" ", $level * 4) . $thiscat['name'] . "</option>"; $retval .= pdp_tmp_show_cat($myid, $cat_array, $level + 1, $sel_this, $ret_array, $maxlevel, $dont_follow_this_cat); //FIXME } } } return $retval; }