protected function insertAssetsAtMarker($markerName, $assets)
{
$assetMarker = '<!-- VhsAssets' . $markerName . ' -->';
if (false === strpos($GLOBALS['TSFE']->content, $assetMarker)) {
$inFooter = (bool) (false !== strpos($markerName, 'Footer'));
$tag = true === $inFooter ? '</body>' : '</head>';
$GLOBALS['TSFE']->content = str_replace($tag, $assetMarker . LF . $tag, $GLOBALS['TSFE']->content);
}
if (true === is_array($assets)) {
$chunk = $this->buildAssetsChunk($assets);
} else {
$chunk = $assets;
}
$GLOBALS['TSFE']->content = str_replace($assetMarker, $chunk, $GLOBALS['TSFE']->content);
}