You are here

function filedepot_getTopLevelParent in filedepot 7

Same name and namespace in other branches
  1. 6 lib-common.php \filedepot_getTopLevelParent()
4 calls to filedepot_getTopLevelParent()
filedepot::approveFileSubmission in ./filedepot.class.php
filedepot_native_submit in ./filedepot.module
filedepot_newfile_submit in ./filedepot.module
filedepot_node_access in ./filedepot.module
Implementation of hook_node_access().

File

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

Code

function filedepot_getTopLevelParent($cid) {
  $pid = db_query("SELECT pid FROM {filedepot_categories} WHERE cid=:cid", array(
    ':cid' => $cid,
  ))
    ->fetchField();
  if ($pid == 0) {
    return $cid;
  }
  else {
    $cid = filedepot_getTopLevelParent($pid);
  }
  return $cid;
}