mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
add $skiproot and $sep parameter to getFolderPathPlain()
This commit is contained in:
parent
c87eb6c6f0
commit
e8192d2813
|
@ -782,17 +782,20 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
* Run str_replace(' / ', '/', $path) on it to get a valid unix
|
* Run str_replace(' / ', '/', $path) on it to get a valid unix
|
||||||
* file system path.
|
* file system path.
|
||||||
*
|
*
|
||||||
|
* @param bool $skiproot skip the name of the root folder and start with $sep
|
||||||
|
* @param string $sep separator between path elements
|
||||||
* @return string path separated with ' / '
|
* @return string path separated with ' / '
|
||||||
*/
|
*/
|
||||||
function getFolderPathPlain() { /* {{{ */
|
function getFolderPathPlain($skiproot = false, $sep = ' / ') { /* {{{ */
|
||||||
$path="";
|
$path="";
|
||||||
$folderPath = $this->getPath();
|
$folderPath = $this->getPath();
|
||||||
for ($i = 0; $i < count($folderPath); $i++) {
|
for ($i = 0; $i < count($folderPath); $i++) {
|
||||||
$path .= $folderPath[$i]->getName();
|
if($i > 0 || !$skiproot)
|
||||||
|
$path .= $folderPath[$i]->getName();
|
||||||
if ($i +1 < count($folderPath))
|
if ($i +1 < count($folderPath))
|
||||||
$path .= " / ";
|
$path .= $sep;
|
||||||
}
|
}
|
||||||
return $path;
|
return trim($path);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user