Commit e6c14518 authored by Kevin Ditscheid's avatar Kevin Ditscheid

[TASK] Use strings instead of variables for TCA configuration

parent 9aa18013
......@@ -24,24 +24,20 @@
* This copyright notice MUST APPEAR in all copies of the script!
*/
call_user_func(
static function ($extKey, $table) {
$tempColumnsPages = [
'tx_languagevisibility_visibility' => [
'exclude' => 1,
'displayCond' => [
'OR' => [
'FIELD:sys_language_uid:=:0',
'FIELD:sys_language_uid:=:',
],
],
'label' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:pages.tx_languagevisibility_visibility',
'config' => [
'type' => 'user',
'renderType' => 'languageVisibility'
]
$tempColumnsPages = [
'tx_languagevisibility_visibility' => [
'exclude' => 1,
'displayCond' => [
'OR' => [
'FIELD:sys_language_uid:=:0',
'FIELD:sys_language_uid:=:',
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns($table, $tempColumnsPages);
}, 'languagevisibility', 'pages'
);
],
'label' => 'LLL:EXT:languagevisibility/Resources/Private/Language/locallang_db.xlf:pages.tx_languagevisibility_visibility',
'config' => [
'type' => 'user',
'renderType' => 'languageVisibility'
]
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $tempColumnsPages);
......@@ -24,33 +24,28 @@
* This copyright notice MUST APPEAR in all copies of the script!
*/
call_user_func(
static function ($extKey, $table) {
$tempColumnsElements = [
'tx_languagevisibility_visibility' => [
'exclude' => 1,
'displayCond' => [
'OR' => [
'FIELD:sys_language_uid:=:0',
'FIELD:sys_language_uid:=:',
],
],
'l10n_display' => 'hideDiff',
'label' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:pages.tx_languagevisibility_visibility',
'config' => [
'type' => 'user',
'renderType' => 'languageVisibility'
]
]
];
$tempColumnsElements = [
'tx_languagevisibility_visibility' => [
'exclude' => 1,
'displayCond' => [
'OR' => [
'FIELD:sys_language_uid:=:0',
'FIELD:sys_language_uid:=:',
],
],
'l10n_display' => 'hideDiff',
'label' => 'LLL:EXT:languagevisibility/Resources/Private/Language/locallang_db.xlf:pages.tx_languagevisibility_visibility',
'config' => [
'type' => 'user',
'renderType' => 'languageVisibility'
]
]
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns($table, $tempColumnsElements);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $tempColumnsElements);
$GLOBALS['TCA'][$table]['palettes']['general']['showitem'] = \str_replace(
'sys_language_uid;LLL:EXT:cms/locallang_ttc.xml:sys_language_uid_formlabel',
'',
$GLOBALS['TCA'][$table]['palettes']['general']['showitem']
);
}, 'languagevisibility', 'tt_content'
$GLOBALS['TCA']['tt_content']['palettes']['general']['showitem'] = \str_replace(
'sys_language_uid;LLL:EXT:cms/locallang_ttc.xml:sys_language_uid_formlabel',
'',
$GLOBALS['TCA']['tt_content']['palettes']['general']['showitem']
);
......@@ -5,38 +5,38 @@ if (!defined('TYPO3_MODE')) {
}
call_user_func(
function ($extKey) {
function () {
/**
* Register TYPO3 core hooks
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\TceMainHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\TceMainHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\PageHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\PageHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['checkFullLanguagesAccess'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['checkFullLanguagesAccess']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\UserAuthGroupHook::class . '->checkFullLanguagesAccess';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\AlternativeDocumentHook::class . '->makeEditForm_accessCheck';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\MenuHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\TcaHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\TceMainHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmap_afterFinish'][$extKey] =
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmap_afterFinish']['languagevisibility'] =
\TYPO3\Languagevisibility\Hook\TceMainHook::class;
// overriding option because this is done by languagevisibility and will not work if set
......@@ -71,5 +71,5 @@ call_user_func(
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['visibilitySettingsMigrationWizard']
= \TYPO3\Languagevisibility\Updates\VisibilitySettingsMigrationWizard::class;
}, 'languagevisibility'
}
);
......@@ -5,9 +5,7 @@ if (!defined('TYPO3_MODE')) {
}
call_user_func(
static function ($extKey) {
static function () {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_languagevisibility_visibility_flag');
}, 'languagevisibility'
}
);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment