diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 1172acc..3d6e14c 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -4,11 +4,60 @@ use TYPO3\CMS\Extbase\Utility\ExtensionUtility; defined('TYPO3') || die(); -ExtensionUtility::registerPlugin( - 'Watchlist', - 'Watchlist', - 'LLL:EXT:watchlist/Resources/Private/Language/locallang.xlf:plugin.watchlist', - 'EXT:watchlist/Resources/Public/Icons/Extension.svg' -); +(static function (string $extKey, string $table, string $contentType) { + $languagePath = implode(':', [ + 'LLL', + 'EXT', + $extKey . '/Resources/Private/Language/locallang.xlf', + $table . '.' . $contentType . '.', + ]); -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['watchlist_watchlist'] = 'recursive,select_key,pages'; + ExtensionUtility::registerPlugin( + $extKey, + $extKey, + $languagePath . 'title', + 'EXT:' . $extKey . '/Resources/Public/Icons/Extension.svg' + ); + + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem( + $table, + 'CType', + [ + $languagePath . 'title', + $contentType, + 'content-bullets', + 'special', + ] + ); + + \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$table], [ + 'ctrl' => [ + 'typeicon_classes' => [ + $contentType => 'content-bullets', + ], + ], + 'types' => [ + $contentType => [ + 'showitem' => implode(',', [ + '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general', + '--palette--;;general', + '--palette--;;headers', + '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance', + '--palette--;;frames', + '--palette--;;appearanceLinks', + '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language', + '--palette--;;language', + '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access', + '--palette--;;hidden', + '--palette--;;access', + '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories', + '--div--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_category.tabs.category', + 'categories', + '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes', + 'rowDescription', + '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended', + ]), + ], + ], + ]); +})('watchlist', 'tt_content', 'watchlist_watchlist'); diff --git a/Configuration/TSconfig/Page/Default.tsconfig b/Configuration/TSconfig/Page/Default.tsconfig new file mode 100644 index 0000000..12206bb --- /dev/null +++ b/Configuration/TSconfig/Page/Default.tsconfig @@ -0,0 +1,16 @@ +mod.wizards.newContentElement.wizardItems.special { + elements { + watchlist { + iconIdentifier = content-bullets + title = LLL:EXT:watchlist/Resources/Private/Language/locallang.xlf:tt_content.watchlist_watchlist.title + description = LLL:EXT:watchlist/Resources/Private/Language/locallang.xlf:tt_content.watchlist_watchlist.description + tt_content_defValues { + CType = watchlist_watchlist + header = Watchlist + header_layout = 100 + } + } + } + show := addToList(watchlist) +} + diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf new file mode 100644 index 0000000..2d82d39 --- /dev/null +++ b/Resources/Private/Language/de.locallang.xlf @@ -0,0 +1,24 @@ + + + +
+ + + Watchlist + Merkliste + + + Watchlist is empty + Merkliste ist leer + + + Watchlist + Merkliste + + + Content element to show Watchlist items + Inhaltselement zur Darstellung von Merklisteneinträgen + + + + diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 59b0dc1..47f06ba 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -9,6 +9,12 @@ Watchlist is empty + + Watchlist + + + Content element to show Watchlist items + diff --git a/Tests/Fixtures/Sites/default/config.yaml b/Tests/Fixtures/Sites/default/config.yaml index 55fde69..a127453 100644 --- a/Tests/Fixtures/Sites/default/config.yaml +++ b/Tests/Fixtures/Sites/default/config.yaml @@ -1,22 +1,9 @@ base: / languages: - - - title: Deutsch - enabled: true - base: / - typo3Language: de - locale: de_DE.UTF-8 - iso-639-1: de - navigationTitle: Deutsch - hreflang: de-DE - direction: '' - flag: de - websiteTitle: '' - languageId: 0 - title: English enabled: true - base: /en + base: / typo3Language: default locale: en_GB.UTF-8 iso-639-1: en @@ -25,8 +12,21 @@ languages: hreflang: en-GB direction: '' flag: gb - languageId: 1 + languageId: 0 fallbackType: strict fallbacks: '0' + - + title: Deutsch + enabled: true + base: /de + typo3Language: de + locale: de_DE.UTF-8 + iso-639-1: de + navigationTitle: Deutsch + hreflang: de-DE + direction: '' + flag: de + websiteTitle: '' + languageId: 1 rootPageId: 1 websiteTitle: 'Example Website' diff --git a/ext_localconf.php b/ext_localconf.php index 6b1dfa1..3d56bca 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,5 +1,6 @@