function filedepot_getRecursiveCatIDs in filedepot 6
3 calls to filedepot_getRecursiveCatIDs()
File
- ./
lib-common.php, line 208 - lib-common.php Common library of functions for the applications
Code
function filedepot_getRecursiveCatIDs(&$list, $cid, $perms, $override = false) {
$filedepot = filedepot_filedepot();
$query = db_query("SELECT cid FROM {filedepot_categories} WHERE PID=%d ORDER BY cid", $cid);
while ($A = db_fetch_array($query)) {
// Check and see if this category has any sub categories - where a category record has this cid as it's parent
if (db_result(db_query("SELECT count(pid) FROM {filedepot_categories} WHERE pid=%d", $A['cid'])) > 0) {
if ($override === TRUE or $filedepot
->checkPermission($A['cid'], $perms)) {
array_push($list, $A['cid']);
filedepot_getRecursiveCatIDs($list, $A['cid'], $perms, $override);
}
}
else {
if ($override === TRUE or $filedepot
->checkPermission($A['cid'], $perms)) {
array_push($list, $A['cid']);
}
}
}
return $list;
}