mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 06:01:19 +00:00
check if the folder set by setRootFolderID() actually exists
This commit is contained in:
parent
ffd5cd9a7b
commit
0cd4c9b727
|
@ -527,13 +527,23 @@ class SeedDMS_Core_DMS {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set id of root folder
|
* Set id of root folder
|
||||||
|
*
|
||||||
* This function must be called right after creating an instance of
|
* This function must be called right after creating an instance of
|
||||||
* {@link SeedDMS_Core_DMS}
|
* {@link SeedDMS_Core_DMS}
|
||||||
*
|
*
|
||||||
|
* The new root folder id will only be set if the folder actually
|
||||||
|
* exists. In that case the old root folder id will be returned.
|
||||||
|
* If it does not exists, the method will return false;
|
||||||
* @param integer $id id of root folder
|
* @param integer $id id of root folder
|
||||||
|
* @return boolean/int old root folder id if new root folder exists, otherwise false
|
||||||
*/
|
*/
|
||||||
function setRootFolderID($id) { /* {{{ */
|
function setRootFolderID($id) { /* {{{ */
|
||||||
$this->rootFolderID = $id;
|
if($this->getFolder($id)) {
|
||||||
|
$oldid = $this->rootFolderID;
|
||||||
|
$this->rootFolderID = $id;
|
||||||
|
return $oldid;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user