mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 17:44:56 +00:00
getFolderPathPlain(): add sep as prefix if skiproot is true
This commit is contained in:
parent
6f9ec7cdc3
commit
291b62eeb2
|
@ -778,8 +778,8 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
/**
|
||||
* Returns a file system path
|
||||
*
|
||||
* This path contains spaces around the slashes for better readability.
|
||||
* Run str_replace(' / ', '/', $path) on it to get a valid unix
|
||||
* This path contains by default spaces around the slashes for better readability.
|
||||
* Run str_replace(' / ', '/', $path) on it or pass '/' as $sep to get a valid unix
|
||||
* file system path.
|
||||
*
|
||||
* @param bool $skiproot skip the name of the root folder and start with $sep
|
||||
|
@ -787,13 +787,14 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
* @return string path separated with ' / '
|
||||
*/
|
||||
function getFolderPathPlain($skiproot = false, $sep = ' / ') { /* {{{ */
|
||||
$path="";
|
||||
$path="".$sep;
|
||||
$folderPath = $this->getPath();
|
||||
for ($i = 0; $i < count($folderPath); $i++) {
|
||||
if($i > 0 || !$skiproot)
|
||||
if($i > 0 || !$skiproot) {
|
||||
$path .= $folderPath[$i]->getName();
|
||||
if ($i +1 < count($folderPath))
|
||||
$path .= $sep;
|
||||
if ($i+1 < count($folderPath))
|
||||
$path .= $sep;
|
||||
}
|
||||
}
|
||||
return trim($path);
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user