Skip to content

Commit

Permalink
[TASK] Use TBE_STYLES directly for attaching assets required by conte…
Browse files Browse the repository at this point in the history
…nt icons

Allows skipping various checks and instance creations and just assign a string value in a global array.
  • Loading branch information
NamelessCoder committed Jan 30, 2016
1 parent d26cbdc commit 7565ebc
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Classes/Hooks/ContentIconHookSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
*/
class ContentIconHookSubscriber {

/**
* @var boolean
*/
protected static $assetsIncluded = FALSE;

/**
* @var array
*/
Expand Down Expand Up @@ -136,12 +131,7 @@ protected function detectFirstFlexTypeFieldInTableFromPossibilities($table, $fie
* @return void
*/
protected function attachAssets() {
if (FALSE === self::$assetsIncluded) {
$doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\ModuleTemplate');
$doc->backPath = $GLOBALS['BACK_PATH'];
$doc->getPageRenderer()->addCssFile($doc->backPath . ExtensionManagementUtility::extRelPath('flux') . 'Resources/Public/css/icon.css');
self::$assetsIncluded = TRUE;
}
$GLOBALS['TBE_STYLES']['stylesheet']['flux'] = $doc->backPath . ExtensionManagementUtility::extRelPath('flux') . 'Resources/Public/css/icon.css';
}

}

0 comments on commit 7565ebc

Please sign in to comment.