Remove isArray-ViewHelper as there is one of the core already

This commit is contained in:
Alexander Bigga 2021-11-26 10:29:08 +01:00
parent 351470dba3
commit f794a30c06
2 changed files with 3 additions and 50 deletions

View File

@ -1,46 +0,0 @@
<?php
/**
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
namespace Kitodo\Dlf\ViewHelpers;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\RenderingContextInterface;
class IsArrayViewHelper extends AbstractViewHelper
{
/**
* Register arguments.
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('variable', 'mixed', 'The variable to check', false, null);
}
/**
* @return bool
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$result = false;
$variable = $arguments['variable'];
if (null === $variable) {
$variable = $renderChildrenClosure();
}
if (null !== $variable) {
$result = is_array($variable);
}
return $result;
}
}

View File

@ -10,11 +10,11 @@
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:kitodo="http://typo3.org/ns/Kitodo/Dlf/ViewHelpers"
xmlns:adm="http://typo3.org/ns/TYPO3/CMS/Adminpanel/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:for each="{iiifData}" as="data" key="key">
<f:if condition="{data.data} && {dlf:isArray(variable: '{data.data}')}">
<f:for each="{iiifData}" as="data" key="key">
<f:if condition="{data.data} && {adm:isArray(value: '{data.data}')}">
<f:then>
<f:for each="{data.data}" as="subData" iteration="subIterator">
<f:if condition="{subIterator.isFirst}">
@ -36,4 +36,3 @@
</f:else>
</f:if>
</f:for>