[TASK] Add confirmation modal to delete a site configuration 70/57170/6
authorGeorg Ringer <georg.ringer@gmail.com>
Sun, 10 Jun 2018 18:50:34 +0000 (20:50 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Jun 2018 09:38:51 +0000 (11:38 +0200)
Improve usability by adding a modal to require a second click.

Resolves: #85143
Releases: master
Change-Id: I310a655711aa730feca0b96e157c19eac8b7fcb0
Reviewed-on: https://review.typo3.org/57170
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php
typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration.xlf
typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Overview.html

index f91fea9..5e38255 100644 (file)
@@ -85,6 +85,7 @@ class SiteConfigurationController
     public function handleRequest(ServerRequestInterface $request): ResponseInterface
     {
         $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
+        $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
         $action = $request->getQueryParams()['action'] ?? $request->getParsedBody()['action'] ?? 'overview';
         $this->initializeView($action);
         $result = call_user_func_array([$this, $action . 'Action'], [$request]);
index cd16846..cf076de 100644 (file)
@@ -18,6 +18,9 @@
                        <trans-unit id="overview.addSiteConfiguration">
                                <source>Add new site configuration for this site</source>
                        </trans-unit>
+                       <trans-unit id="overview.deleteSiteConfiguration">
+                               <source>Delete site configuration</source>
+                       </trans-unit>
                        <trans-unit id="overview.baseUrl">
                                <source>Base URLs</source>
                        </trans-unit>
index f016105..0ff56b6 100644 (file)
                             <f:be.link route="site_configuration" parameters="{action: 'edit', site: page.siteIdentifier}" title="Edit" class="btn btn-default">
                                 <core:icon identifier="actions-open" />
                             </f:be.link>
-                            <f:be.link route="site_configuration" parameters="{action: 'delete', site:page.siteIdentifier}" title="Delete configuration" class="btn btn-default">
+                            <f:be.link route="site_configuration" parameters="{action: 'delete', site:page.siteIdentifier}" title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.deleteSiteConfiguration')}" class="btn btn-default t3js-modal-trigger"
+                                       data="{
+                                            toggle:'tooltip',
+                                            severity: 'error',
+                                            title:'{f:translate(key:\'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.deleteSiteConfiguration\')}',
+                                            button-ok-text:'{f:translate(key:\'LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:button.delete\')}'
+                                            }">
                                 <core:icon identifier="actions-delete" />
                             </f:be.link>
                         </f:if>