Skip to content

Commit

Permalink
[TASK] Deprecate plugin content element and plugin subtypes (list_typ…
Browse files Browse the repository at this point in the history
…e) (#297)

References TYPO3-Documentation/Changelog-To-Doc#1071
Releases: main
  • Loading branch information
linawolf authored Oct 12, 2024
1 parent 481ed2f commit 36331f9
Show file tree
Hide file tree
Showing 14 changed files with 270 additions and 186 deletions.
106 changes: 0 additions & 106 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
<?php

/*
* 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!
*/

use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

/*
* This file is part of the TYPO3 CMS project.
*
Expand Down Expand Up @@ -110,75 +95,6 @@
'before:editlock',
);

// Create various FE plugins to demonstrate FlexForms definition
// USAGE: TCA Reference > $TCA array reference > ['columns'][fieldname]['config'] / TYPE: "flex"

// Add the plugins to the list of plugins
ExtensionManagementUtility::addPlugin(
[
'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.list_type_pi2',
'examples_pi2',
],
'list_type',
'examples',
);
ExtensionManagementUtility::addPlugin(
[
'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.list_type_pi3',
'examples_pi3',
],
'list_type',
'examples',
);
ExtensionManagementUtility::addPlugin(
[
'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.list_type_pi4',
'examples_pi4',
],
'list_type',
'examples',
);

// Register the "error" plugin
ExtensionUtility::registerPlugin(
'Examples',
'Error',
'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.list_type_pierror',
null,
'plugins',
'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:pierror_wizard_description',
);
// Register the FAL example plugin
ExtensionUtility::registerPlugin(
'Examples',
'FalExamples',
'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:falexample_plugin_title',
);

// Disable the display of layout and select_key fields for the plugins
// provided by the extension
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['examples_pi1'] = 'layout,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['examples_pi2'] = 'layout,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['examples_pi3'] = 'layout,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['examples_pi4'] = 'layout,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['examples_error'] = 'layout,select_key,pages';

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['examples_pi2'] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue(
'examples_pi2',
'FILE:EXT:examples/Configuration/Flexforms/flexform_ds2.xml',
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['examples_pi3'] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue(
'examples_pi3',
'FILE:EXT:examples/Configuration/Flexforms/flexform_ds3.xml',
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['examples_pi4'] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue(
'examples_pi4',
'FILE:EXT:examples/Configuration/Flexforms/flexform_ds4.xml',
);

$standardTabs = '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
--palette--;;frames,
--palette--;;appearanceLinks,
Expand Down Expand Up @@ -259,28 +175,6 @@
],
];

ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
[
'label' => 'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:examples_dataprocdb_title',
'value' => 'examples_dataprocdb',
'icon' => 'mimetypes-x-content-table',
'group' => 'dataProcessingExamples',
'description' => 'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:examples_dataprocdb_description',
],
);

$GLOBALS['TCA']['tt_content']['types']['examples_dataprocdb'] = [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;general,
--palette--;;headers,
pages,
recursive,
' . $standardTabs,
];

ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
Expand Down
24 changes: 24 additions & 0 deletions Configuration/TCA/Overrides/tt_content_plugin_falexamples.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/*
* 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!
*/

defined('TYPO3') or die();
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

// Register the FAL example plugin
ExtensionUtility::registerPlugin(
'Examples',
'FalExamples',
'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:falexample_plugin_title',
);
39 changes: 18 additions & 21 deletions Configuration/TCA/Overrides/tt_content_plugin_haiku_detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,35 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Schema\Struct\SelectItem;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

/*
* 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!
*/

defined('TYPO3') or die();

$pluginSignature = 'examples_haiku_detail';

ExtensionManagementUtility::addPlugin(
[
new SelectItem(
'select',
'LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:detail.title',
'examples_haiku_detail',
$pluginSignature,
'tx_examples-haiku',
],
'list_type',
'plugins',
'LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:detail.description',
),
'CType',
'examples',
);

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['examples_haiku_detail'] = 'pages,layout,select_key,recursive';

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['examples_haiku_detail'] = 'pi_flexform';
ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;Configuration,pi_flexform,',
$pluginSignature,
'after:subheader',
);

ExtensionManagementUtility::addPiFlexFormValue(
'examples_haiku_detail',
'*',
'FILE:EXT:examples/Configuration/Flexforms/PluginHaikuDetail.xml',
$pluginSignature,
);
26 changes: 18 additions & 8 deletions Configuration/TCA/Overrides/tt_content_plugin_haiku_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Schema\Struct\SelectItem;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

/*
Expand All @@ -30,21 +31,30 @@

defined('TYPO3') or die();

$pluginSignature = 'examples_haiku_list';

ExtensionManagementUtility::addPlugin(
[
new SelectItem(
'select',
'LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:list.title',
'examples_haiku_list',
$pluginSignature,
'tx_examples-haiku',
],
'list_type',
'plugins',
'LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:list.description',
),
'CType',
'examples',
);

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['examples_haiku_list'] = 'pages,layout,select_key,recursive';

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['examples_haiku_list'] = 'pi_flexform';
ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;Configuration,pi_flexform,',
$pluginSignature,
'after:subheader',
);

ExtensionManagementUtility::addPiFlexFormValue(
'examples_haiku_list',
'*',
'FILE:EXT:examples/Configuration/Flexforms/PluginHaikuList.xml',
$pluginSignature,
);
17 changes: 9 additions & 8 deletions Configuration/TCA/Overrides/tt_content_plugin_htmlparser.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@
$pluginTitle,
);

// $pluginSignature == "examples_htmlparser"

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature]
= 'layout,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature]
= 'pi_flexform';
// Activate the display of the plug-in flexform field and set FlexForm definition
ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;Configuration,pi_flexform,',
$pluginSignature,
'after:subheader',
);

// Configure FlexForm
ExtensionManagementUtility::addPiFlexFormValue(
$pluginSignature,
'*',
'FILE:EXT:examples/Configuration/Flexforms/HtmlParser.xml',
$pluginSignature,
);
30 changes: 19 additions & 11 deletions Configuration/TCA/Overrides/tt_content_plugin_pi1.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,34 @@

defined('TYPO3') or die();

use TYPO3\CMS\Core\Schema\Struct\SelectItem;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

$pluginSignature = 'examples_pi1';
$pluginTitle = 'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.list_type_pi1';
$extensionKey = 'examples';

// Add the plugins to the list of plugins
ExtensionManagementUtility::addPlugin(
[ $pluginTitle, $pluginSignature],
'list_type',
$extensionKey,
new SelectItem(
'select',
'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.examples_pi1',
$pluginSignature,
'',
'plugins',
),
'CType',
'examples',
);

// Disable the display of layout and select_key fields for the plugin
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature]
= 'layout,select_key,pages';

// Activate the display of the plug-in flexform field and set FlexForm definition
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['examples_pi1'] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue(
ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;Configuration,pi_flexform,',
$pluginSignature,
'after:subheader',
);

ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:examples/Configuration/Flexforms/flexform_ds1.xml',
$pluginSignature,
);
48 changes: 48 additions & 0 deletions Configuration/TCA/Overrides/tt_content_plugin_pi2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/*
* 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!
*/

defined('TYPO3') or die();

use TYPO3\CMS\Core\Schema\Struct\SelectItem;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

$pluginSignature = 'examples_pi2';

// Add the plugins to the list of plugins
ExtensionManagementUtility::addPlugin(
new SelectItem(
'select',
'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.examples_pi2',
$pluginSignature,
'',
'plugins',
),
'CType',
'examples',
);

// Activate the display of the plug-in flexform field and set FlexForm definition
ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;Configuration,pi_flexform,',
$pluginSignature,
'after:subheader',
);

ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:examples/Configuration/Flexforms/flexform_ds2.xml',
$pluginSignature,
);
Loading

0 comments on commit 36331f9

Please sign in to comment.