[BUGFIX] Fatal error when executing update script
[TYPO3CMS/Extensions/static_info_tables.git] / ext_tables.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 if (TYPO3_MODE == 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
5 /**
6 * Registers the Static Info Tables Manager backend module, if enabled
7 */
8 if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['enableManager']) {
9 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
10 'SJBR.' . $_EXTKEY,
11 // Make module a submodule of 'tools'
12 'tools',
13 // Submodule key
14 'Manager',
15 // Position
16 '',
17 // An array holding the controller-action combinations that are accessible
18 array(
19 'Manager' => 'information,newLanguagePack,createLanguagePack,testForm,testFormResult,sqlDumpNonLocalizedData'
20 ),
21 array(
22 'access' => 'user,group',
23 'icon' => 'EXT:' . $_EXTKEY . '/Resources/Public/Images/Icons/moduleicon.gif',
24 'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf'
25 )
26 );
27 // Add module configuration setup
28 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY, 'setup', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/TypoScript/Manager/setup.txt">');
29
30 // Enable editing Static Info Tables
31 if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'])) {
32 $tableNames = array_keys($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables']);
33 foreach ($tableNames as $tableName) {
34 $GLOBALS['TCA'][$tableName]['ctrl']['readOnly'] = 0;
35 }
36 }
37 }
38 }