From ff8fbbb3233ff02520b626be560269ba18d18154 Mon Sep 17 00:00:00 2001
From: Armin Ruediger Vieweg <armin@v.ieweg.de>
Date: Fri, 30 Jan 2015 16:44:51 +0100
Subject: [PATCH] [FEATURE] Show allowed file extensions in FAL field

Above the list of file relations are buttons to add or upload new images.
Now, behind these buttons a label appears, which shows the allowed file
extensions to upload/use.

Resolves: #45428
Releases: master
Change-Id: I6e7caea22c6198819084db4c737088cc6f7eb02f
Reviewed-on: http://review.typo3.org/36443
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
---
 typo3/sysext/backend/Classes/Form/Element/InlineElement.php  | 2 ++
 typo3/sysext/lang/locallang_core.xlf                         | 3 +++
 .../Resources/Private/Styles/TYPO3/_element_tceforms.less    | 5 +++++
 typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css   | 4 ++++
 4 files changed, 14 insertions(+)

diff --git a/typo3/sysext/backend/Classes/Form/Element/InlineElement.php b/typo3/sysext/backend/Classes/Form/Element/InlineElement.php
index 71e25c5c5b2f..780699a5da0c 100644
--- a/typo3/sysext/backend/Classes/Form/Element/InlineElement.php
+++ b/typo3/sysext/backend/Classes/Form/Element/InlineElement.php
@@ -950,6 +950,8 @@ class InlineElement {
 			}
 		}
 
+		$allowedLabel = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.allowedFileExtensions', TRUE);
+		$item .= '<span class="btn-after">' . $allowedLabel . ' ' . $allowed . '</span>';
 		return $item;
 	}
 
diff --git a/typo3/sysext/lang/locallang_core.xlf b/typo3/sysext/lang/locallang_core.xlf
index 7cde5b466a20..5712ea7c3362 100644
--- a/typo3/sysext/lang/locallang_core.xlf
+++ b/typo3/sysext/lang/locallang_core.xlf
@@ -919,6 +919,9 @@ Would you like to save now in order to refresh the display?</source>
 			<trans-unit id="cm.more" xml:space="preserve">
 				<source>More options...</source>
 			</trans-unit>
+			<trans-unit id="cm.allowedFileExtensions" xml:space="preserve">
+				<source>Allowed file extensions:</source>
+			</trans-unit>
 			<trans-unit id="tree.defaultPageTitle" xml:space="preserve">
 				<source>[Default Title]</source>
 			</trans-unit>
diff --git a/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less b/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less
index b98a463cefad..0daf7603d80a 100644
--- a/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less
+++ b/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less
@@ -22,6 +22,11 @@
 			vertical-align: top;
 		}
 
+		.btn-after {
+			margin-left: 15px;
+			color: #666;
+		}
+
 		> table {
 			margin-bottom: 0;
 
diff --git a/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css b/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css
index f83ac13c5029..e09252d5f929 100644
--- a/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css
+++ b/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css
@@ -8968,6 +8968,10 @@ fieldset[disabled] .table .btn-checkbox-holder input[type=checkbox]:checked + .b
 .typo3-TCEforms .c-tablayer td {
   vertical-align: top;
 }
+.typo3-TCEforms .c-tablayer .btn-after {
+  margin-left: 15px;
+  color: #666;
+}
 .typo3-TCEforms .c-tablayer > table {
   margin-bottom: 0;
 }
-- 
GitLab