From 719dcd1a68c35a489f4a23dfc69950aa091a9168 Mon Sep 17 00:00:00 2001
From: Frans Saris <franssaris@gmail.com>
Date: Fri, 11 Dec 2015 11:37:50 +0100
Subject: [PATCH] [TASK] Restructured linkbrowser HTML

Restructured the HTML arround the form field in the element/link browser
to be more in line with the rest of the BE.

Resolves: #71840
Releases: master
Change-Id: Icbfc9b6c30e974f15e64d93cf327e05c2574525c
Reviewed-on: https://review.typo3.org/45210
Reviewed-by: Michiel Roos <michiel@maxserv.com>
Tested-by: Michiel Roos <michiel@maxserv.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
---
 .../Public/Less/TYPO3/_element_rte.less       |  10 --
 .../Less/TYPO3/_main_elementbrowser.less      |   5 +
 .../Public/Less/TYPO3/_main_linkbrowser.less  |  26 ++++
 Build/Resources/Public/Less/backend.less      |   1 +
 .../Classes/Controller/BackendController.php  |   4 +-
 .../backend/Resources/Public/Css/backend.css  |  29 +++-
 .../AbstractLinkBrowserController.php         | 147 +++++++++---------
 .../Classes/LinkHandler/FileLinkHandler.php   |  22 +--
 .../Classes/LinkHandler/MailLinkHandler.php   |  39 ++---
 .../Classes/LinkHandler/PageLinkHandler.php   |  20 ++-
 .../Classes/LinkHandler/UrlLinkHandler.php    |  36 +++--
 .../Classes/View/FolderUtilityRenderer.php    |  11 +-
 .../Controller/BrowseLinksController.php      |  91 ++++++-----
 .../Controller/SelectImageController.php      |  12 +-
 14 files changed, 256 insertions(+), 197 deletions(-)
 create mode 100644 Build/Resources/Public/Less/TYPO3/_main_linkbrowser.less

diff --git a/Build/Resources/Public/Less/TYPO3/_element_rte.less b/Build/Resources/Public/Less/TYPO3/_element_rte.less
index 09e939c08528..8e9f0a60c696 100644
--- a/Build/Resources/Public/Less/TYPO3/_element_rte.less
+++ b/Build/Resources/Public/Less/TYPO3/_element_rte.less
@@ -106,16 +106,6 @@ body#ext-rte-app-rte-select-image-php img {
 	vertical-align: middle;
 }
 
-table#typo3-linkMail,
-table#typo3-linkURL,
-table#typo3-linkTarget {
-	margin-top: 5px;
-}
-
-input.typo3-link-input {
-	width: 250px;
-}
-
 //
 // Element Browser / RTE link selection
 //
diff --git a/Build/Resources/Public/Less/TYPO3/_main_elementbrowser.less b/Build/Resources/Public/Less/TYPO3/_main_elementbrowser.less
index 363a10f4ef82..e375292d6c3c 100644
--- a/Build/Resources/Public/Less/TYPO3/_main_elementbrowser.less
+++ b/Build/Resources/Public/Less/TYPO3/_main_elementbrowser.less
@@ -7,5 +7,10 @@
 		border-bottom: 1px solid @gray-light;
 		padding-bottom: 30px;
 		margin: 0 15px 30px 15px;
+
+		&:last-child {
+			padding-bottom: 0;
+			border: none;
+		}
 	}
 }
diff --git a/Build/Resources/Public/Less/TYPO3/_main_linkbrowser.less b/Build/Resources/Public/Less/TYPO3/_main_linkbrowser.less
new file mode 100644
index 000000000000..1043d13516e0
--- /dev/null
+++ b/Build/Resources/Public/Less/TYPO3/_main_linkbrowser.less
@@ -0,0 +1,26 @@
+//
+// Link Browser
+//
+
+.link-browser {
+	&-section {
+		border-bottom: 1px solid @gray-light;
+		margin: 0 15px 15px 15px;
+
+		&.link-browser-current-link, &.link-browser-tabs {
+			padding-bottom: 0;
+			border-bottom: none;
+		}
+
+		&.link-browser-pagetree, &.link-browser-filetree {
+			h3 {
+				margin-top: 0;
+			}
+		}
+
+		&:last-child {
+			padding-bottom: 0;
+			border: none;
+		}
+	}
+}
diff --git a/Build/Resources/Public/Less/backend.less b/Build/Resources/Public/Less/backend.less
index bb6533b1e0a5..c81b4808c7af 100644
--- a/Build/Resources/Public/Less/backend.less
+++ b/Build/Resources/Public/Less/backend.less
@@ -67,6 +67,7 @@
 @import "TYPO3/_main_elementbrowser.less";
 @import "TYPO3/_main_backend_layout_wizard";
 @import "TYPO3/_main_form.less";
+@import "TYPO3/_main_linkbrowser.less";
 @import "TYPO3/_main_scaffolding.less";
 @import "TYPO3/_module_menu.less";
 @import "TYPO3/_module_database.less";
diff --git a/typo3/sysext/backend/Classes/Controller/BackendController.php b/typo3/sysext/backend/Classes/Controller/BackendController.php
index ecabf5ed8e2d..89d546ee416d 100644
--- a/typo3/sysext/backend/Classes/Controller/BackendController.php
+++ b/typo3/sysext/backend/Classes/Controller/BackendController.php
@@ -590,8 +590,8 @@ class BackendController
         if (!empty($rtePopupWindowSize)) {
             list($rtePopupWindowWidth, $rtePopupWindowHeight) = GeneralUtility::trimExplode('x', $rtePopupWindowSize);
         }
-        $rtePopupWindowWidth  = !empty($rtePopupWindowWidth) ? (int)$rtePopupWindowWidth : ($popupWindowWidth-200);
-        $rtePopupWindowHeight = !empty($rtePopupWindowHeight) ? (int)$rtePopupWindowHeight : ($popupWindowHeight-250);
+        $rtePopupWindowWidth  = !empty($rtePopupWindowWidth) ? (int)$rtePopupWindowWidth : ($popupWindowWidth-100);
+        $rtePopupWindowHeight = !empty($rtePopupWindowHeight) ? (int)$rtePopupWindowHeight : ($popupWindowHeight-150);
 
         // If another page module was specified, replace the default Page module with the new one
         $newPageModule = trim($beUser->getTSConfigVal('options.overridePageModule'));
diff --git a/typo3/sysext/backend/Resources/Public/Css/backend.css b/typo3/sysext/backend/Resources/Public/Css/backend.css
index a64b5bf2ddf7..e8b5eafece25 100644
--- a/typo3/sysext/backend/Resources/Public/Css/backend.css
+++ b/typo3/sysext/backend/Resources/Public/Css/backend.css
@@ -9789,14 +9789,6 @@ body#typo3-browse-links-php img,
 body#ext-rte-app-rte-select-image-php img {
   vertical-align: middle;
 }
-table#typo3-linkMail,
-table#typo3-linkURL,
-table#typo3-linkTarget {
-  margin-top: 5px;
-}
-input.typo3-link-input {
-  width: 250px;
-}
 table#typo3-linkPages tr td.c-wCell,
 table#typo3-linkFiles tr td.c-wCell,
 table#typo3-EBrecords tr td.c-wCell,
@@ -11687,6 +11679,10 @@ span.warningboxheader {
   padding-bottom: 30px;
   margin: 0 15px 30px 15px;
 }
+.element-browser-section:last-child {
+  padding-bottom: 0;
+  border: none;
+}
 .grideditor td {
   vertical-align: middle;
 }
@@ -12196,6 +12192,23 @@ select.icon-select option {
 textarea.formengine-textarea {
   resize: none;
 }
+.link-browser-section {
+  border-bottom: 1px solid #d7d7d7;
+  margin: 0 15px 15px 15px;
+}
+.link-browser-section.link-browser-current-link,
+.link-browser-section.link-browser-tabs {
+  padding-bottom: 0;
+  border-bottom: none;
+}
+.link-browser-section.link-browser-pagetree h3,
+.link-browser-section.link-browser-filetree h3 {
+  margin-top: 0;
+}
+.link-browser-section:last-child {
+  padding-bottom: 0;
+  border: none;
+}
 body#typo3-backend-php {
   margin: 0;
   padding: 0;
diff --git a/typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php b/typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php
index 5eb279f67551..b40060755f97 100644
--- a/typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php
+++ b/typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php
@@ -138,8 +138,7 @@ abstract class AbstractLinkBrowserController
      */
     protected function initHookObjects()
     {
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks'])
+        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks'])
             && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks'])
         ) {
             $hooks = GeneralUtility::makeInstance(DependencyOrderingService::class)->orderByDependencies(
@@ -177,10 +176,11 @@ abstract class AbstractLinkBrowserController
         if (!empty($this->currentLinkParts)) {
             $content .= $this->renderCurrentUrl();
         }
-        $content .= $this->doc->getTabMenuRaw($menuData);
+
+        $content .= '<div class="link-browser-section link-browser-tabs">' . $this->doc->getTabMenuRaw($menuData) . '</div>';
         $content .= $renderLinkAttributeFields;
 
-        $content .= '<div class="linkBrowser-tabContent">' . $browserContent . '</div>';
+        $content .= $browserContent;
         $content .= $this->doc->endPage();
 
         $response->getBody()->write($this->doc->insertStylesAndJS($content));
@@ -319,6 +319,7 @@ abstract class AbstractLinkBrowserController
     {
         $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
         $this->doc->bodyTagId = 'typo3-browse-links-php';
+        $this->doc->divClass = 'link-browser';
 
         foreach ($this->getBodyTagAttributes() as $attributeName => $value) {
             $this->doc->bodyTagAdditions .= ' ' . $attributeName . '="' . htmlspecialchars($value) . '"';
@@ -337,11 +338,13 @@ abstract class AbstractLinkBrowserController
     protected function renderCurrentUrl()
     {
         return '<!-- Print current URL -->
-				<table border="0" cellpadding="0" cellspacing="0" id="typo3-curUrl">
-					<tr>
-						<td>' . $this->getLanguageService()->getLL('currentLink', true) . ': ' . htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) . '</td>
-					</tr>
-				</table>';
+            <div class="link-browser-section link-browser-current-link">
+                <strong>' .
+                    $this->getLanguageService()->getLL('currentLink', true) .
+                    ': ' .
+                    htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) .
+                '</strong>
+            </div>';
     }
 
     /**
@@ -470,16 +473,14 @@ abstract class AbstractLinkBrowserController
         // add update button if appropriate
         if (!empty($this->currentLinkParts) && $this->displayedLinkHandler === $this->currentLinkHandler && $this->currentLinkHandler->isUpdateSupported()) {
             $content .= '
-				<form action="" name="lparamsform" id="lparamsform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkParams">
-					<tr><td>
-						<input class="btn btn-default t3js-linkCurrent" type="submit" value="' . $this->getLanguageService()->getLL('update', true) . '" />
-					</td></tr>
-					</table>
-				</form><br /><br />';
+                <form action="" name="lparamsform" id="lparamsform" class="form-horizontal">
+                    <div class="form-group form-group-sm">
+                        <input class="btn btn-default t3js-linkCurrent" type="submit" value="' . $this->getLanguageService()->getLL('update', true) . '" />
+                    </div>
+                </form>';
         }
 
-        return $content;
+        return '<div class="link-browser-section link-browser-attributes">' . $content . '</div>';
     }
 
     /**
@@ -493,66 +494,70 @@ abstract class AbstractLinkBrowserController
 
         $fieldRenderingDefinitions = [];
         $fieldRenderingDefinitions['target'] = '
-			<!--
-				Selecting target for link:
-			-->
-				<form action="" name="ltargetform" id="ltargetform" class="t3js-dummyform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
-						<tr>
-							<td style="width: 96px;">' . $lang->getLL('target', true) . ':</td>
-							<td>
-								<input type="text" name="ltarget" class="t3js-linkTarget" value="' . htmlspecialchars($this->linkAttributeValues['target']) . '" />
-								<select name="ltarget_type" class="t3js-targetPreselect">
-									<option value=""></option>
-									<option value="_top">' . $lang->getLL('top', true) . '</option>
-									<option value="_blank">' . $lang->getLL('newWindow', true) . '</option>
-								</select>
-							</td>
-						</tr>
-					</table>
-				</form>';
+            <!--
+                Selecting target for link:
+            -->
+                <form action="" name="ltargetform" id="ltargetform" class="t3js-dummyform form-horizontal">
+                    <div class="form-group form-group-sm" id="typo3-linkTarget">
+                        <label class="col-xs-4 control-label">' . $lang->getLL('target', true) . '</label>
+                        <div class="col-xs-3">
+                            <input type="text" name="ltarget" class="t3js-linkTarget form-control"
+                                value="' . htmlspecialchars($this->linkAttributeValues['target']) . '" />
+                        </div>
+                        <div class="col-xs-5">
+                                <select name="ltarget_type" class="t3js-targetPreselect form-control">
+                                    <option value=""></option>
+                                    <option value="_top">' . $lang->getLL('top', true) . '</option>
+                                    <option value="_blank">' . $lang->getLL('newWindow', true) . '</option>
+                                </select>
+                        </div>
+                    </div>
+                </form>';
 
         $fieldRenderingDefinitions['title'] = '
-				<!--
-					Selecting title for link:
-				-->
-				<form action="" name="ltitleform" id="ltitleform" class="t3js-dummyform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
-						<tr>
-							<td style="width: 96px;">' . $lang->getLL('title', true) . '</td>
-							<td><input type="text" name="ltitle" class="typo3-link-input" value="' . htmlspecialchars($this->linkAttributeValues['title']) . '" /></td>
-						</tr>
-					</table>
-				</form>
-			';
+                <!--
+                    Selecting title for link:
+                -->
+                <form action="" name="ltitleform" id="ltitleform" class="t3js-dummyform form-horizontal">
+                    <div class="form-group form-group-sm" id="typo3-linkTitle">
+                        <label class="col-xs-4 control-label">' . $lang->getLL('title', true) . '</label>
+                        <div class="col-xs-8">
+                            <input type="text" name="ltitle" class="form-control"
+                                value="' . htmlspecialchars($this->linkAttributeValues['title']) . '" />
+                        </div>
+                    </div>
+                </form>
+            ';
 
         $fieldRenderingDefinitions['class'] = '
-				<!--
-					Selecting class for link:
-				-->
-				<form action="" name="lclassform" id="lclassform" class="t3js-dummyform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
-						<tr>
-							<td style="width: 96px;">' . $lang->getLL('class', true) . '</td>
-							<td><input type="text" name="lclass" class="typo3-link-input" value="' . htmlspecialchars($this->linkAttributeValues['class']) . '" /></td>
-						</tr>
-					</table>
-				</form>
-			';
+                <!--
+                    Selecting class for link:
+                -->
+                <form action="" name="lclassform" id="lclassform" class="t3js-dummyform form-horizontal">
+                    <div class="form-group form-group-sm" id="typo3-linkClass">
+                        <label class="col-xs-4 control-label">' . $lang->getLL('class', true) . '</label>
+                        <div class="col-xs-8">
+                            <input type="text" name="lclass" class="form-control"
+                                value="' . htmlspecialchars($this->linkAttributeValues['class']) . '" /></td>
+                        </div>
+                    </div>
+                </form>
+            ';
 
         $fieldRenderingDefinitions['params'] = '
-				<!--
-					Selecting params for link:
-				-->
-				<form action="" name="lparamsform" id="lparamsform" class="t3js-dummyform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkParams">
-						<tr>
-							<td style="width: 96px;">' . $lang->getLL('params', true) . '</td>
-							<td><input type="text" name="lparams" class="typo3-link-input" value="' . htmlspecialchars($this->linkAttributeValues['params']) . '" /></td>
-						</tr>
-					</table>
-				</form>
-			';
+                <!--
+                    Selecting params for link:
+                -->
+                <form action="" name="lparamsform" id="lparamsform" class="t3js-dummyform form-horizontal">
+                    <div class="form-group form-group-sm" id="typo3-linkParams">
+                        <label class="col-xs-4 control-label">' . $lang->getLL('params', true) . '</label>
+                        <div class="col-xs-8">
+                            <input type="text" name="lparams" class="form-control"
+                                value="' . htmlspecialchars($this->linkAttributeValues['params']) . '" />
+                        </div>
+                    </div>
+                </form>
+            ';
 
         return $fieldRenderingDefinitions;
     }
diff --git a/typo3/sysext/recordlist/Classes/LinkHandler/FileLinkHandler.php b/typo3/sysext/recordlist/Classes/LinkHandler/FileLinkHandler.php
index 04668f609f2c..beddb2d7b365 100644
--- a/typo3/sysext/recordlist/Classes/LinkHandler/FileLinkHandler.php
+++ b/typo3/sysext/recordlist/Classes/LinkHandler/FileLinkHandler.php
@@ -181,21 +181,21 @@ class FileLinkHandler extends AbstractLinkHandler implements LinkHandlerInterfac
         }
         // Create folder tree:
         $content .= '
-				<!--
-					Wrapper table for folder tree / file/folder list:
-				-->
-						<table border="0" cellpadding="0" cellspacing="0" id="typo3-linkFiles">
-							<tr>
-								<td class="c-wCell" valign="top"><h3>' . $this->getLanguageService()->getLL('folderTree') . ':</h3>' . $tree . '</td>
-								<td class="c-wCell" valign="top">' . $files . '</td>
-							</tr>
-						</table>
-						';
+            <div class="row link-browser-section link-browser-filetree">
+                <div class="col-xs-6">
+                    <h3>' . $this->getLanguageService()->getLL('folderTree') . ':</h3>' .
+                    $tree . '
+                </div>
+                <div class="col-xs-6">
+                    ' . $files . '
+                </div>
+            </div>';
+
         // Adding create folder + upload form if applicable
         if (!$backendUser->getTSConfigVal('options.uploadFieldsInTopOfEB')) {
             $content .= $uploadForm;
         }
-        $content .=  '<br />' . $createFolder . '<br />';
+        $content .= $createFolder;
         return $content;
     }
 
diff --git a/typo3/sysext/recordlist/Classes/LinkHandler/MailLinkHandler.php b/typo3/sysext/recordlist/Classes/LinkHandler/MailLinkHandler.php
index 7a59abd3facd..e1c54428b047 100644
--- a/typo3/sysext/recordlist/Classes/LinkHandler/MailLinkHandler.php
+++ b/typo3/sysext/recordlist/Classes/LinkHandler/MailLinkHandler.php
@@ -92,24 +92,27 @@ class MailLinkHandler extends AbstractLinkHandler implements LinkHandlerInterfac
         GeneralUtility::makeInstance(PageRenderer::class)->loadRequireJsModule('TYPO3/CMS/Recordlist/MailLinkHandler');
 
         $lang = $this->getLanguageService();
-        $extUrl = '
-			<!--
-				Enter mail address:
-			-->
-			<form action="" id="lmailform">
-				<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkMail">
-					<tr>
-						<td style="width: 96px;">' . $lang->getLL('emailAddress', true) . ':</td>
-						<td>
-							<input type="text" name="lemail" size="20" value="'
-                                . htmlspecialchars(!empty($this->linkParts) ? $this->linkParts['url'] : '')
-                                . '" />
-							<input class="btn btn-default" type="submit" value="' . $lang->getLL('setLink', true) . '" />
-						</td>
-					</tr>
-				</table>
-			</form>';
-        return $extUrl;
+        $mailAddress = '
+            <!--
+                Enter mail address:
+            -->
+            <div class="link-browser-section link-browser-tab-content-mail">
+                <form action="" id="lmailform" class="form-horizontal">
+                        <div class="form-group form-group-sm">
+                            <label class="col-xs-4 control-label">' . $lang->getLL('emailAddress', true) . ':</label>
+                            <div class="col-xs-6">
+                                <input type="text" name="lemail" size="20" class="form-control" value="'
+                                    . htmlspecialchars(!empty($this->linkParts) ? $this->linkParts['url'] : '')
+                                    . '" />
+                            </div>
+                            <div class="col-xs-2">
+                                <input class="btn btn-default" type="submit" value="' . $lang->getLL('setLink', true) . '" />
+                            </div>
+                        </div>
+                </form>
+            </div>';
+
+        return $mailAddress;
     }
 
     /**
diff --git a/typo3/sysext/recordlist/Classes/LinkHandler/PageLinkHandler.php b/typo3/sysext/recordlist/Classes/LinkHandler/PageLinkHandler.php
index 028101d5d629..bb5cf7b09026 100644
--- a/typo3/sysext/recordlist/Classes/LinkHandler/PageLinkHandler.php
+++ b/typo3/sysext/recordlist/Classes/LinkHandler/PageLinkHandler.php
@@ -127,17 +127,15 @@ class PageLinkHandler extends AbstractLinkHandler implements LinkHandlerInterfac
         $tree = $pageTree->getBrowsableTree();
 
         return '
-
-				<!--
-					Wrapper table for page tree / record list:
-				-->
-				<table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
-					<tr>
-						<td class="c-wCell" valign="top"><h3>' . $this->getLanguageService()->getLL('pageTree') . ':</h3>'
-                            . $this->getTemporaryTreeMountCancelNotice() . $tree . '</td>
-						<td class="c-wCell" valign="top">' . $this->expandPage($this->expandPage) . '</td>
-					</tr>
-				</table>';
+            <div class="link-browser-section link-browser-pagetree">
+                <div class="col-xs-6">
+                    <h3>' . $this->getLanguageService()->getLL('pageTree') . ':</h3>'
+                            . $this->getTemporaryTreeMountCancelNotice() . $tree . '
+                </div>
+                <div class="col-xs-6">' .
+                    $this->expandPage($this->expandPage) . '
+                </div>
+            </div>';
     }
 
     /**
diff --git a/typo3/sysext/recordlist/Classes/LinkHandler/UrlLinkHandler.php b/typo3/sysext/recordlist/Classes/LinkHandler/UrlLinkHandler.php
index 225fd2b76deb..502d9d87d06d 100644
--- a/typo3/sysext/recordlist/Classes/LinkHandler/UrlLinkHandler.php
+++ b/typo3/sysext/recordlist/Classes/LinkHandler/UrlLinkHandler.php
@@ -91,22 +91,26 @@ class UrlLinkHandler extends AbstractLinkHandler implements LinkHandlerInterface
         GeneralUtility::makeInstance(PageRenderer::class)->loadRequireJsModule('TYPO3/CMS/Recordlist/UrlLinkHandler');
 
         $extUrl = '
-				<!--
-					Enter External URL:
-				-->
-					<form action="" id="lurlform">
-						<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkURL">
-							<tr>
-								<td style="width: 96px;">URL:</td>
-								<td>
-									<input type="text" name="lurl" size="30" value="'
-                                        . htmlspecialchars(!empty($this->linkParts) ? $this->linkParts['url'] : 'http://')
-                                        . '" /> '
-                                    . '<input class="btn btn-default" type="submit" value="' . $this->getLanguageService()->getLL('setLink', true) . '" />
-								</td>
-							</tr>
-						</table>
-					</form>';
+                <!--
+                    Enter External URL:
+                -->
+                <div class="link-browser-section link-browser-tab-content-url">
+                    <form action="" id="lurlform" class="form-horizontal">
+                        <div class="form-group form-group-sm" id="typo3-linkURL">
+                            <label class="col-xs-4 control-label">URL</label>
+                            <div class="col-xs-6">
+                                <input type="text" name="lurl" size="30" class="form-control" value="'
+                                    . htmlspecialchars(!empty($this->linkParts) ? $this->linkParts['url'] : 'http://')
+                                    . '" />
+                            </div>
+                            <div class="col-xs-2">
+                                <input class="btn btn-default" type="submit"
+                                    value="' . $this->getLanguageService()->getLL('setLink', true) . '" />
+                            </div>
+                        </div>
+                    </form>
+                </div>';
+
         return $extUrl;
     }
 
diff --git a/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php b/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php
index 47417ee6b6aa..0c76657b55eb 100644
--- a/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php
+++ b/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php
@@ -73,6 +73,7 @@ class FolderUtilityRenderer
             . htmlspecialchars($folderObject->getIdentifier()) . '</p>';
 
         $a = 1;
+        $markup[] = '<div class="row form-group"><div class="col-xs-8">';
         $markup[] = '<input class="form-control" type="text" name="file[newfolder][' . $a . '][data]" />';
         $markup[] = '<input type="hidden" name="file[newfolder][' . $a . '][target]" value="'
             . htmlspecialchars($folderObject->getCombinedIdentifier()) . '" />';
@@ -85,10 +86,11 @@ class FolderUtilityRenderer
             )
         );
         $markup[] = '<input type="hidden" name="redirect" value="' . htmlspecialchars($redirectValue) . '" />';
+        $markup[] = '</div><div class="col-xs-4">';
         $markup[] = '<input class="btn btn-default" type="submit" name="submit" value="'
             . $lang->sL('LLL:EXT:lang/locallang_core.xlf:create_folder.submit', true) . '" />';
 
-        $markup[] = '   </form>';
+        $markup[] = '</div></div></form>';
         $markup[] = '</div>';
 
         return implode(LF, $markup);
@@ -198,16 +200,18 @@ class FolderUtilityRenderer
                 . '" method="post" name="editform1" id="typo3-addMediaForm" enctype="multipart/form-data">';
             $markup[] = '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media', true) . ':</h3>';
             $markup[] = '<p><strong>' . $lang->getLL('path', true) . ':</strong>' . htmlspecialchars($header) . '</p>';
-            $markup[] = '<div class="form-group">';
+            $markup[] = '<div class="row form-group"><div class="col-xs-8">';
             $markup[] = '<input type="hidden" name="file[newMedia][0][target]" value="'
                 . htmlspecialchars($folderObject->getCombinedIdentifier()) . '" />';
             $markup[] = '<input type="hidden" name="file[newMedia][0][allowed]" value="'
                 . htmlspecialchars(implode(',', $allowedExtensions)) . '" />';
             $markup[] = '<input type="text" name="file[newMedia][0][url]" class="form-control" placeholder="'
                 . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.placeholder', true) . '" />';
+            $markup[] = '</div><div class="col-xs-4">';
             $markup[] = '<button class="btn btn-default">'
                 . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.submit', true) . '</button>';
-            $markup[] = '</div>';
+
+            $markup[] = '</div></div>';
             $markup[] = '<div class="form-group">';
             $markup[] = '    <label>';
             $markup[] = $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.allowedProviders') . '<br/>';
@@ -217,7 +221,6 @@ class FolderUtilityRenderer
             $markup[] = '    </div>';
             $markup[] = '</div>';
             $markup[] = '<input type="hidden" name="redirect" value="' . htmlspecialchars($redirectValue) . '" />';
-            $markup[] = '</div>';
             $markup[] = '</form>';
             $markup[] = '</div>';
 
diff --git a/typo3/sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php b/typo3/sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php
index addd26d570d4..2c1228ce55d5 100644
--- a/typo3/sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php
+++ b/typo3/sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php
@@ -361,13 +361,16 @@ class BrowseLinksController extends AbstractLinkBrowserController
      */
     protected function renderCurrentUrl()
     {
-        $removeLink = '<a href="#" class="btn btn-default t3js-removeCurrentLink">' . $this->getLanguageService()->getLL('removeLink', true) . '</a>';
+        $removeLink = ' <a href="#" class="btn btn-default t3js-removeCurrentLink">' . $this->getLanguageService()->getLL('removeLink', true) . '</a>';
         return '
-            <table border="0" cellpadding="0" cellspacing="0" id="typo3-curUrl">
-                <tr>
-                    <td>' . $this->getLanguageService()->getLL('currentLink', true) . ': ' . htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) . $removeLink . '</td>
-                </tr>
-            </table>';
+            <div class="link-browser-section link-browser-current-link">
+                <strong>' .
+                    $this->getLanguageService()->getLL('currentLink', true) .
+                    ': ' .
+                    htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) .
+                '</strong>' .
+                '<span class="pull-right">' . $removeLink . '</span>' .
+            '</div>';
     }
 
     /**
@@ -442,15 +445,17 @@ class BrowseLinksController extends AbstractLinkBrowserController
             : '';
         // @todo define label "linkRelationship" below in xlf
         return '
-				<form action="" name="lrelform" id="lrelform" class="t3js-dummyform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkRel">
-						<tr>
-							<td><label>' . $this->getLanguageService()->getLL('linkRelationship', true) . ':</label></td>
-							<td colspan="3"><input type="text" name="lrel" value="' . $currentRel . '" /></td>
-						</tr>
-					</table>
-				</form>
-			';
+            <form action="" name="lrelform" id="lrelform" class="t3js-dummyform form-horizontal">
+                 <div class="form-group form-group-sm">
+                    <label class="col-xs-4 control-label">' .
+                        $this->getLanguageService()->getLL('linkRelationship', true) .
+                    '</label>
+                    <div class="col-xs-8">
+                        <input type="text" name="lrel" class="form-control" value="' . $currentRel . '" />
+                    </div>
+                </div>
+            </form>
+            ';
     }
 
     /**
@@ -470,7 +475,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
 
         if (!$targetSelectorConfig['disabled']) {
             $targetSelector = '
-						<select name="ltarget_type" class="t3js-targetPreselect">
+						<select name="ltarget_type" class="t3js-targetPreselect form-control">
 							<option value=""></option>
 							<option value="_top">' . $lang->getLL('top', true) . '</option>
 							<option value="_blank">' . $lang->getLL('newWindow', true) . '</option>
@@ -479,16 +484,17 @@ class BrowseLinksController extends AbstractLinkBrowserController
         }
 
         return '
-				<form action="" name="ltargetform" id="ltargetform" class="t3js-dummyform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
-						<tr' . ($targetSelectorConfig['disabled'] ? ' style="display: none;"' : '') . '>
-							<td style="width: 96px;">' . $lang->getLL('target', true) . ':</td>
-							<td>
-								<input type="text" name="ltarget" class="t3js-linkTarget" value="' . htmlspecialchars($target) . '" />
-								' . $targetSelector . '
-							</td>
-						</tr>
-					</table>
+				<form action="" name="ltargetform" id="ltargetform" class="t3js-dummyform form-horizontal">
+                    <div class="form-group form-group-sm" ' . ($targetSelectorConfig['disabled'] ? ' style="display: none;"' : '') . '>
+                        <label class="col-xs-4 control-label">' . $lang->getLL('target', true) . '</label>
+						<div class="col-xs-3">
+							<input type="text" name="ltarget" class="t3js-linkTarget form-control"
+							    value="' . htmlspecialchars($target) . '" />
+						</div>
+						<div class="col-xs-3">
+							' . $targetSelector . '
+						</div>
+					</div>
 				</form>
 				';
     }
@@ -523,20 +529,23 @@ class BrowseLinksController extends AbstractLinkBrowserController
                 : $this->classesAnchorDefaultTitle[$this->displayedLinkHandlerId];
         }
         return '
-				<form action="" name="ltitleform" id="ltitleform" class="t3js-dummyform">
-					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
-						<tr>
-							<td style="width: 96px;"><label for="rtehtmlarea-browse-links-anchor_title" id="rtehtmlarea-browse-links-title-label">' . $this->getLanguageService()->getLL('anchor_title', true) . '</label></td>
-							<td>
-								<span id="rtehtmlarea-browse-links-title-input" style="display: ' . ($readOnly ? 'none' : 'inline') . ';">
-									<input type="text" id="rtehtmlarea-browse-links-anchor_title" name="ltitle" value="' . htmlspecialchars($title) . '" />
-								</span>
-								<span id="rtehtmlarea-browse-links-title-readonly" style="display: ' . ($readOnly ? 'inline' : 'none') . ';">' . htmlspecialchars($title) . '</span>
-							</td>
-						</tr>
-					</table>
-				</form>
-				';
+                <form action="" name="ltitleform" id="ltitleform" class="t3js-dummyform form-horizontal">
+                    <div class="form-group form-group-sm">
+                        <label class="col-xs-4 control-label">
+                            ' . $this->getLanguageService()->getLL('anchor_title', true) . '
+                         </label>
+                         <div class="col-xs-8">
+                                <span style="display: ' . ($readOnly ? 'none' : 'inline') . ';">
+                                    <input type="text" name="ltitle" class="form-control"
+                                        value="' . htmlspecialchars($title) . '" />
+                                </span>
+                                <span id="rtehtmlarea-browse-links-title-readonly"
+                                    style="display: ' . ($readOnly ? 'inline' : 'none') . ';">
+                                    ' . htmlspecialchars($title) . '</span>
+                        </div>
+                    </div>
+                </form>
+                ';
     }
 
     /**
@@ -553,7 +562,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
 					<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
 						<tr>
 							<td style="width: 96px;">' . $this->getLanguageService()->getLL('anchor_class', true) . '</td>
-							<td><select name="lclass" class="t3js-class-selector">
+							<td><select name="lclass" class="t3js-class-selector form-control">
 								' . $this->classesAnchorJSOptions[$this->displayedLinkHandlerId] . '
 							</select></td>
 						</tr>
diff --git a/typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php b/typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php
index fb6e15ab4bea..e1c8ad3aa631 100644
--- a/typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php
+++ b/typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php
@@ -217,11 +217,13 @@ class SelectImageController extends AbstractLinkBrowserController
     protected function renderCurrentUrl()
     {
         return '<!-- Print current URL -->
-				<table border="0" cellpadding="0" cellspacing="0" id="typo3-curUrl">
-					<tr>
-						<td>' . htmlspecialchars($this->getLanguageService()->getLL('currentImage')) . ': ' . htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) . '</td>
-					</tr>
-				</table>';
+            <div class="link-browser-section link-browser-current-link">
+                <strong>' .
+                    htmlspecialchars($this->getLanguageService()->getLL('currentImage')) .
+                    ': ' .
+                    htmlspecialchars($this->currentLinkHandler->formatCurrentUrl()) .
+                '</strong>' .
+            '</div>';
     }
 
     /**
-- 
GitLab