Skip to content

Commit

Permalink
[TASK] Move plugin registration to TCA overrides (#169)
Browse files Browse the repository at this point in the history
This commit moves the plugin configuration from ext_tables.php to the
respective TCA override of tt_content.
  • Loading branch information
mbrodala authored Jan 8, 2021
1 parent cc64bbc commit 7e186b0
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 92 deletions.
110 changes: 103 additions & 7 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
85 changes: 0 additions & 85 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7e186b0

Please sign in to comment.