use new method SeedDMS_Core_[Folder|Document]::isType()

This commit is contained in:
Uwe Steinmann 2019-08-08 09:08:27 +02:00
parent a02afe4e64
commit 89e526a5e2

View File

@ -295,10 +295,10 @@ class SeedDMS_Session {
/* id is only set if load() was called before */
if($this->id) {
$dms = $object->_dms;
if(get_class($object) == $dms->getClassname('document')) {
if($object->isType('document')) {
if(!in_array($object->getID(), $this->data['clipboard']['docs']))
array_push($this->data['clipboard']['docs'], $object->getID());
} elseif(get_class($object) == $dms->getClassname('folder')) {
} elseif($object->isType('folder')) {
if(!in_array($object->getID(), $this->data['clipboard']['folders']))
array_push($this->data['clipboard']['folders'], $object->getID());
}
@ -318,11 +318,11 @@ class SeedDMS_Session {
/* id is only set if load() was called before */
if($this->id) {
$dms = $object->_dms;
if(get_class($object) == $dms->getClassname('document')) {
if($object->isType('document')) {
$key = array_search($object->getID(), $this->data['clipboard']['docs']);
if($key !== false)
unset($this->data['clipboard']['docs'][$key]);
} elseif(get_class($object) == $dms->getClassname('folder')) {
} elseif($object->isType('folder')) {
$key = array_search($object->getID(), $this->data['clipboard']['folders']);
if($key !== false)
unset($this->data['clipboard']['folders'][$key]);