You are here

private function filedepot_archiver::getProcessedPath in filedepot 7

Same name in this branch
  1. 7 filedepot_archiver.class.php \filedepot_archiver::getProcessedPath()
  2. 7 filedepot_archiver.zip.class.php \filedepot_archiver::getProcessedPath()

Returns the full path from first parent (top level) to last parent Also adds all lookup items to the queue to preserve database lookups

4 calls to filedepot_archiver::getProcessedPath()
filedepot_archiver::createArchive in ./filedepot_archiver.class.php
Create the requested archive
filedepot_archiver::createArchive in ./filedepot_archiver.zip.class.php
Create the requested archive
filedepot_archiver::generateAllFilesUnderCidRecursively in ./filedepot_archiver.class.php
Generate all the files under a given category ID
filedepot_archiver::generateAllFilesUnderCidRecursively in ./filedepot_archiver.zip.class.php
Generate all the files under a given category ID

File

./filedepot_archiver.class.php, line 122
filedepot_archiver.class.php Archiving class for filedepot

Class

filedepot_archiver
@file filedepot_archiver.class.php Archiving class for filedepot

Code

private function getProcessedPath($cid) {
  $path = array();
  $ppo = $this
    ->getPathComponent($cid);
  while (true) {
    if ($ppo === NULL) {
      break;
    }
    $path[] = $ppo->catName;

    //if (($ppo->catPid == 0)) {

    //  break;

    //}
    $ppo = $this
      ->getPathComponent($ppo->catPid);
  }

  // Reverse the array so it is in the proper order, implode it into a proper path, and then add a trailing slash
  // This is so that there is no trailing slash if no folder name
  if (count($path) > 0) {
    return implode('/', array_reverse($path)) . '/';
  }
  else {
    return "";
  }
}