-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Change extension plugins registration
Plugins are now registered as CType from list_type. Migration is provided.
- Loading branch information
Showing
4 changed files
with
147 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace Evoweb\StoreFinder\Updates; | ||
|
||
use TYPO3\CMS\Install\Attribute\UpgradeWizard; | ||
use TYPO3\CMS\Install\Updates\AbstractListTypeToCTypeUpdate; | ||
|
||
/** | ||
* @internal This class is only meant to be used within EXT:install. | ||
*/ | ||
#[UpgradeWizard('storeFinderCTypeMigration')] | ||
final class StoreFinderCTypeMigration extends AbstractListTypeToCTypeUpdate | ||
{ | ||
protected function getListTypeToCTypeMapping(): array | ||
{ | ||
return [ | ||
'storefinder_map' => '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. | ||
'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,81 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
use TYPO3\CMS\Extbase\Utility\ExtensionUtility; | ||
|
||
defined('TYPO3') or die(); | ||
|
||
$pluginSignature = 'storefinder_map'; | ||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'layout, select_key'; | ||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; | ||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( | ||
$pluginSignature, | ||
'FILE:EXT:store_finder/Configuration/FlexForms/flexform_mapWithSearch.xml' | ||
); | ||
|
||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( | ||
'store_finder', | ||
'Map', | ||
'LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:tt_content.list_type_map' | ||
); | ||
|
||
$pluginSignature = 'storefinder_cached'; | ||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'layout, select_key'; | ||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; | ||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( | ||
$pluginSignature, | ||
'FILE:EXT:store_finder/Configuration/FlexForms/flexform_mapWithSearch.xml' | ||
); | ||
|
||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( | ||
'store_finder', | ||
'Cached', | ||
'LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:tt_content.list_type_cached' | ||
); | ||
|
||
$pluginSignature = 'storefinder_show'; | ||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'layout, select_key'; | ||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; | ||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( | ||
$pluginSignature, | ||
'FILE:EXT:store_finder/Configuration/FlexForms/flexform_singleLocation.xml' | ||
); | ||
|
||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( | ||
'store_finder', | ||
'Show', | ||
'LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:tt_content.list_type_show' | ||
); | ||
(static function () { | ||
$languageFile = 'LLL:EXT:store_finder/Resources/Private/Language/locallang_be.xlf:'; | ||
$GLOBALS['TCA']['tt_content']['palettes']['storefinder-frames'] = [ | ||
'label' => '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' | ||
); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters