[TASK] Use new modal for not found page when using &edit as parameter 77/50477/2
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 1 Nov 2016 21:44:20 +0000 (22:44 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 2 Nov 2016 02:38:26 +0000 (03:38 +0100)
When using &edit=123124312321 as extra parameter for the backend
an oldschool alert is shown.
Replace this with a nicer modal.

Resolves: #78533
Releases: master
Change-Id: I83d3c7bd358a0eced599a31ec51af6186089d723
Reviewed-on: https://review.typo3.org/50477
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/BackendController.php

index e1019d2..35e8b17 100644 (file)
@@ -661,9 +661,18 @@ class BackendController
                 }
             } else {
                 $this->js .= '
-               // Warning about page editing:
-       alert(' . GeneralUtility::quoteJSvalue(sprintf($this->getLanguageService()->getLL('noEditPage'), $editId)) . ');
-                       ';
+            // Warning about page editing:
+            require(["TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Backend/Severity"], function(Modal, Severity) {
+                Modal.show("", ' . GeneralUtility::quoteJSvalue(sprintf($this->getLanguageService()->getLL('noEditPage'), $editId)) . ', Severity.notice, [{
+                    text: ' . GeneralUtility::quoteJSvalue($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:close')) . ',
+                    active: true,
+                    btnClass: "btn-info",
+                    name: "cancel",
+                    trigger: function () {
+                        Modal.currentModal.trigger("modal-dismiss");
+                    }
+                }])
+            });';
             }
         }
     }