[TASK] Replace confirm SortPagesWizardModuleFunction::wiz_linkOrder 49/41549/4
authorFrank Nägler <typo3@naegler.net>
Fri, 17 Jul 2015 08:14:10 +0000 (10:14 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 18 Jul 2015 13:03:38 +0000 (15:03 +0200)
Resolves: #68254
Releases: master
Change-Id: I8f4fe3d1216e32ba7e60464b27fe16348c24b188
Reviewed-on: http://review.typo3.org/41549
Reviewed-by: Jozef Spisiak <jozef@pixelant.se>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/lang/locallang_common.xlf
typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php

index 053313c..c370562 100644 (file)
                        <trans-unit id="yes">
                                <source>Yes</source>
                        </trans-unit>
+                       <trans-unit id="pleaseConfirm">
+                               <source>Please confirm</source>
+                       </trans-unit>
                </body>
        </file>
 </xliff>
index a25e83d..c205be5 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\WizardSortpages\View;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -30,6 +31,8 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
        public function main() {
                $lang = $this->getLanguageService();
                $lang->includeLLFile('EXT:wizard_sortpages/locallang.xlf');
+               $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
+               $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
                $out = $this->pObj->doc->header($lang->getLL('wiz_sort'));
                if ($this->getBackendUser()->workspace === 0) {
                        $theCode = '';
@@ -111,14 +114,18 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
         * @return string HTML string
         */
        protected function wiz_linkOrder($title, $order) {
-               return '<a class="btn btn-default" href="' . htmlspecialchars(
-                       BackendUtility::getModuleUrl('web_func',
-                               array(
-                                       'id' => $GLOBALS['SOBE']->id,
-                                       'sortByField' => $order
-                               )
+               $href = BackendUtility::getModuleUrl('web_func',
+                       array(
+                               'id' => $GLOBALS['SOBE']->id,
+                               'sortByField' => $order
                        )
-               ) . '" onclick="return confirm(' . GeneralUtility::quoteJSvalue($this->getLanguageService()->getLL('wiz_changeOrder_msg1')) . ')">' . htmlspecialchars($title) . '</a>';
+               );
+               return '<a class="btn btn-default t3js-modal-trigger" href="' . htmlspecialchars($href) . '" '
+                       . ' data-severity="warning"'
+                       . ' data-title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:pleaseConfirm', TRUE) . '"'
+                       . ' data-button-close-text="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:cancel', TRUE) . '"'
+                       . ' data-content="' . $this->getLanguageService()->getLL('wiz_changeOrder_msg1', TRUE) . '"'
+                       . ' >' . htmlspecialchars($title) . '</a>';
        }
 
        /**