[TASK] Refactor flashmessages.js 29/34029/15
authorFrank Nägler <typo3@naegler.net>
Wed, 12 Nov 2014 19:15:56 +0000 (20:15 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Sun, 23 Nov 2014 16:07:25 +0000 (17:07 +0100)
Refactor flashmessages.js:
* rename to FlashMessages.js
* match severities from PHP flashMessages
* remove ExtJS
* introduce require.js module
* introduce bootstrap alert message code
* init global one time for complete backend
* load component in top context, referenced now with
  top.TYPO3.Flashmessage.* on any page possible

Resolves: #62893
Releases: master
Change-Id: I10a5222a0fbdf371abcc24d2ebb233a8a9fec150
Reviewed-on: http://review.typo3.org/34029
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
16 files changed:
typo3/js/extjs/components/pagetree/javascript/actions.js
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Resources/Public/JavaScript/FlashMessages.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/flashmessages.js [deleted file]
typo3/sysext/cms/layout/js/typo3pageModule.js
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-62893-FlashmessageJavaScriptObjectMoved.rst [new file with mode: 0644]
typo3/sysext/extensionmanager/Resources/Public/JavaScript/main.js
typo3/sysext/extensionmanager/Resources/Public/JavaScript/ter.js
typo3/sysext/extensionmanager/Resources/Public/JavaScript/update.js
typo3/sysext/lang/Resources/Public/JavaScript/LangModule.js
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/t3editor/res/jslib/t3editor.js
typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Classes/Controller/ReviewController.php

index bc8f523..2dc1999 100644 (file)
@@ -31,7 +31,7 @@ TYPO3.Components.PageTree.Actions = {
         */
        evaluateResponse: function(response) {
                if (response.success === false) {
-                       TYPO3.Flashmessage.display(4, 'Exception', response.message);
+                       top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, 'Exception', response.message);
                        return false;
                }
 
index 313baa4..6621156 100644 (file)
@@ -118,7 +118,6 @@ class BackendController {
                        'md5' => 'sysext/backend/Resources/Public/JavaScript/md5.js',
                        'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js',
                        'evalfield' => 'sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js',
-                       'flashmessages' => 'sysext/backend/Resources/Public/JavaScript/flashmessages.js',
                        'tabclosemenu' => 'js/extjs/ux/ext.ux.tabclosemenu.js',
                        'notifications' => 'sysext/backend/Resources/Public/JavaScript/notifications.js',
                        'backend' => 'sysext/backend/Resources/Public/JavaScript/backend.js',
@@ -136,6 +135,8 @@ class BackendController {
                // Add default BE css
                $this->pageRenderer->addCssLibrary('contrib/normalize/normalize.css', 'stylesheet', 'all', '', TRUE, TRUE);
 
+               // load FlashMessages functionality
+               $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/FlashMessages');
                $this->css = '';
                $this->initializeToolbarItems();
                $this->menuWidth = isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW']) ? (int)$GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'] : $this->menuWidthDefault;
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FlashMessages.js b/typo3/sysext/backend/Resources/Public/JavaScript/FlashMessages.js
new file mode 100644 (file)
index 0000000..9aae5ce
--- /dev/null
@@ -0,0 +1,94 @@
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * FlashMessage rendered by jQuery
+ *
+ * @author Steffen Kamper <info@sk-typo3.de> (ExtJS)
+ * @author Frank Nägler <typo3@naegler.net> (jQuery)
+ */
+
+define('TYPO3/CMS/Backend/FlashMessages', ['jquery'], function ($) {
+       var Severity = {
+               notice: -2,
+               // @deprecated since 7.0 and will be removed with CMS 9, use info instead of information
+               information: -1,
+               info: -1,
+               ok: 0,
+               warning: 1,
+               error: 2
+       };
+
+       var Flashmessage = {
+               messageContainer: null
+       };
+
+       /**
+        * Shows popup
+        * @member TYPO3.Flashmessage
+        * @param int severity (TYPO3.Severity.*)
+        * @param string title
+        * @param string message
+        * @param float duration in sec (default 5)
+        */
+       Flashmessage.display = function (severity, title, message, duration) {
+               var className = '';
+               switch (severity) {
+                       case TYPO3.Severity.notice:
+                               className = 'notice';
+                               break;
+                       case TYPO3.Severity.info:
+                               className = 'info';
+                               break;
+                       case TYPO3.Severity.ok:
+                               className = 'success';
+                               break;
+                       case TYPO3.Severity.warning:
+                               className = 'warning';
+                               break;
+                       case TYPO3.Severity.error:
+                               className = 'danger';
+                               break;
+                       default:
+                               className = 'info';
+               }
+               duration = duration || 5;
+               if (!this.messageContainer) {
+                       this.messageContainer = $('<div id="msg-div" style="position:absolute;z-index:10000;width: 100%;"></div>').appendTo('body');
+               }
+               $box = $('<div class="alert alert-' + className + ' alert-dismissible fade in" role="alert">' +
+               '<button type="button" class="close" data-dismiss="alert">' +
+               '<span aria-hidden="true">&times;</span>' +
+               '<span class="sr-only">Close</span>' +
+               '</button>' +
+               '<h4>' + title + '</h4>' +
+               '<p>' + message + '</p>' +
+               '</div>');
+               $box.appendTo(this.messageContainer);
+               $box.css({
+                       width: '400px',
+                       position: 'relative',
+                       margin: '0 auto 10px auto'
+               });
+               $box.fadeIn().delay(duration * 1000).slideUp();
+       };
+
+       /**
+        * return the Flashmessage object
+        */
+       return function () {
+               TYPO3.Severity = Severity;
+               TYPO3.Flashmessage = Flashmessage;
+               return Flashmessage;
+       }();
+});
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js b/typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js
new file mode 100644 (file)
index 0000000..62ddd2b
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Javascript compatibility file for a breaking change to the
+ * flashmessage javascript object
+ * @deprecate this file will be removed with CMS 9
+ */
+
+// map old Flashmessage API to the new one
+if (!TYPO3.Flashmessage) {
+       TYPO3.Flashmessage = {};
+       TYPO3.Flashmessage.display = function(severity, title, message, duration) {
+               if (console !== undefined) {
+                       console.log('TYPO3.Flashmessage.display is deprecated and will be removed with CMS 9, please use top.TYPO3.Flashmessage.display');
+               }
+               top.TYPO3.Flashmessage.display(severity, title, message, duration);
+       }
+}
+
+// map old Severity object to the new one
+if (!TYPO3.Severity) {
+       TYPO3.Severity = top.TYPO3.Severity;
+}
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/flashmessages.js b/typo3/sysext/backend/Resources/Public/JavaScript/flashmessages.js
deleted file mode 100644 (file)
index 7caf3f6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Flashmessage rendered by ExtJS
- *
- * @author Steffen Kamper <info@sk-typo3.de>
- */
-Ext.ns('TYPO3');
-
-/**
- * Object for named severities
- */
-TYPO3.Severity = {
-       notice: 0,
-       information: 1,
-       ok: 2,
-       warning: 3,
-       error: 4
-};
-
-/**
- * @class TYPO3.Flashmessage
- * Passive popup box singleton
- * @singleton
- *
- * Example (Information message):
- * TYPO3.Flashmessage.display(1, 'TYPO3 Backend - Version 4.4', 'Ready for take off', 3);
- */
-TYPO3.Flashmessage = function() {
-       var messageContainer;
-       var severities = ['notice', 'information', 'ok', 'warning', 'error'];
-       var classMap = {
-               'notice': 'notice',
-               'information': 'info',
-               'ok': 'success',
-               'warning': 'warning',
-               'error': 'danger'
-       }
-
-       function createBox(severity, title, message) {
-               var className = (severity !== undefined && severities[severity] ? classMap[severities[severity]] : classMap['information']);
-               return ['<div class="typo3-messages"><div class="alert alert-', className, '" style="width: 400px">',
-                               '<div class="pull-right t3-icon fa fa-close t3js-icon-actions-message-close" style="cursor: pointer;"></div>',
-                               '<h4>', title, '</h4>',
-                               '<div class="alert-body">', message, '</div>',
-                               '</div></div>'].join('');
-       }
-
-       return {
-               /**
-                * Shows popup
-                * @member TYPO3.Flashmessage
-                * @param int severity (0=notice, 1=information, 2=ok, 3=warning, 4=error)
-                * @param string title
-                * @param string message
-                * @param float duration in sec (default 5)
-                */
-               display : function(severity, title, message, duration) {
-                       duration = duration || 5;
-                       if (!messageContainer) {
-                               messageContainer = Ext.DomHelper.insertFirst(document.body, {
-                                       id   : 'msg-div',
-                                       style: 'position:absolute;z-index:10000'
-                               }, true);
-                       }
-
-                       var box = Ext.DomHelper.append(messageContainer, {
-                               html: createBox(severity, title, message)
-                       }, true);
-                       messageContainer.alignTo(document, 't-t');
-                       box.child('.t3js-icon-actions-message-close').on('click', function (e, t, o) {
-                               var node;
-                               node = new Ext.Element(Ext.get(t).findParent('div.typo3-messages'));
-                               node.hide();
-                               Ext.removeNode(node.dom);
-                       }, box);
-                       box.slideIn('t').pause(duration).ghost('t', {remove: true});
-               }
-       };
-}();
index c9229ea..8fd2607 100644 (file)
@@ -197,7 +197,7 @@ TYPO3.Components.PageModule = {
                         */
                        evaluateResponse: function (response) {
                                if (response.success === false) {
-                                       TYPO3.Flashmessage.display(4, 'Exception', response.message);
+                                       top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, 'Exception', response.message);
                                        return false;
                                }
 
index ec1651e..0bbb1af 100644 (file)
@@ -1379,8 +1379,11 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
                if (count($filterNamespaces) === 0) {
                        $filterNamespaces = array('TYPO3');
                }
-               // For ExtDirect we need flash message support
-               $this->addJsFile(GeneralUtility::resolveBackPath($this->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js'));
+               // @deprecated since 7.0 and will be removed with CMS 8
+               // add compatibility mapping for the old flashmessage API
+               $this->addJsFile(GeneralUtility::resolveBackPath($this->backPath .
+                       'sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js'));
+
                // Add language labels for ExtDirect
                if (TYPO3_MODE === 'FE') {
                        $this->addInlineLanguageLabelArray(array(
@@ -1447,8 +1450,8 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
 
                        Ext.Direct.on("exception", function(event) {
                                if (event.code === Ext.Direct.exceptions.TRANSPORT && !event.where) {
-                                       TYPO3.Flashmessage.display(
-                                               TYPO3.Severity.error,
+                                       top.TYPO3.Flashmessage.display(
+                                               top.TYPO3.Severity.error,
                                                TYPO3.l10n.localize("extDirect_timeoutHeader"),
                                                TYPO3.l10n.localize("extDirect_timeoutMessage"),
                                                30
@@ -1462,8 +1465,8 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
                                                        "ExtDirect - Exception"
                                                );
                                        } else if (event.code === "router") {
-                                               TYPO3.Flashmessage.display(
-                                                       TYPO3.Severity.error,
+                                               top.TYPO3.Flashmessage.display(
+                                                       top.TYPO3.Severity.error,
                                                        event.code,
                                                        event.message,
                                                        30
@@ -1617,7 +1620,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
                        $this->requireJsConfig['paths'] = array(
                                'jquery-ui' => 'contrib/jquery-ui',
                                'jquery' => 'contrib/jquery',
-                               'twbs' => 'contrib/twbs/bootstrap.min',
+                               'twbs' => 'contrib/twbs/bootstrap.min'
                        );
                        // get all extensions that are loaded
                        $loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-62893-FlashmessageJavaScriptObjectMoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-62893-FlashmessageJavaScriptObjectMoved.rst
new file mode 100644 (file)
index 0000000..b329574
--- /dev/null
@@ -0,0 +1,44 @@
+==================================================================================
+Deprecation: #62893 - Flashmessage JavaScript object TYPO3.Flashmessages was moved
+==================================================================================
+
+Description
+===========
+
+Flashmessages JavaScript object was moved from ``TYPO3.Flashmessages`` to ``top.TYPO3.Flashmessages``.
+The severity constant values was changed to correspond to the same values (-2,-1,0,1,2) of the constants as in PHP.
+The constants ``TYPO3.Severity.information`` was marked as deprecated.
+3rd party extensions referring to ``TYPO3.Severity.information`` will work until CMS 9.
+A compatibility file was introduced to map ``TYPO3.Flashmessages`` to ``top.TYPO3.Flashmessages``, will also work until CMS 9.
+
+
+Impact
+======
+
+If a 3rd party extension calls the mentioned methods directly, a deprecation log will be written to the browser console.
+
+
+Affected installations
+======================
+
+A TYPO3 instance is affected if a 3rd party extension refers to the method ``TYPO3.Flashmessages.display()`` or use ``TYPO3.Severity.information`` constants.
+
+
+Migration
+=========
+
+The affected 3rd party extensions must be modified to use ``top.TYPO3.Flashmessages`` instead of ``TYPO3.Flashmessages``.
+
+Example:
+
+    .. code-block:: javascript
+
+    // Old and deprecated:
+    TYPO3.Flashmessages.display(TYPO3.Severity.notice)
+
+    // New and the only correct way:
+    top.TYPO3.Flashmessages.display(top.TYPO3.Severity.notice)
+
+    ..
+
+The ``TYPO3.Severity`` object moved to ``top.TYPO3.Severity``. Use ``top.TYPO3.Severity.*`` instead.
index 8e69a6d..9958541 100644 (file)
                                                dataType: 'json',
                                                success: function(data) {
                                                        if (data.hasErrors) {
-                                                               TYPO3.Flashmessage.display(
-                                                                       TYPO3.Severity.error,
+                                                               top.TYPO3.Flashmessage.display(
+                                                                       top.TYPO3.Severity.error,
                                                                        TYPO3.l10n.localize('downloadExtension.updateExtension.error'),
                                                                        data.errorMessage,
                                                                        15
                                                                );
                                                        } else {
-                                                               TYPO3.Flashmessage.display(
-                                                                       TYPO3.Severity.information,
+                                                               top.TYPO3.Flashmessage.display(
+                                                                       top.TYPO3.Severity.info,
                                                                        TYPO3.l10n.localize('extensionList.updateFlashMessage.title'),
                                                                        TYPO3.l10n.localize('extensionList.updateFlashMessage.message').replace(/\{0\}/g, data.extension),
                                                                        15
                                                        // Create an error message with diagnosis info.
                                                        var errorMessage = textStatus + '(' + errorThrown + '): ' + jqXHR.responseText;
 
-                                                       TYPO3.Flashmessage.display(
-                                                               TYPO3.Severity.error,
+                                                       top.TYPO3.Flashmessage.display(
+                                                               top.TYPO3.Severity.error,
                                                                TYPO3.l10n.localize('downloadExtension.updateExtension.error'),
                                                                errorMessage,
                                                                15
index dbcecfd..2a369c3 100644 (file)
@@ -93,7 +93,7 @@
                } else {
                        if(data.hasErrors) {
                                $('.typo3-extension-manager').unmask();
-                               TYPO3.Flashmessage.display(TYPO3.Severity.error, data.title, data.message, 15);
+                               top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, data.title, data.message, 15);
                        } else {
                                var button = 'yes';
                                var dialog = [];
                                                        });
                                                        successMessage += '</ul>';
                                                });
-                                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('extensionList.dependenciesResolveFlashMessage.title').replace(/\{0\}/g, data.extension), successMessage, 15);
+                                               top.TYPO3.Flashmessage.display(top.TYPO3.Severity.info, TYPO3.l10n.localize('extensionList.dependenciesResolveFlashMessage.title').replace(/\{0\}/g, data.extension), successMessage, 15);
                                        }
                                }
                        });
index dd959b3..9ba1563 100644 (file)
@@ -46,7 +46,7 @@
 
                                // Something went wrong, show message
                                if (data.errorMessage.length) {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.warning, TYPO3.l10n.localize('extensionList.updateFromTerFlashMessage.title'), data.errorMessage, 10);
+                                       top.TYPO3.Flashmessage.display(top.TYPO3.Severity.warning, TYPO3.l10n.localize('extensionList.updateFromTerFlashMessage.title'), data.errorMessage, 10);
                                }
 
                                // Message with latest updates
@@ -75,8 +75,8 @@
                                var errorMessage = textStatus + '(' + errorThrown + '): ' + jqXHR.responseText;
 
 
-                               TYPO3.Flashmessage.display(
-                                       TYPO3.Severity.warning,
+                               top.TYPO3.Flashmessage.display(
+                                       top.TYPO3.Severity.warning,
                                        TYPO3.l10n.localize('extensionList.updateFromTerFlashMessage.title'),
                                        errorMessage,
                                        10
index cbe4c73..6791aba 100644 (file)
@@ -260,8 +260,8 @@ var languageModule = {
                if (typeof label !== 'string' || label === '') {
                        return;
                }
-               TYPO3.Flashmessage.display(
-                       TYPO3.Severity.error,
+               top.TYPO3.Flashmessage.display(
+                       top.TYPO3.Severity.error,
                        TYPO3.l10n.localize('flashmessage.error'),
                        TYPO3.l10n.localize(label),
                        5
@@ -278,8 +278,8 @@ var languageModule = {
                if (typeof label !== 'string' || label === '') {
                        return;
                }
-               TYPO3.Flashmessage.display(
-                       TYPO3.Severity.information,
+               top.TYPO3.Flashmessage.display(
+                       top.TYPO3.Severity.info,
                        TYPO3.l10n.localize('flashmessage.information'),
                        TYPO3.l10n.localize(label),
                        3
@@ -296,8 +296,8 @@ var languageModule = {
                if (typeof label !== 'string' || label === '') {
                        return;
                }
-               TYPO3.Flashmessage.display(
-                       TYPO3.Severity.ok,
+               top.TYPO3.Flashmessage.display(
+                       top.TYPO3.Severity.ok,
                        TYPO3.l10n.localize('flashmessage.success'),
                        TYPO3.l10n.localize(label),
                        3
@@ -407,4 +407,4 @@ var languageModule = {
  */
 jQuery(document).ready(function($) {
        languageModule.initialize();
-});
\ No newline at end of file
+});
index b5e82d1..7545fd5 100644 (file)
@@ -203,7 +203,6 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
                }');
                // Add JS
                $this->pageRenderer->addJsFile($this->doc->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js');
-               $this->pageRenderer->addJsFile($this->doc->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js');
                $this->pageRenderer->addJsFile($this->doc->backPath . 'sysext/backend/Resources/Public/JavaScript/iframepanel.js');
                if ($this->modTS['showCheckLinkTab'] == 1) {
                        $this->updateListHtml = '<input type="submit" name="updateLinkList" id="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
index 04b9c18..1a3ec00 100644 (file)
@@ -173,9 +173,9 @@ T3editor.prototype = {
                                this.textModified = false;
                        } else {
                                if (typeof returnedData.exceptionMessage != 'undefined') {
-                                       TYPO3.Flashmessage.display(4, T3editor.lang.errorWhileSaving[0]['target'], returnedData.exceptionMessage);
+                                       top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, T3editor.lang.errorWhileSaving[0]['target'], returnedData.exceptionMessage);
                                } else {
-                                       TYPO3.Flashmessage.display(4, T3editor.lang.errorWhileSaving[0]['target']);
+                                       top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, T3editor.lang.errorWhileSaving[0]['target']);
                                }
                        }
                        this.modalOverlay.hide();
index 1266b3f..f5c3231 100644 (file)
@@ -57,7 +57,6 @@ class PreviewController extends AbstractController {
                $states = $GLOBALS['BE_USER']->uc['moduleData']['Workspaces']['States'];
                $this->pageRenderer->addInlineSetting('Workspaces', 'States', $states);
                $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/notifications.js');
-               $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js');
                $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/iframepanel.js');
                $resourcePathJavaScript = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
                $jsFiles = array(
index 90a2513..b0d91a9 100644 (file)
@@ -146,7 +146,6 @@ class ReviewController extends AbstractController {
                $this->pageRenderer->addExtDirectCode(array(
                        'TYPO3.Workspaces'
                ));
-               $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js');
                $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.grid.RowExpander.js');
                $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.app.SearchField.js');
                $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js');