You are here

function filedepot_getTopLevelParent in filedepot 6

Same name and namespace in other branches
  1. 7 lib-common.php \filedepot_getTopLevelParent()
5 calls to filedepot_getTopLevelParent()
filedepot::approveFileSubmission in ./filedepot.class.php
filedepot::moveIncomingFile in ./filedepot.class.php
filedepot::saveFile in ./filedepot.class.php
filedepot_access in ./filedepot.module
filedepot_nodeapi in ./filedepot.module
Implements hook_nodeapi().

File

./lib-common.php, line 186
lib-common.php Common library of functions for the applications

Code

function filedepot_getTopLevelParent($cid) {
  $pid = db_result(db_query("SELECT pid FROM {filedepot_categories} WHERE cid=%d", $cid));
  if ($pid == 0) {
    return $cid;
  }
  else {
    $cid = filedepot_getTopLevelParent($pid);
  }
  return $cid;
}