From: Matthias Schmidt Date: Sun, 7 Oct 2012 12:58:31 +0000 (+0200) Subject: Makes clipboard container data X-Git-Tag: 2.0.0_Beta_1~896^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=995afaf1cd96ed9d43b4936592bf7aed043f6c12;p=GitHub%2FWoltLab%2FWCF.git Makes clipboard container data Every data attribute that starts with `type` (like `data-type-foo-bar`) is treated as container type data which is available in the clipboard action interface implementation in the `$typeData` array via `$typeData['fooBar']`. --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index b5379f65eb..51982d71ff 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -916,9 +916,12 @@ WCF.Clipboard = { $container.find('.jsClipboardMarkAll').data('hasContainer', $containerID).click($.proxy(this._markAll, this)); $container.find('input.jsClipboardItem').data('hasContainer', $containerID).click($.proxy(this._click, this)); - if ($container.data('typeContainerID')) { - this._containerData[$container.data('type')] = $container.data('typeContainerID'); - } + this._containerData[$container.data('type')] = {}; + $.each($container.data(), $.proxy(function(index, element) { + if (index.match(/^type(.+)/)) { + this._containerData[$container.data('type')][WCF.String.lcfirst(index.replace(/^type/, ''))] = element; + } + }, this)); }, /** diff --git a/wcfsetup/install/files/lib/action/ClipboardAction.class.php b/wcfsetup/install/files/lib/action/ClipboardAction.class.php index 4e27af8cb1..53f5528818 100644 --- a/wcfsetup/install/files/lib/action/ClipboardAction.class.php +++ b/wcfsetup/install/files/lib/action/ClipboardAction.class.php @@ -78,7 +78,7 @@ class ClipboardAction extends AbstractSecureAction { parent::readParameters(); if (isset($_POST['action'])) $this->action = StringUtil::trim($_POST['action']); - if (isset($_POST['containerData']) && is_array($_POST['containerData'])) $this->containerData = ArrayUtil::toIntegerArray($_POST['containerData']); + if (isset($_POST['containerData']) && is_array($_POST['containerData'])) $this->containerData = $_POST['containerData']; if (isset($_POST['objectIDs']) && is_array($_POST['objectIDs'])) $this->objectIDs = ArrayUtil::toIntegerArray($_POST['objectIDs']); if (isset($_POST['pageClassName'])) $this->pageClassName = StringUtil::trim($_POST['pageClassName']); if (isset($_POST['type'])) $this->type = StringUtil::trim($_POST['type']);