Commit f6be476a authored by Tim Wagner's avatar Tim Wagner
Browse files

[TASK] Add option for showing/hiding video descriptions

parent 60fb6c64
......@@ -83,6 +83,7 @@ class YoutubeController extends ActionController {
'feed' => $jsonArray['items'],
'response' => $jsonArray,
'debugOutput' => $debugOutput,
'showDescription' => $this->settings['showDescription'] ?? 1,
]
);
......@@ -109,10 +110,7 @@ class YoutubeController extends ActionController {
return $jsonArray;
}
/**
* @var int $index
* @var FileReference $fileObject
*/
/** @var FileReference $fileObject */
foreach ($fileObjects as $index => $fileObject) {
if (!isset($jsonArray[$index])) {
break;
......
......@@ -44,6 +44,17 @@
</TCEforms>
</settings.maxResults>
<settings.showDescription>
<TCEforms>
<exclude>0</exclude>
<label>LLL:EXT:sg_youtube/Resources/Private/Language/locallang.xlf:flexform.showDescription</label>
<config>
<type>check</type>
<default>1</default>
</config>
</TCEforms>
</settings.showDescription>
<settings.disableLightbox>
<TCEforms>
<exclude>0</exclude>
......
......@@ -45,6 +45,10 @@
<source><![CDATA[Show API Result (Debug Output!)]]></source>
<target><![CDATA[Zeige API-Ergebnis an (Debug-Informationen!)]]></target>
</trans-unit>
<trans-unit id="flexform.showDescription" approved="yes">
<source><![CDATA[Show Video Descriptions]]></source>
<target><![CDATA[Videobeschreibungen anzeigen]]></target>
</trans-unit>
<trans-unit id="flexform.thumbnailImages" approved="yes">
<source><![CDATA[Custom Thumbnails for the Videos (The first image will be set on the first Youtube Video, then the second image one to the second video and so on...)]]></source>
<target><![CDATA[Benutzerdefinierte Thumbnails für die Videos (Das erste Bild wird auf das erste Youtube-Video gesetzt, dann das zweite Bild auf das zweite Video und so weiter...)]]></target>
......
......@@ -35,6 +35,9 @@
<trans-unit id="flexform.showApiResult">
<source><![CDATA[Show API Result (Debug Output!)]]></source>
</trans-unit>
<trans-unit id="flexform.showDescription">
<source><![CDATA[Show Video Descriptions]]></source>
</trans-unit>
<trans-unit id="flexform.thumbnailImages">
<source><![CDATA[Custom Thumbnails for the Videos (The first image will be set on the first Youtube Video, then the second image one to the second video and so on...)]]></source>
</trans-unit>
......
......@@ -25,6 +25,11 @@
</h3>
</div>
</f:if>
<f:if condition="{settings.showDescription} && {feed.0.description}">
<div class="sg-youtube-text">
<f:format.htmlentitiesDecode><f:format.crop maxCharacters="200">{feed.0.description}</f:format.crop></f:format.htmlentitiesDecode>
</div>
</f:if>
</a>
</li>
</ul>
......@@ -45,6 +50,11 @@
</h3>
</div>
</f:if>
<f:if condition="{settings.showDescription} && {feed.0.description}">
<div class="sg-youtube-text">
<f:format.htmlentitiesDecode><f:format.crop maxCharacters="200">{feed.0.description}</f:format.crop></f:format.htmlentitiesDecode>
</div>
</f:if>
</a>
</div>
</div>
......@@ -63,6 +73,11 @@
<h3 class="h3">
<f:format.htmlentitiesDecode>{feedItem.title}</f:format.htmlentitiesDecode>
</h3>
<f:if condition="{settings.showDescription} && {feedItem.description}">
<div class="sg-youtube-text">
<f:format.htmlentitiesDecode><f:format.crop maxCharacters="200">{feedItem.description}</f:format.crop></f:format.htmlentitiesDecode>
</div>
</f:if>
</div>
</f:if>
</a>
......@@ -91,7 +106,7 @@
</h3>
</div>
</f:if>
<f:if condition="{feedItem.description}">
<f:if condition="{settings.showDescription} && {feedItem.description}">
<div class="sg-youtube-text">
<f:format.htmlentitiesDecode><f:format.crop maxCharacters="200">{feedItem.description}</f:format.crop></f:format.htmlentitiesDecode>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment