Improved clipboard actions
authorAlexander Ebert <ebert@woltlab.com>
Mon, 11 Jun 2012 13:19:59 +0000 (15:19 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 11 Jun 2012 13:19:59 +0000 (15:19 +0200)
wcfsetup/install/files/lib/action/ClipboardAction.class.php
wcfsetup/install/files/lib/system/clipboard/ClipboardEditorItem.class.php

index ba7e9a1874f6cc6087f161ed49d85b43aa927dfb..4e27af8cb1f9b82d7633914775da57efa78d5e50 100644 (file)
@@ -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()
                                );
                        }
index 3cb49a905845f7502f74ec450c8ec4ff40070c70..46eaefbcd1c619aeb80b0809156bb9ce6c417b09 100644 (file)
@@ -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;
+       }
 }