Skip to content

Commit

Permalink
Merge pull request #92 from IchHabRecht/fix-sys_file_reference-backen…
Browse files Browse the repository at this point in the history
…d-preview
  • Loading branch information
IchHabRecht committed Sep 22, 2017
2 parents f07830a + 1c975ff commit b15b4e8
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion Classes/CodeGenerator/BackendFluidCodeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,16 @@ protected function getInlineFluid($field, array $fieldConfiguration, $iteratorNa
$content .= $this->getInlineFluid($foreignLabelField, $foreignLabelFieldConfiguration, 'item');
break;
default:
$content .= <<<EOS
if ($foreignLabelFieldConfiguration['config']['type'] === 'group'
&& $foreignLabelFieldConfiguration['config']['allowed'] === 'sys_file'
) {
$content .= $this->getSysFileFluid();
} else {
$content .= <<<EOS
<f:translate key="{$foreignLabel}" /> {{$variableIterator}.{$foreignLabelField}} (id={{$variableIterator}.uid})<br/>
EOS;
}
}

$content .= <<<EOS
Expand Down Expand Up @@ -146,6 +152,30 @@ protected function getSelectFluid($field, array $fieldConfiguration)
</f:for>
</ul>
EOS;
}

return $content;
}

/**
* @return string
*/
protected function getSysFileFluid()
{
if (version_compare(TYPO3_version, '8.6.0', '>=')) {
$content = <<<EOS
<ul>
<f:for each="{item.uid_local}" as="file">
<li><f:translate key="LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.uid_local" /> {file.table}|{file.uid}|{file.title} (id={item.uid})</li>
</f:for>
</ul>
EOS;
} else {
$content = <<<EOS
<f:translate key="LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.uid_local" /> {item.uid_local} (id={item.uid})
EOS;
}

Expand Down

0 comments on commit b15b4e8

Please sign in to comment.