Last active
June 18, 2019 11:28
-
-
Save nostadt/79b4035ba71e07491933507617d1383a to your computer and use it in GitHub Desktop.
Register Backend Module with Icon from FontAwesome (Tested with 8 LTS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('TYPO3_MODE')) { | |
die('Access denied.'); | |
} | |
(function () { | |
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); | |
// Icons from: https://fontawesome.com/v3.2.1/icons/ | |
foreach (['shopping-cart', 'search'] as $icon) { | |
$iconRegistry->registerIcon( | |
'vendor-' . $icon, | |
\TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class, | |
[ | |
'name' => $icon, | |
] | |
); | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('TYPO3_MODE')) { | |
die('Access denied.'); | |
} | |
(function () { | |
/** | |
* ###################################################################### | |
* | |
* SETTINGS | |
* | |
* ###################################################################### | |
*/ | |
$vendor = 'Vendor'; | |
$extKey = 'my_ext'; | |
$moduleExtensionName = $vendor . '.' . $extKey; | |
$mainModuleName = 'myextmain'; | |
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule( | |
$mainModuleName, | |
'', | |
'', | |
'', | |
[ | |
'name' => $mainModuleName, | |
'access' => 'user,group', | |
'iconIdentifier' => 'vendor-search', | |
'labels' => [ | |
'll_ref' => 'LLL:EXT:my_ext/Resources/Private/Language/locallang_mod_myextmain.xlf', | |
], | |
] | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment