[!!!][TASK] Remove ElementBrowser::getMsgBox 07/42007/3
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 28 Jul 2015 04:24:14 +0000 (06:24 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 4 Aug 2015 15:37:07 +0000 (17:37 +0200)
Messages should be rendered by FlashMessages and not by html tables.
Drop the whole method and change the usages to proper API.

Change-Id: I927c5042fe6179c44c597d1d185d683727ff506b
Resolves: #68571
Releases: master
Reviewed-on: http://review.typo3.org/42007
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Build/Resources/Public/Less/TYPO3/_element_rte.less
typo3/sysext/core/Documentation/Changelog/master/Breaking-68571-RemoveElementBrowser-getMsgBox.rst [new file with mode: 0644]
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
typo3/sysext/rtehtmlarea/Classes/SelectImage.php
typo3/sysext/t3skin/Resources/Public/Css/backend.css

index 9f90625..d671227 100644 (file)
@@ -112,17 +112,6 @@ table#typo3-linkTarget {
        margin-top: 5px;
 }
 
-table#typo3-msgBox {
-       margin-top: 10px;
-       margin-bottom: 10px;
-
-       tr {
-               td {
-                       padding: 10px 50px 10px 50px;
-               }
-       }
-}
-
 input.typo3-link-input {
        width: 250px;
 }
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-68571-RemoveElementBrowser-getMsgBox.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-68571-RemoveElementBrowser-getMsgBox.rst
new file mode 100644 (file)
index 0000000..c787dab
--- /dev/null
@@ -0,0 +1,27 @@
+===========================================================
+Breaking: #68571 - Removed method ElementBrowser->getMsgBox
+===========================================================
+
+Description
+===========
+
+The removed method ``getMsgBox`` in ``ElementBrowser`` used table based styling.
+The method is removed, since we have better means to display this kind of messages: FlashMessages or Callouts.
+
+
+Impact
+======
+
+A fatal error will be thrown if the method ``getMsgBox`` is used.
+
+
+Affected Installations
+======================
+
+Third party code using the removed method.
+
+
+Migration
+=========
+
+Remove the call to the method and replace the message with a FlashMessage.
index fc2573f..8e7b21c 100755 (executable)
@@ -2121,8 +2121,8 @@ class ElementBrowser {
                $lang = $this->getLanguageService();
                if (!$folder->getStorage()->isPublic()) {
                        // Print this warning if the folder is NOT a web folder
-                       return $this->barheader($lang->getLL('files'))
-                               . $this->getMsgBox($lang->getLL('noWebFolder'), 'status-dialog-warning');
+                       return GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('noWebFolder'), $lang->getLL('files'), FlashMessage::WARNING)
+                               ->render();
                }
                $out = '';
 
@@ -2138,9 +2138,11 @@ class ElementBrowser {
                // Init row-array:
                $lines = array();
                // Add "drag-n-drop" message:
+               $infoText = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('findDragDrop'), '', FlashMessage::INFO)
+                       ->render();
                $lines[] = '
                        <tr>
-                               <td colspan="2">' . $this->getMsgBox($lang->getLL('findDragDrop')) . '</td>
+                               <td colspan="2">' . $infoText . '</td>
                        </tr>';
                // Traverse files:
                foreach ($files as $fileObject) {
@@ -2229,24 +2231,6 @@ class ElementBrowser {
        }
 
        /**
-        * Displays a message box with the input message
-        *
-        * @param string $inputMessage Input message to show (will be htmlspecialchars()'ed inside of this function)
-        * @param string $icon Sprite sprite name. Default is 'actions-document-info'.
-        * @return string HTML for the message (wrapped in a table).
-        */
-       public function getMsgBox($inputMessage, $icon = 'actions-document-info') {
-               return '
-                       <!-- Message box -->
-                       <table cellspacing="0" class="bgColor4" id="typo3-msgBox">
-                               <tr>
-                                       <td>' . IconUtility::getSpriteIcon($icon) . htmlspecialchars($inputMessage) . '</td>
-                               </tr>
-                       </table>
-                       ';
-       }
-
-       /**
         * For RTE/link: This prints the 'currentUrl'
         *
         * @param string $str URL value. The value is htmlspecialchars()'ed before output.
index e408c83..4a1d07e 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Rtehtmlarea;
 
 use TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Resource\Service\MagicImageService;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -487,7 +488,8 @@ class SelectImage extends ElementBrowser {
                                // Add help message
                                $helpMessage = $this->getHelpMessage($this->act);
                                if ($helpMessage) {
-                                       $this->content .= $this->getMsgBox($helpMessage);
+                                       $this->content .= GeneralUtility::makeInstance(FlashMessage::class, $helpMessage, '', FlashMessage::INFO)
+                                               ->render();
                                }
                                // Adding create folder + upload form if applicable
                                if (!$backendUser->getTSConfigVal('options.uploadFieldsInTopOfEB')) {
index cf6580e..23cb590 100644 (file)
@@ -9859,13 +9859,6 @@ table#typo3-linkURL,
 table#typo3-linkTarget {
   margin-top: 5px;
 }
-table#typo3-msgBox {
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-table#typo3-msgBox tr td {
-  padding: 10px 50px 10px 50px;
-}
 input.typo3-link-input {
   width: 250px;
 }