Skip to content
Snippets Groups Projects
Verified Commit 5dfc080a authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[TASK] Merge branch master

parents 1a48311f 0391c867
No related branches found
No related tags found
1 merge request!12Upgrade typo3v12 phase3
......@@ -30,8 +30,6 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
/**
* Class StructuredVideoDataViewHelper
*
* @package SGalinski\SgYoutube\ViewHelpers
*/
class StructuredVideoDataViewHelper extends AbstractTagBasedViewHelper {
/**
......@@ -47,8 +45,8 @@ class StructuredVideoDataViewHelper extends AbstractTagBasedViewHelper {
*/
public function initializeArguments(): void {
parent::initializeArguments();
$this->registerArgument('videoArray', 'array', 'An array of videos', TRUE);
$this->registerArgument('arrayType', 'string', 'Either "youtube" or "vimeo"', FALSE, "youtube");
$this->registerArgument('videoArray', 'array', 'An array of videos', TRUE, []);
$this->registerArgument('arrayType', 'string', 'Either "youtube" or "vimeo"', FALSE, 'youtube');
}
/**
......@@ -58,11 +56,11 @@ class StructuredVideoDataViewHelper extends AbstractTagBasedViewHelper {
*/
public function render(): string {
$this->escapeOutput = FALSE;
$videoArray = $this->arguments['videoArray'];
$arrayType = $this->arguments['arrayType'];
$videoArray = $this->arguments['videoArray'] ?? [];
$arrayType = $this->arguments['arrayType'] ?? 'youtube';
$structuredData = [];
if ($arrayType === "youtube") {
if ($arrayType === 'youtube') {
foreach ($videoArray as $video) {
$structuredData[] = [
'@type' => 'VideoObject',
......
<?php
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
/**
* Important! Do not return a variable named $icons, because it will result in an error.
......@@ -11,7 +11,7 @@ use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
$iconList = [];
foreach (['extension-sg_youtube' => 'sg-youtube.png'] as $identifier => $path) {
$iconList[$identifier] = [
'provider' => SvgIconProvider::class,
'provider' => BitmapIconProvider::class,
'source' => 'EXT:sg_youtube/Resources/Public/Icons/' . $path,
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment