mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +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
|
||||
* 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 ' / '
|
||||
*/
|
||||
function getFolderPathPlain() { /* {{{ */
|
||||
function getFolderPathPlain($skiproot = false, $sep = ' / ') { /* {{{ */
|
||||
$path="";
|
||||
$folderPath = $this->getPath();
|
||||
for ($i = 0; $i < count($folderPath); $i++) {
|
||||
$path .= $folderPath[$i]->getName();
|
||||
for ($i = 0; $i < count($folderPath); $i++) {
|
||||
if($i > 0 || !$skiproot)
|
||||
$path .= $folderPath[$i]->getName();
|
||||
if ($i +1 < count($folderPath))
|
||||
$path .= " / ";
|
||||
$path .= $sep;
|
||||
}
|
||||
return $path;
|
||||
return trim($path);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user