mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +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
|
* @return boolean true if folder is a subfolder
|
||||||
*/
|
*/
|
||||||
function isDescendant($folder) { /* {{{ */
|
function isDescendant($folder) { /* {{{ */
|
||||||
if ($this->_parentID == $folder->getID())
|
if(!$this->getParent())
|
||||||
return true;
|
|
||||||
elseif (isset($this->_parentID)) {
|
|
||||||
$res = $this->getParent();
|
|
||||||
if (!$res) return false;
|
|
||||||
|
|
||||||
return $this->_parent->isDescendant($folder);
|
|
||||||
} else
|
|
||||||
return false;
|
return false;
|
||||||
|
if($this->getParent()->getID() == $folder->getID())
|
||||||
|
return true;
|
||||||
|
return $this->getParent()->isDescendant($folder);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user