'',
'css' => '',
];
foreach ($modules as $module) {
if ($module instanceof ResourceProviderInterface) {
foreach ($module->getJavaScriptFiles() as $file) {
$result['js'] .= static::getJsTag($file);
}
foreach ($module->getCssFiles() as $file) {
$result['css'] .= static::getCssTag($file);
}
}
if ($module instanceof SubmoduleProviderInterface) {
$subResult = self::getAdditionalResourcesForModules($module->getSubModules());
$result['js'] .= $subResult['js'];
$result['css'] .= $subResult['css'];
}
}
return $result;
}
public static function getAdditionalResourcesForModule(ResourceProviderInterface $module): array
{
$result = [
'js' => '',
'css' => '',
];
foreach ($module->getJavaScriptFiles() as $file) {
$result['js'] .= static::getJsTag($file);
}
foreach ($module->getCssFiles() as $file) {
$result['css'] .= static::getCssTag($file);
}
return $result;
}
/**
* Returns a link tag with the admin panel stylesheet
* defined using TBE_STYLES
*
* @return string
*/
protected static function getAdminPanelStylesheet(): string
{
$result = '';
if (!empty($GLOBALS['TBE_STYLES']['stylesheets']['admPanel'])) {
$stylesheet = GeneralUtility::locationHeaderUrl($GLOBALS['TBE_STYLES']['stylesheets']['admPanel']);
$result = '';
}
return $result;
}
/**
* Get a css tag for file - with absolute web path resolving
*
* @param string $cssFileLocation
* @return string
*/
protected static function getCssTag(string $cssFileLocation): string
{
$css = '';
return $css;
}
/**
* Get a script tag for JavaScript with absolute paths
*
* @param string $jsFileLocation
* @return string
*/
protected static function getJsTag(string $jsFileLocation): string
{
$js = '';
return $js;
}
/**
* Return a string with tags for main admin panel resources
*
* @return array
*/
public static function getResources(): array
{
$jsFileLocation = 'EXT:adminpanel/Resources/Public/JavaScript/AdminPanel.js';
$js = ResourceUtility::getJsTag($jsFileLocation);
$cssFileLocation = 'EXT:adminpanel/Resources/Public/Css/adminpanel.css';
$css = ResourceUtility::getCssTag($cssFileLocation);
return [
'css' => $css . ResourceUtility::getAdminPanelStylesheet(),
'js' => $js,
];
}
}