add method isOnClipboard()

This commit is contained in:
Uwe Steinmann 2025-03-17 12:50:01 +01:00
parent dee29cb64f
commit 9a3f217e45

View File

@ -286,6 +286,24 @@ class SeedDMS_Session {
return (array) $this->data['clipboard'];
} /* }}} */
/**
* Check if object is on clipboard
*
* @param object $object Document or folder
*/
function isOnClipboard($object) { /* {{{ */
/* id is only set if load() was called before */
if($this->id) {
$dms = $object->getDMS();
if($object->isType('document')) {
return in_array($object->getID(), $this->data['clipboard']['docs']);
} elseif($object->isType('folder')) {
return in_array($object->getID(), $this->data['clipboard']['folders']);
}
}
return false;
} /* }}} */
/**
* Add to clipboard of session
*