From fb434b97b31ab797674822db93820d97ba7fdd20 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 11 Jun 2012 15:19:59 +0200 Subject: [PATCH] Improved clipboard actions --- .../files/lib/action/ClipboardAction.class.php | 2 +- .../system/clipboard/ClipboardEditorItem.class.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/action/ClipboardAction.class.php b/wcfsetup/install/files/lib/action/ClipboardAction.class.php index ba7e9a1874..4e27af8cb1 100644 --- a/wcfsetup/install/files/lib/action/ClipboardAction.class.php +++ b/wcfsetup/install/files/lib/action/ClipboardAction.class.php @@ -136,7 +136,7 @@ class ClipboardAction extends AbstractSecureAction { 'actionName' => $item->getName(), 'internalData' => $item->getInternalData(), 'parameters' => $item->getParameters(), - 'label' => WCF::getLanguage()->get('wcf.clipboard.item.' . $item->getName()), + 'label' => WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.' . $item->getName(), array('count' => $item->getCount())), 'url' => $item->getURL() ); } diff --git a/wcfsetup/install/files/lib/system/clipboard/ClipboardEditorItem.class.php b/wcfsetup/install/files/lib/system/clipboard/ClipboardEditorItem.class.php index 3cb49a9058..46eaefbcd1 100644 --- a/wcfsetup/install/files/lib/system/clipboard/ClipboardEditorItem.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/ClipboardEditorItem.class.php @@ -131,4 +131,17 @@ final class ClipboardEditorItem { public function setURL($url) { $this->url = $url; } + + /** + * Returns number of affected items. + * + * @return integer + */ + public function getCount() { + if (isset($this->parameters['objectIDs'])) { + return count($this->parameters['objectIDs']); + } + + return 0; + } } -- 2.20.1