Skip to content

Instantly share code, notes, and snippets.

@cedricziel
Last active September 7, 2015 09:24
Show Gist options
  • Save cedricziel/03e449bce374988ca7a1 to your computer and use it in GitHub Desktop.
Save cedricziel/03e449bce374988ca7a1 to your computer and use it in GitHub Desktop.
TYPO3 Module label
<?php
// ..
if (TYPO3_MODE === 'BE') {
// Moves the new main module to a new position (after 'web' in this case)
$modulName = 'mymod'; // the main module name from below
if (!isset($TBE_MODULES[$modulName])) {
$temp_TBE_MODULES = array();
foreach ($TBE_MODULES as $key => $val) {
if ($key == 'web') {
$temp_TBE_MODULES[$key] = $val;
$temp_TBE_MODULES[$modulName] = '';
} else {
$temp_TBE_MODULES[$key] = $val;
}
}
$TBE_MODULES = $temp_TBE_MODULES;
}
// Register new main module
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
$_EXTKEY,
'mymod',
'',
'',
array(),
array(
'access' => 'user,group',
'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_modmymod.xlf',
)
);
// Register a sub module under the new main module
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'Vendor.' . $_EXTKEY,
'mymod', // Make module a submodule of 'mymod'
'moduleone', // Submodule key
'',
array(
'Controller' => 'action1, action2'
),
array(
'access' => 'user,group',
'icon' => 'EXT:' . $_EXTKEY . '/Resources/Public/Icons/mod_users.gif',
'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_moduleone.xlf',
)
);
}
// ..
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2014-12-08T11:00:10Z"
product-name="myext">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>MyExtension Administration</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source></source>
</trans-unit>
</body>
</file>
</xliff>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2014-12-08T11:00:10Z"
product-name="myext">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>Module 1</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source>Manage all Module1 stuff here.</source>
</trans-unit>
</body>
</file>
</xliff>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment