[TASK] Hide clipboard menu selector if clipboard is empty 48/41248/3
authorDavid Greiner <hallo@davidgreiner.de>
Tue, 14 Jul 2015 21:28:56 +0000 (23:28 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 14 Jul 2015 21:54:18 +0000 (23:54 +0200)
With this patch the clipboard menu selector becomes visible
if the clipboard is not empty.

Resolves: #68142
Releases: master
Change-Id: I9a0ec271da0b3e5aeeb97cff0b728f8faead9d72
Reviewed-on: http://review.typo3.org/41248
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Clipboard/Clipboard.php

index bb4a162..3bb9b7b 100644 (file)
@@ -268,9 +268,11 @@ class Clipboard {
                if (!$this->fileMode && $elementCount) {
                        $optionArray[] = '<li><a href="#" onclick="' . htmlspecialchars(('window.location.href=' . GeneralUtility::quoteJSvalue($this->editUrl() . '&returnUrl=') . '+top.rawurlencode(window.location.href);')) . '">' . $this->clLabel('edit', 'rm') . '</a></li>';
                }
+
                $deleteLink = '';
-               // Delete:
+               $menuSelector = '';
                if ($elementCount) {
+                       // Delete:
                        $deleteLink = '<a class="btn btn-danger" href="' . htmlspecialchars($removeAllUrl) . '#clip_head">' . IconUtility::getSpriteIcon('actions-document-close', array('title' => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:buttons.clear', TRUE))) . '</a>';
                        if ($this->getBackendUser()->jsConfirmation(JsConfirmation::DELETE)) {
                                $js = '
@@ -282,9 +284,9 @@ class Clipboard {
                                $js = ' window.location.href=' . GeneralUtility::quoteJSvalue($this->deleteUrl(0, ($this->fileMode ? 1 : 0)) . '&redirect=') . '+top.rawurlencode(window.location.href); ';
                        }
                        $optionArray[] = '<li><a href="#" onclick="' . htmlspecialchars($js) . '">' . $this->clLabel('delete', 'rm') . '</a></li>';
-               }
 
-               $menuSelector = '
+                       // menuSelector
+                       $menuSelector = '
                        <div class="btn-group">
                                <button class="btn btn-default dropdown-toggle" type="button" id="menuSelector" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                        ' . $this->clLabel('menu', 'rm') . '
@@ -295,6 +297,7 @@ class Clipboard {
                                </ul>
                        </div>
                        ';
+               }
 
                $out[] = '
                        <tr>