diff --git a/Classes/Updates/StoreFinderCTypeMigration.php b/Classes/Updates/StoreFinderCTypeMigration.php new file mode 100644 index 00000000..2e08a392 --- /dev/null +++ b/Classes/Updates/StoreFinderCTypeMigration.php @@ -0,0 +1,50 @@ + 'storefinder_map', + 'storefinder_cached' => 'storefinder_cached', + 'storefinder_show' => 'storefinder_show', + ]; + } + + public function getTitle(): string + { + return 'Migrate "Store Finder" plugins to content elements.'; + } + + public function getDescription(): string + { + return ' + The "Store Finder" plugin is now registered as content element. Update migrates existing + records and backend user permissions. + '; + } +} diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index f01d0ce2..eecc789b 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,45 +1,81 @@ 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.frames', + 'showitem' => ' + frame_class;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class_formlabel, + space_before_class;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:space_before_class_formlabel, + space_after_class;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:space_after_class_formlabel + ' + ]; + + $showItems = ' + --palette--;;general, + --palette--;;headers, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:plugin, + pi_flexform, + pages;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:pages.ALT.list_formlabel, + recursive, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:appearance, + --palette--;;storefinder-frames, + --palette--;;appearanceLinks, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories, + categories, + --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:notes, + rowDescription, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended + '; + + ExtensionUtility::registerPlugin( + 'store_finder', + 'Map', + $languageFile . 'tt_content.list_type_map' + ); + $GLOBALS['TCA']['tt_content']['types']['storefinder_map']['showitem'] = $showItems; + + ExtensionManagementUtility::addPiFlexFormValue( + '*', + 'FILE:EXT:store_finder/Configuration/FlexForms/flexform_mapWithSearch.xml', + 'storefinder_map' + ); + + ExtensionUtility::registerPlugin( + 'store_finder', + 'Cached', + $languageFile . 'tt_content.list_type_cached' + ); + $GLOBALS['TCA']['tt_content']['types']['storefinder_cached']['showitem'] = $showItems; + + ExtensionManagementUtility::addPiFlexFormValue( + '*', + 'FILE:EXT:store_finder/Configuration/FlexForms/flexform_mapWithSearch.xml', + 'storefinder_cached' + ); + + ExtensionUtility::registerPlugin( + 'store_finder', + 'Show', + $languageFile . 'tt_content.list_type_show' + ); + $GLOBALS['TCA']['tt_content']['types']['storefinder_show']['showitem'] = $showItems; + + ExtensionManagementUtility::addPiFlexFormValue( + '*', + 'FILE:EXT:store_finder/Configuration/FlexForms/flexform_singleLocation.xml', + 'storefinder_show' + ); +})(); diff --git a/Configuration/TSconfig/NewContentElementWizard.tsconfig b/Configuration/TSconfig/NewContentElementWizard.tsconfig index da3f84c9..cd2d65e2 100644 --- a/Configuration/TSconfig/NewContentElementWizard.tsconfig +++ b/Configuration/TSconfig/NewContentElementWizard.tsconfig @@ -7,8 +7,7 @@ mod.wizards.newContentElement.wizardItems.store_finder { title = LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:pi1_title_map description = LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:pi1_description_map tt_content_defValues { - CType = list - list_type = storefinder_map + CType = storefinder_map } } @@ -17,8 +16,7 @@ mod.wizards.newContentElement.wizardItems.store_finder { title = LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:pi1_title_cached description = LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:pi1_description_cached tt_content_defValues { - CType = list - list_type = storefinder_cached + CType = storefinder_cached } } @@ -27,8 +25,7 @@ mod.wizards.newContentElement.wizardItems.store_finder { title = LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:pi1_title_show description = LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:pi1_description_show tt_content_defValues { - CType = list - list_type = storefinder_show + CType = storefinder_show } } } @@ -36,7 +33,7 @@ mod.wizards.newContentElement.wizardItems.store_finder { show = * } -mod.web_layout.tt_content.preview.list { +mod.web_layout.tt_content.preview { storefinder_map = EXT:store_finder/Resources/Private/Templates/Preview/Map.html storefinder_cached = EXT:store_finder/Resources/Private/Templates/Preview/Map.html storefinder_show = EXT:store_finder/Resources/Private/Templates/Preview/Show.html diff --git a/ext_localconf.php b/ext_localconf.php index 41b8e5b9..020d74f5 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,5 +1,7 @@ ['system'], + 'groups' => [ 'system' ], ]; } if (!is_array($cacheConfigurations['store_finder_middleware_cache'] ?? null)) { $cacheConfigurations['store_finder_middleware_cache'] = [ - 'groups' => ['pages'], + 'groups' => [ 'pages' ], ]; } @@ -37,29 +39,30 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][ LocationCountryItems::class ] = [ - 'depends' => [ - TcaSelectItems::class, - ] + 'depends' => [ TcaSelectItems::class ] ]; ExtensionUtility::configurePlugin( 'StoreFinder', 'Map', - [MapController::class => 'map, search, show'], - [MapController::class => 'map, search, show'] + [ MapController::class => 'map, search, show' ], + [ MapController::class => 'map, search, show' ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( 'StoreFinder', 'Cached', - [MapController::class => 'cachedMap, map, search, show'], - [MapController::class => 'map, search, show'] + [ MapController::class => 'cachedMap, map, search, show' ], + [ MapController::class => 'map, search, show' ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( 'StoreFinder', 'Show', - [MapController::class => 'show'], - [MapController::class => 'show'] + [ MapController::class => 'show' ], + [ MapController::class => 'show' ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); -}); +})();