protected function checkIfMultiInSetOrEmpty(
        $fieldName,
        $canUseFlexforms,
        $sheet,
        $explanation,
        array $allowedValues
    ) {
        if ($this->objectToCheck->hasConfValueString($fieldName, $sheet)) {
            $allValues = GeneralUtility::trimExplode(
                ',',
                $this->objectToCheck->getConfValueString($fieldName, $sheet),
                true
            );

            $overviewOfValues = '(' . implode(', ', $allowedValues) . ')';
            foreach ($allValues as $currentValue) {
                if (!in_array($currentValue, $allowedValues, true)) {
                    $message = 'The TS setup variable <strong>'
                        . $this->getTSSetupPath() . $fieldName
                        . '</strong> contains the value <strong>'
                        . htmlspecialchars($currentValue) . '</strong>, '
                        . 'but only the following values are allowed: '
                        . '<br /><strong>' . $overviewOfValues . '</strong><br />'
                        . $explanation;
                    $this->setErrorMessageAndRequestCorrection(
                        $fieldName,
                        $canUseFlexforms,
                        $message
                    );
                }
            }
        }
    }
protected function checkIfMultiInSetOrEmpty(
        $fieldName,
        $canUseFlexforms,
        $sheet,
        $explanation,
        array $allowedValues
    ) {
        if ($this->objectToCheck->hasConfValueString($fieldName, $sheet)) {
            $allValues = GeneralUtility::trimExplode(
                ',',
                $this->objectToCheck->getConfValueString($fieldName, $sheet),
                true
            );

            $overviewOfValues = '(' . implode(', ', $allowedValues) . ')';
            foreach ($allValues as $currentValue) {
                if (!in_array($currentValue, $allowedValues, true)) {
                    $message = 'The TS setup variable <strong>'
                        . $this->getTSSetupPath() . $fieldName
                        . '</strong> contains the value <strong>'
                        . htmlspecialchars($currentValue) . '</strong>, '
                        . 'but only the following values are allowed: '
                        . '<br /><strong>' . $overviewOfValues . '</strong><br />'
                        . $explanation;
                    $this->setErrorMessageAndRequestCorrection(
                        $fieldName,
                        $canUseFlexforms,
                        $message
                    );
                }
            }
        }
    }
protected function checkIfMultiInSetOrEmpty ( $ fieldName , $ canUseFlexforms , $ sheet , $ explanation , array $ allowedValues ) { if ( $ this -> objectToCheck -> hasConfValueString ( $ fieldName , $ sheet ) ) { $ allValues = GeneralUtility :: trimExplode ( ',' , $ this -> objectToCheck -> getConfValueString ( $ fieldName , $ sheet ) , true ) ; $ overviewOfValues = '(' . implode ( ', ' , $ allowedValues ) . ')' ; foreach ( $ allValues as $ currentValue ) { if ( ! in_array ( $ currentValue , $ allowedValues , true ) ) { $ message = 'The TS setup variable <strong>' . $ this -> getTSSetupPath ( ) . $ fieldName . '</strong> contains the value <strong>' . htmlspecialchars ( $ currentValue ) . '</strong>, ' . 'but only the following values are allowed: ' . '<br /><strong>' . $ overviewOfValues . '</strong><br />' . $ explanation ; $ this -> setErrorMessageAndRequestCorrection ( $ fieldName , $ canUseFlexforms , $ message ) ; } } } }
Checks whether a configuration value either is empty or its
comma-separated values lie within a set of allowed values.

@param string $fieldName
TS setup field name to extract, must not be empty
@param bool $canUseFlexforms
whether the value can also be set via flexforms (this will be
mentioned in the error message)
@param string $sheet
flexforms sheet pointer, eg. "sDEF", will be ignored if
$canUseFlexforms is set to FALSE
@param string $explanation
a sentence explaining what that configuration value is needed for,
must not be empty
@param string[] $allowedValues
allowed values (must not be empty)

@return void
Checks whether a configuration value either is empty or its comma - separated values lie within a set of allowed values .