From 7e186b0bcce15b65f2861e2468a606904349fbb1 Mon Sep 17 00:00:00 2001 From: Mathias Brodala Date: Fri, 8 Jan 2021 09:17:25 +0100 Subject: [PATCH] [TASK] Move plugin registration to TCA overrides (#169) This commit moves the plugin configuration from ext_tables.php to the respective TCA override of tt_content. --- Configuration/TCA/Overrides/tt_content.php | 110 +++++++++++++++++++-- ext_tables.php | 85 ---------------- 2 files changed, 103 insertions(+), 92 deletions(-) diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 0de8901c..5866db79 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -11,17 +11,113 @@ die('Access denied.'); } -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_archive'] = 'select_key'; -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_commentform'] = 'recursive,select_key,pages'; -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_comments'] = 'recursive,select_key,pages'; -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_category'] = 'select_key'; -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_tag'] = 'select_key'; +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Posts', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_posts.title', + 'plugin-blog-posts' +); $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_posts'] = 'select_key'; -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_metadata'] = 'recursive,select_key,pages'; -$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_sidebar'] = 'recursive,select_key,pages'; +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'LatestPosts', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_latestposts.title', + 'plugin-blog-posts' +); $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['blog_latestposts'] = 'pi_flexform'; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( 'blog_latestposts', 'FILE:EXT:blog/Configuration/FlexForms/LatestPosts.xml' ); + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Category', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_category.title', + 'plugin-blog-category' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_category'] = 'select_key'; + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'AuthorPosts', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_authorposts.title', + 'plugin-blog-authorposts' +); + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Tag', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_tag.title', + 'plugin-blog-tag' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_tag'] = 'select_key'; + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Archive', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_archive.title', + 'plugin-blog-archive' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_archive'] = 'select_key'; + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Sidebar', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_sidebar.title', + 'plugin-blog-sidebar' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_sidebar'] = 'recursive,select_key,pages'; + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Metadata', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_metadata.title', + 'plugin-blog-metadata' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_metadata'] = 'recursive,select_key,pages'; + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'CommentForm', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_commentform.title', + 'plugin-blog-commentform' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_commentform'] = 'recursive,select_key,pages'; + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Comments', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_comments.title', + 'plugin-blog-comments' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['blog_comments'] = 'recursive,select_key,pages'; + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Authors', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_authors.title', + 'plugin-blog-authors' +); + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'RelatedPosts', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_relatedposts.title', + 'plugin-blog-relatedposts' +); + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Header', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_header.title', + 'plugin-blog-header' +); + +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'T3G.AgencyPack.Blog', + 'Footer', + 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_footer.title', + 'plugin-blog-footer' +); diff --git a/ext_tables.php b/ext_tables.php index 53f45991..54456082 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -67,91 +67,6 @@ \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_blog_domain_model_comment'); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Posts', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_posts.title', - 'plugin-blog-posts' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'LatestPosts', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_latestposts.title', - 'plugin-blog-posts' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Category', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_category.title', - 'plugin-blog-category' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'AuthorPosts', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_authorposts.title', - 'plugin-blog-authorposts' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Tag', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_tag.title', - 'plugin-blog-tag' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Archive', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_archive.title', - 'plugin-blog-archive' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Sidebar', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_sidebar.title', - 'plugin-blog-sidebar' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Metadata', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_metadata.title', - 'plugin-blog-metadata' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'CommentForm', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_commentform.title', - 'plugin-blog-commentform' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Comments', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_comments.title', - 'plugin-blog-comments' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Authors', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_authors.title', - 'plugin-blog-authors' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'RelatedPosts', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_relatedposts.title', - 'plugin-blog-relatedposts' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Header', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_header.title', - 'plugin-blog-header' - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'T3G.AgencyPack.Blog', - 'Footer', - 'LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_footer.title', - 'plugin-blog-footer' - ); - if (TYPO3_MODE === 'BE') { // Main Blog \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(