Skip to content

Commit

Permalink
[TASK] Make module positioning compatible with TYPO3 10.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Apr 3, 2020
1 parent 8befd62 commit 9e240bb
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,34 @@
);

if (TYPO3_MODE === 'BE') {

// Module Blog
$firstKey = array_key_first($GLOBALS['TBE_MODULES']);
$firstValue = array_shift($GLOBALS['TBE_MODULES']);
$GLOBALS['TBE_MODULES'] = array_merge([$firstKey => $firstValue, 'blog' => ''], $GLOBALS['TBE_MODULES']);
$GLOBALS['TBE_MODULES']['_configuration']['blog'] = [
'labels' => 'LLL:EXT:blog/Resources/Private/Language/locallang_mod_blog.xlf',
'name' => 'web',
'iconIdentifier' => 'module-blog'
];
if (version_compare(
\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version(),
'10.4.0',
'lt'
)) {
$firstKey = array_key_first($GLOBALS['TBE_MODULES']);
$firstValue = array_shift($GLOBALS['TBE_MODULES']);
$GLOBALS['TBE_MODULES'] = array_merge([$firstKey => $firstValue, 'blog' => ''], $GLOBALS['TBE_MODULES']);
$GLOBALS['TBE_MODULES']['_configuration']['blog'] = [
'labels' => 'LLL:EXT:blog/Resources/Private/Language/locallang_mod_blog.xlf',
'name' => 'blog',
'iconIdentifier' => 'module-blog'
];
} else {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
'blog',
'',
'after:web',
null,
[
'labels' => 'LLL:EXT:blog/Resources/Private/Language/locallang_mod_blog.xlf',
'name' => 'blog',
'iconIdentifier' => 'module-blog',
]
);
}

// Module Blog > Posts
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
Expand Down

0 comments on commit 9e240bb

Please sign in to comment.