From b6128f977cbec78c575c9ee2fd66799764023251 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 15 Apr 2021 15:19:41 +0200 Subject: [PATCH] Add `ClipboardHandler::isMarked()` (#4124) See WoltLab/com.woltlab.wbb#454 --- .../files/lib/system/clipboard/ClipboardHandler.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php index 80fb8610d1..fa9f4887cb 100644 --- a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php @@ -313,6 +313,14 @@ class ClipboardHandler extends SingletonFactory return $this->markedItems; } + /** + * Returns `true` if the object with the given data is marked. + */ + public function isMarked(int $objectTypeID, int $objectID): bool + { + return isset($this->getMarkedItems($objectTypeID)[$objectID]); + } + /** * Returns the data of the items for clipboard editor or `null` if no items are marked. * -- 2.20.1