[TASK] Replace confirm for delete record in PageModule 01/41501/2
authorFrank Nägler <typo3@naegler.net>
Thu, 16 Jul 2015 18:22:27 +0000 (20:22 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 16 Jul 2015 18:46:29 +0000 (20:46 +0200)
Resolves: #68213
Releases: master
Change-Id: Ia01c4b1e78ec05c5b234d2c16ca9cd7004811d6b
Reviewed-on: http://review.typo3.org/41501
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index a73a30f..40b5fdd 100644 (file)
@@ -377,6 +377,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                /** @var $pageRenderer PageRenderer */
                $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
                $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LayoutModule/DragDrop');
+               $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
                $userCanEditPage = $this->ext_CALC_PERMS & Permission::PAGE_EDIT && !empty($this->id);
                if ($this->tt_contentConfig['languageColsPointer'] > 0) {
                        $userCanEditPage = $this->getBackendUser()->check('tables_modify', 'pages_language_overlay');
@@ -1163,13 +1164,16 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                }
                                // Delete
                                $params = '&cmd[tt_content][' . $row['uid'] . '][delete]=1';
-                               $confirm = GeneralUtility::quoteJSvalue($this->getLanguageService()->getLL('deleteWarning')
+                               $confirm = $this->getLanguageService()->getLL('deleteWarning')
                                        . BackendUtility::translationCount('tt_content', $row['uid'], (' '
-                                               . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.translationsOfRecord')))
+                                       . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.translationsOfRecord'))
                                );
-                               $out .= '<a class="btn btn-default" href="' . htmlspecialchars($this->getPageLayoutController()->doc->issueCommand($params))
-                                       . '" onclick="' . htmlspecialchars(('return confirm(' . $confirm . ');')) . '" title="'
-                                       . $this->getLanguageService()->getLL('deleteItem', TRUE) . '">'
+                               $out .= '<a class="btn btn-default t3js-modal-trigger" href="' . htmlspecialchars($this->getPageLayoutController()->doc->issueCommand($params)) . '"'
+                                       . ' data-severity="warning"'
+                                       . ' data-title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_alt_doc.xlf:label.confirm.delete_record.title')) . '"'
+                                       . ' data-content="' . htmlspecialchars($confirm) . '" '
+                                       . ' data-button-close-text="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:cancel')) . '"'
+                                       . ' title="' . $this->getLanguageService()->getLL('deleteItem', TRUE) . '">'
                                        . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
                                if ($out) {
                                        $out = '<div class="btn-group btn-group-sm" role="group">' . $out . '</div>';