From be3d40ce5e81f4c1c40c44fe4f288b9603a957c0 Mon Sep 17 00:00:00 2001 From: Axel Braunschweiger <axel.braunschweiger@sgalinski.de> Date: Wed, 6 Feb 2019 13:51:35 +0100 Subject: [PATCH] Feature add sg news plugin --- .../Page/NewContentElementWizard.tsconfig | 57 +++++++++++++++++++ .../Private/Language/de.locallang_backend.xlf | 16 ++++++ .../Private/Language/locallang_backend.xlf | 27 +++++++++ ext_localconf.php | 5 +- ext_tables.php | 9 +-- 5 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 Configuration/TsConfig/Page/NewContentElementWizard.tsconfig diff --git a/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig b/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig new file mode 100644 index 0000000..39ee1a7 --- /dev/null +++ b/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig @@ -0,0 +1,57 @@ +mod { + wizards.newContentElement.wizardItems.news { + header = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageTypeTitlePlugin.news + elements { + overview { + iconIdentifier = sg_news-module + title = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleOverviewPlugin + description = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:descriptionOverviewPlugin + tt_content_defValues { + CType = list + list_type = sgnews_overview + } + + } + + latest { + iconIdentifier = sg_news-module + title = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleLatestPlugin + description = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:descriptionLatestPlugin + tt_content_defValues { + CType = list + list_type = sgnews_latest + } + + } + + single { + iconIdentifier = sg_news-module + title = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleSingleViewPlugin + description = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:descriptionSingleViewPlugin + tt_content_defValues { + CType = list + list_type = sgnews_singleview + + } + + } + + category { + iconIdentifier = sg_news-module + title = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleListByCategoryPlugin + description = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:descriptionListByCategoryPlugin + tt_content_defValues { + CType = list + list_type = sgnews_listbycategory + + } + + } + + } + + show = * + + } + +} \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang_backend.xlf b/Resources/Private/Language/de.locallang_backend.xlf index 6c6bacc..88020cf 100644 --- a/Resources/Private/Language/de.locallang_backend.xlf +++ b/Resources/Private/Language/de.locallang_backend.xlf @@ -37,6 +37,22 @@ <source>News Single View</source> <target>News-Einzelansicht</target> </trans-unit> + <trans-unit id="descriptionLatestPlugin"> + <source>Choose to show Latest News</source> + <target>Zeige die neuesten News </target> + </trans-unit> + <trans-unit id="descriptionListByCategoryPlugin"> + <source>List News by Category/Tag</source> + <target>Liste News aus Kategorien/Tags</target> + </trans-unit> + <trans-unit id="descriptionOverviewPlugin"> + <source>Show an Overview of News</source> + <target>Ãœberblick der News</target> + </trans-unit> + <trans-unit id="descriptionSingleViewPlugin"> + <source>Show a Single View of News</source> + <target>Zeige Einzelansicht der News</target> + </trans-unit> </body> </file> </xliff> diff --git a/Resources/Private/Language/locallang_backend.xlf b/Resources/Private/Language/locallang_backend.xlf index c4b9a34..a0fd4d2 100644 --- a/Resources/Private/Language/locallang_backend.xlf +++ b/Resources/Private/Language/locallang_backend.xlf @@ -12,6 +12,21 @@ <trans-unit id="coordinatePicker.missingImage"> <source>Please upload an image first and save the form!</source> </trans-unit> + <trans-unit id="pageTypeTitlePlugin.news"> + <source>[SgNews] Plugins</source> + </trans-unit> + <trans-unit id="pageTypeTitlePluginOverview.news"> + <source>[SgNews] News Overview</source> + </trans-unit> + <trans-unit id="pageTypeTitlePluginLatest.news"> + <source>[SgNews] News Latest</source> + </trans-unit> + <trans-unit id="pageTypeTitlePluginCategory.news"> + <source>[SgNews] News by Category</source> + </trans-unit> + <trans-unit id="pageTypeTitlePluginSingle.news"> + <source>[SgNews] News Single View</source> + </trans-unit> <trans-unit id="pageType.category"> <source>Category</source> </trans-unit> @@ -21,15 +36,27 @@ <trans-unit id="titleLatestPlugin"> <source>Latest News</source> </trans-unit> + <trans-unit id="descriptionLatestPlugin"> + <source>Choose to show Latest News</source> + </trans-unit> <trans-unit id="titleListByCategoryPlugin"> <source>List News by Category/Tag</source> </trans-unit> + <trans-unit id="descriptionListByCategoryPlugin"> + <source>List News by Category/Tag</source> + </trans-unit> <trans-unit id="titleOverviewPlugin"> <source>News Overview</source> </trans-unit> + <trans-unit id="descriptionOverviewPlugin"> + <source>Show an Overview of News</source> + </trans-unit> <trans-unit id="titleSingleViewPlugin"> <source>News Single View</source> </trans-unit> + <trans-unit id="descriptionSingleViewPlugin"> + <source>Show a Single View of News</source> + </trans-unit> </body> </file> </xliff> diff --git a/ext_localconf.php b/ext_localconf.php index df06519..7f5a9e7 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -100,7 +100,10 @@ if(!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'][] = \SGalinski\SgNews\Hooks\PageLayoutController::class . '->addNewsModuleLink'; - // register command controllers $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'SGalinski\SgNews\Command\MigrateNewsCommandController'; + +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( + '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:sg_news/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig">' +); \ No newline at end of file diff --git a/ext_tables.php b/ext_tables.php index 8b9a4f6..3007830 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -10,22 +10,22 @@ if (!defined('TYPO3_MODE')) { TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'sg_news', 'Overview', - 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleOverviewPlugin' + 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageTypeTitlePluginOverview.news' ); TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'sg_news', 'Latest', - 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleLatestPlugin' + 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageTypeTitlePluginLatest.news' ); TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'sg_news', 'SingleView', - 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleSingleViewPlugin' + 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageTypeTitlePluginSingle.news' ); TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'sg_news', 'ListByCategory', - 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleListByCategoryPlugin' + 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:pageTypeTitlePluginCategory.news' ); if (TYPO3_MODE === 'BE') { @@ -162,6 +162,7 @@ $iconRegistry->registerIcon( \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, ['source' => 'EXT:sg_news/Resources/Public/Icons/module-sgnews-transparent.svg'] ); + $GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$customPageDoktype] = 'tcarecords-pages-' . $customPageDoktype; // add the new doktype to the list of types available from the new page menu at the top of the page tree -- GitLab