mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
sіmplify and possibly fix method isDescendant()
This commit is contained in:
parent
536067200e
commit
d18a3389bc
|
@ -692,15 +692,11 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
* @return boolean true if folder is a subfolder
|
||||
*/
|
||||
function isDescendant($folder) { /* {{{ */
|
||||
if ($this->_parentID == $folder->getID())
|
||||
return true;
|
||||
elseif (isset($this->_parentID)) {
|
||||
$res = $this->getParent();
|
||||
if (!$res) return false;
|
||||
|
||||
return $this->_parent->isDescendant($folder);
|
||||
} else
|
||||
if(!$this->getParent())
|
||||
return false;
|
||||
if($this->getParent()->getID() == $folder->getID())
|
||||
return true;
|
||||
return $this->getParent()->isDescendant($folder);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user