protected function attachAssets()
{
if (FALSE === self::$assetsIncluded) {
$doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\ModuleTemplate');
$doc->backPath = $GLOBALS['BACK_PATH'];
/** @var PageRenderer $pageRenderer */
$pageRenderer = $doc->getPageRenderer();
$pageRenderer->addCssFile($doc->backPath . ExtensionManagementUtility::extRelPath('flux') . 'Resources/Public/css/grid.css');
// /typo3/sysext/backend/Resources/Public/JavaScript/LayoutModule/DragDrop.js
// is not the perfect solution for Flux Grids!
// an adapted version of DragDrop.js is used - Resources/Public/js/VersionSevenPointTwo/DragDrop.js
// Also fluxCollapse.js is updated.
$fullJsPath = PathUtility::getRelativePath(PATH_typo3, GeneralUtility::getFileAbsFileName('EXT:flux/Resources/Public/js/'));
// requirejs
$pageRenderer->addRequireJsConfiguration(array('paths' => array('FluidTypo3/Flux/DragDrop' => $fullJsPath . 'DragDrop')));
$pageRenderer->loadRequireJsModule('FluidTypo3/Flux/DragDrop');
// This is necessary for fluxCollapse.js
$pageRenderer->loadExtJS();
$pageRenderer->addJsFile($doc->backPath . ExtensionManagementUtility::extRelPath('flux') . 'Resources/Public/js/fluxCollapse.js');
self::$assetsIncluded = TRUE;
}
}