[BUGFIX] EXT:filelist Deleting a folder shows "Yes, delete this folder" 30/47330/2
authorMichael Oehlhof <typo3@oehlhof.de>
Sat, 19 Mar 2016 10:08:29 +0000 (11:08 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 21 Mar 2016 09:30:28 +0000 (10:30 +0100)
The text on the OK button was changed from "Yes, delete this file" to
"Yes, delete this folder" when a folder should be deleted.

Resolves: #75190
Releases: master
Change-Id: I9568865b8f8536e4bc9993e6ab8e607fb7b13eb7
Reviewed-on: https://review.typo3.org/47330
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/filelist/Resources/Private/Templates/FileList/Search.html
typo3/sysext/filelist/Resources/Public/JavaScript/FileDelete.js
typo3/sysext/lang/locallang_alt_doc.xlf
typo3/sysext/lang/locallang_core.xlf

index 6a82840..8d6a55d 100644 (file)
@@ -968,8 +968,10 @@ class FileList extends AbstractRecordList
             $identifier = $fileOrFolderObject->getIdentifier();
             if ($fileOrFolderObject instanceof Folder) {
                 $referenceCountText = BackendUtility::referenceCount('_FILE', $identifier, ' ' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.referencesToFolder'));
+                $deleteType = 'delete_folder';
             } else {
                 $referenceCountText = BackendUtility::referenceCount('sys_file', $fileOrFolderObject->getUid(), ' ' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.referencesToFile'));
+                $deleteType = 'delete_file';
             }
 
             if ($this->getBackendUser()->jsConfirmation(JsConfirmation::DELETE)) {
@@ -987,6 +989,7 @@ class FileList extends AbstractRecordList
                 . '" data-title="' . htmlspecialchars($title)
                 . '" data-identifier="' . htmlspecialchars($fileOrFolderObject->getCombinedIdentifier())
                 . '" data-veri-code="' . $this->getBackendUser()->veriCode()
+                . '" data-delete-type="' . $deleteType
                 . '" title="' . htmlspecialchars($title) . '">'
                 . $this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '</a>';
         } else {
index b5aa5ff..e5f8ad0 100644 (file)
                                                                                        data-content="{f:translate( htmlEscape:'true', key:'LLL:EXT:lang/locallang_core.xlf:mess.delete', arguments: {0:file.name} )}"
                                                                                        data-check="{f:if(condition:settings.jsConfirmationDelete, then:'1', else:'0')}"
                                                                                        data-delete-url="{deleteUrl}"
+                                                                                       data-delete-type="delete_file"
                                                                                        data-redirect-url="{f:uri.action( action:'search', arguments:{ searchWord:'{searchWord->f:format.htmlentities()}' } )}"
                                                                                >
                                                                                        <core:icon identifier="actions-edit-delete" />
index d708f99..760bac5 100644 (file)
@@ -28,6 +28,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
                }
                var identifier = $anchorElement.data('identifier');
                var veriCode = $anchorElement.data('veriCode');
+               var deleteType = $anchorElement.data('deleteType');
                var deleteUrl = $anchorElement.data('deleteUrl') + '&file[delete][0][data]=' + encodeURIComponent(identifier) + '&vC=' + encodeURIComponent(veriCode);
                if ($anchorElement.data('check')) {
                        var $modal = Modal.confirm($anchorElement.data('title'), $anchorElement.data('content'), Severity.warning, [
@@ -38,7 +39,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
                                        name: 'no'
                                },
                                {
-                                       text: TYPO3.lang['buttons.confirm.delete_file.yes'] || 'Yes, delete this file',
+                                       text: TYPO3.lang['buttons.confirm.' + deleteType + '.yes'] || 'Yes, delete this file or folder',
                                        btnClass: 'btn-warning',
                                        name: 'yes'
                                }
index 667424e..36423b0 100644 (file)
@@ -60,6 +60,9 @@
                        <trans-unit id="buttons.confirm.delete_file.yes">
                                <source>Yes, delete this file</source>
                        </trans-unit>
+                       <trans-unit id="buttons.confirm.delete_folder.yes">
+                               <source>Yes, delete this folder</source>
+                       </trans-unit>
                        <trans-unit id="buttons.confirm.delete_record.no">
                                <source>Cancel</source>
                        </trans-unit>
index bbf0a40..21db3f9 100644 (file)
@@ -686,7 +686,7 @@ Do you want to continue WITHOUT saving?</source>
                                <source>Redrawing the page will discard the current data. Do you want to continue?</source>
                        </trans-unit>
                        <trans-unit id="mess.delete">
-                               <source>Are you sure you want to delete "%s"?</source>
+                               <source>Are you sure you want to delete '%s'?</source>
                        </trans-unit>
                        <trans-unit id="mess.deleteClip">
                                <source>Are you sure you want to delete ALL referenced elements (%s) on the clipboard?</source>