From 7989b1878c966515235270c75431a5d8661b3bd6 Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Tue, 19 Oct 2021 15:12:47 +0200
Subject: [PATCH] [TASK] Exlude / L10n-Exclude some TCA more fields, Cleanup

---
 Configuration/TCA/Overrides/pages.php | 63 ++++++++++++++-------------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php
index 73f2340..c7613ed 100644
--- a/Configuration/TCA/Overrides/pages.php
+++ b/Configuration/TCA/Overrides/pages.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  *
  * Copyright notice
@@ -206,6 +207,7 @@ $GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::
 		],
 		'tx_sgnews_news_author' => [
 			'exclude' => TRUE,
+			'l10n_exclude' => TRUE,
 			'label' => $localLangDbPath . 'pages.tx_sgnews_news_author',
 			'config' => [
 				'type' => 'group',
@@ -288,7 +290,8 @@ $GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::
 			],
 		],
 		'tx_sgnews_tags' => [
-			'exclude' => 1,
+			'exclude' => TRUE,
+			'l10n_exclude' => TRUE,
 			'label' => $localLangDbPath . 'pages.tx_sgnews_tags',
 			'config' => [
 				'type' => 'select',
@@ -314,6 +317,8 @@ $GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::
 			]
 		],
 		'tx_sgnews_likes' => [
+			'exclude' => TRUE,
+			'l10n_exclude' => TRUE,
 			'label' => $localLangDbPath . 'pages.tx_sgnews_likes',
 			'config' => [
 				'type' => 'input',
@@ -323,6 +328,7 @@ $GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::
 		],
 		'lastUpdated' => [
 			'exclude' => TRUE,
+			'l10n_exclude' => TRUE,
 			'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.lastUpdated',
 			'config' => [
 				'type' => 'input',
@@ -337,6 +343,7 @@ $GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::
 		],
 		'tx_sgnews_date_end' => [
 			'exclude' => TRUE,
+			'l10n_exclude' => TRUE,
 			'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_date_end',
 			'config' => [
 				'type' => 'input',
@@ -383,36 +390,30 @@ $GLOBALS['TCA']['pages']['palettes']['editorialWithNewsAuthor'] = [
 	'canNotCollapse' => 1,
 ];
 
-foreach (
-	$GLOBALS['TCA']['pages']['columns'] as $languageExcludeField => $_
-) {
-	if (
-	!\in_array(
-		$languageExcludeField, [
-			'doktype',
-			'title',
-			'subtitle',
-			'description',
-			'slug',
-			'tx_projectbase_path_segment',
-			'tx_projectbase_excludefromsluggeneration',
-			'tx_sgnews_location',
-			'tx_sgnews_teaser1_image',
-			'tx_sgnews_teaser2_image',
-			'tx_sgnews_tags',
-			'abstract',
-			'tx_projectbase_seo_titletag',
-			'tx_projectbase_seo_canonicaltag',
-			'hidden',
-			'sys_language_uid',
-			'tx_languagevisibility_visibility',
-			'lastUpdated',
-			'tx_sgnews_date_end',
-			'tx_sgnews_highlighted',
-			'tx_sgnews_never_highlighted',
-		]
-	)
-	) {
+foreach ($GLOBALS['TCA']['pages']['columns'] as $languageExcludeField => $_) {
+	if (!in_array($languageExcludeField, [
+		'doktype',
+		'title',
+		'subtitle',
+		'description',
+		'slug',
+		'tx_projectbase_path_segment',
+		'tx_projectbase_excludefromsluggeneration',
+		'tx_sgnews_location',
+		'tx_sgnews_teaser1_image',
+		'tx_sgnews_teaser2_image',
+		'tx_sgnews_tags',
+		'abstract',
+		'tx_projectbase_seo_titletag',
+		'tx_projectbase_seo_canonicaltag',
+		'hidden',
+		'sys_language_uid',
+		'tx_languagevisibility_visibility',
+		'lastUpdated',
+		'tx_sgnews_date_end',
+		'tx_sgnews_highlighted',
+		'tx_sgnews_never_highlighted',
+	])) {
 		$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE]['columnsOverrides'][$languageExcludeField]['l10n_mode'] = 'exclude';
 	}
 }
-- 
GitLab