From 9b7ac249df089877f1f286ed4a1b53a4e6e76455 Mon Sep 17 00:00:00 2001
From: Johannes Kreiner <johannes@sgalinski.de>
Date: Thu, 23 Feb 2023 12:01:48 +0100
Subject: [PATCH] [TASK] Improve BE UX

---
 Classes/Preview/PreviewService.php             | 1 +
 README.md                                      | 1 +
 Resources/Private/Language/de.locallang.xlf    | 4 ++--
 Resources/Private/Language/locallang.xlf       | 2 +-
 Resources/Private/Templates/Vimeo/Backend.html | 9 +++++++++
 5 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Classes/Preview/PreviewService.php b/Classes/Preview/PreviewService.php
index b91e11f..79dd150 100644
--- a/Classes/Preview/PreviewService.php
+++ b/Classes/Preview/PreviewService.php
@@ -53,6 +53,7 @@ class PreviewService {
 			'thumbnailType' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.thumbnailType'),
 			'thumbnailImagesCount' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.thumbnailImages'),
 			'showApiResult' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.showApiResult'),
+			'urlParameters' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.urlParameters'),
 		];
 
 		$view->assign('data', $templateData);
diff --git a/README.md b/README.md
index 4da583f..776a4d6 100644
--- a/README.md
+++ b/README.md
@@ -75,4 +75,5 @@ Requires `img-src https://i.vimeocdn.com;`, `script-src https://player.vimeo.com
 
 ### Known issues
 - Additional URL parameters won't get passed to the iframe inside the lightbox, this is seemingly caused by Plyr's integration of the Vimeo API
+    - See also https://github.com/sampotts/plyr/issues/218#issuecomment-849942139
     - Workaround: disable the lightbox for your Vimeo video
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
index 157d5be..203abf5 100644
--- a/Resources/Private/Language/de.locallang.xlf
+++ b/Resources/Private/Language/de.locallang.xlf
@@ -142,8 +142,8 @@
 				<target><![CDATA[Weniger]]></target>
 			</trans-unit>
 			<trans-unit id="flexform.urlParameters" approved="yes">
-				<source><![CDATA[Additional URL parameters]]></source>
-				<target><![CDATA[Zusätzliche URL-Parameter]]></target>
+				<source><![CDATA[Additional URL parameters (only without Lightbox)]]></source>
+				<target><![CDATA[Zusätzliche URL-Parameter (nur ohne Lightbox)]]></target>
 			</trans-unit>
 			<trans-unit id="flexform.urlParameters.description" approved="yes">
 				<source><![CDATA[See https://vimeo.zendesk.com/hc/en-us/articles/360001494447-Player-parameters-overview]]></source>
diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf
index 5e02055..1fa920c 100644
--- a/Resources/Private/Language/locallang.xlf
+++ b/Resources/Private/Language/locallang.xlf
@@ -105,7 +105,7 @@
 				<source><![CDATA[Vimeo]]></source>
 			</trans-unit>
 			<trans-unit id="flexform.urlParameters">
-				<source><![CDATA[Additional URL parameters]]></source>
+				<source><![CDATA[Additional URL parameters (only without Lightbox)]]></source>
 			</trans-unit>
 			<trans-unit id="flexform.urlParameters.description">
 				<source><![CDATA[See https://vimeo.zendesk.com/hc/en-us/articles/360001494447-Player-parameters-overview]]></source>
diff --git a/Resources/Private/Templates/Vimeo/Backend.html b/Resources/Private/Templates/Vimeo/Backend.html
index 390ba05..109f819 100644
--- a/Resources/Private/Templates/Vimeo/Backend.html
+++ b/Resources/Private/Templates/Vimeo/Backend.html
@@ -95,6 +95,15 @@
 				</td>
 			</tr>
 		</f:if>
+
+		<tr>
+			<th scope="row">
+				<f:translate key="flexform.urlParameters" extensionName="SgYoutube"/>
+			</th>
+			<td>
+				{data.urlParameters}
+			</td>
+		</tr>
 		</tbody>
 	</table>
 </be:link.editRecord>
-- 
GitLab