Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions Classes/Updates/ExtcodeContactsCTypeMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,17 @@ public function getDescription(): string
}

/**
* This must return an array containing the "list_type" to "CType" mapping
*
* Example:
*
* [
* 'pi_plugin1' => 'pi_plugin1',
* 'pi_plugin2' => 'new_content_element',
* ]
*
* @return array<string, string>
*/
protected function getListTypeToCTypeMapping(): array
{
return [
// TODO: Add this mapping yourself!
'contacts_address' => 'contacts_address',
'contacts_addressSearch' => 'contacts_addresssearch',
'contacts_companies' => 'contacts_companies',
'contacts_companyTeaser' => 'contacts_companyteaser',
'contacts_contactTeaser' => 'contacts_contactteaser',
'contacts_contacts' => 'contacts_contacts',
];
}
}
6 changes: 3 additions & 3 deletions Configuration/FlexForms/AddressPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
<sheets>
<sDEF>
<ROOT>
<sheetTitle>Optionen</sheetTitle>
<type>array</type>
<el>
<settings.address>
<label>LLL:EXT:dates/Resources/Private/Language/locallang_db.xlf:tx_contacts_domain_model_address</label>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts_domain_model_address</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
Expand All @@ -24,10 +23,11 @@
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:flexforms_template.templateLayout</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<disableNoMatchingValueElement>1</disableNoMatchingValueElement>
<itemsProcFunc>Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout</itemsProcFunc>
<extKey>contacts</extKey>
<pluginName>Address</pluginName>
<renderType>selectSingle</renderType>
</config>
</settings.templateLayout>
</el>
Expand Down
6 changes: 3 additions & 3 deletions Configuration/FlexForms/AddressSearchPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<sheets>
<sDEF>
<ROOT>
<sheetTitle>Optionen</sheetTitle>
<type>array</type>
<el>
<settings.templateLayout>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.addressSearch.settings.templateLayout</label>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:flexforms_template.templateLayout</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<disableNoMatchingValueElement>1</disableNoMatchingValueElement>
<itemsProcFunc>Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout</itemsProcFunc>
<extKey>contacts</extKey>
<pluginName>AddressSearch</pluginName>
<renderType>selectSingle</renderType>
</config>
</settings.templateLayout>
<settings.displayResultList>
Expand Down
37 changes: 0 additions & 37 deletions Configuration/FlexForms/CompaniesPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,8 @@
<sheets>
<sDEF>
<ROOT>
<sheetTitle>Optionen</sheetTitle>
<type>array</type>
<el>
<switchableControllerActions>
<label>Standardaktion des Plugins</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items>
<numIndex index="0">
<label>
LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.companyController.listAction.title
</label>
<value>Company->list;Company->show</value>
</numIndex>
<numIndex index="1">
<label>
LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.companyController.teaserAction.title
</label>
<value>Company->teaser</value>
</numIndex>
</items>
</config>
</switchableControllerActions>
<settings.orderBy>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.companies.action.company.list.orderBy</label>
<config>
Expand All @@ -44,23 +22,9 @@
</items>
</config>
</settings.orderBy>
<settings.companyUids>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts_domain_model_company</label>
<displayCond>FIELD:switchableControllerActions:=:Company->teaser</displayCond>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<foreign_table>tx_contacts_domain_model_company</foreign_table>
<foreign_table_where>AND (tx_contacts_domain_model_company.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_company.sys_language_uid = '-1') AND tx_contacts_domain_model_company.deleted = 0 AND tx_contacts_domain_model_company.hidden = 0</foreign_table_where>
<size>3</size>
<minitems>1</minitems>
<maxitems>99</maxitems>
</config>
</settings.companyUids>
<settings.categoriesList>
<exclude>1</exclude>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.companies.action.company.list.categories</label>
<displayCond>FIELD:switchableControllerActions:=:Company->list;Company->show</displayCond>
<config>
<type>select</type>
<autoSizeMax>50</autoSizeMax>
Expand All @@ -82,7 +46,6 @@
</settings.categoriesList>
<settings.listSubcategories>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.companies.action.company.list.subcategories</label>
<displayCond>FIELD:switchableControllerActions:=:Company->list;Company->show</displayCond>
<config>
<type>check</type>
</config>
Expand Down
4 changes: 2 additions & 2 deletions Configuration/FlexForms/CompanyTeaserPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<sheets>
<sDEF>
<ROOT>
<sheetTitle>Optionen</sheetTitle>
<type>array</type>
<el>
<settings.companyUids>
Expand All @@ -22,10 +21,11 @@
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:flexforms_template.templateLayout</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<disableNoMatchingValueElement>1</disableNoMatchingValueElement>
<itemsProcFunc>Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout</itemsProcFunc>
<extKey>contacts</extKey>
<pluginName>CompanyTeaser</pluginName>
<renderType>selectSingle</renderType>
</config>
</settings.templateLayout>
</el>
Expand Down
4 changes: 2 additions & 2 deletions Configuration/FlexForms/ContactTeaserPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<sheets>
<sDEF>
<ROOT>
<sheetTitle>Optionen</sheetTitle>
<type>array</type>
<el>
<settings.contactUids>
Expand All @@ -22,10 +21,11 @@
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:flexforms_template.templateLayout</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<disableNoMatchingValueElement>1</disableNoMatchingValueElement>
<itemsProcFunc>Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout</itemsProcFunc>
<extKey>contacts</extKey>
<pluginName>ContactTeaser</pluginName>
<renderType>selectSingle</renderType>
</config>
</settings.templateLayout>
</el>
Expand Down
34 changes: 0 additions & 34 deletions Configuration/FlexForms/ContactsPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,8 @@
<sheets>
<sDEF>
<ROOT>
<sheetTitle>Optionen</sheetTitle>
<type>array</type>
<el>
<switchableControllerActions>
<label>Standardaktion des Plugins</label>
<onChange>reload</onChange>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items>
<numIndex index="0">
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.contactController.listAction.title</label>
<value>Contact->list;Contact->show</value>
</numIndex>
<numIndex index="1">
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.contactController.teaserAction.title</label>
<value>Contact->teaser</value>
</numIndex>
</items>
</config>
</switchableControllerActions>
<settings.orderBy>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.contacts.action.contact.list.orderBy</label>
<config>
Expand All @@ -41,23 +22,9 @@
</items>
</config>
</settings.orderBy>
<settings.contactUids>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts_domain_model_contact</label>
<displayCond>FIELD:switchableControllerActions:=:Contact->teaser</displayCond>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<foreign_table>tx_contacts_domain_model_contact</foreign_table>
<foreign_table_where>AND (tx_contacts_domain_model_contact.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_contact.sys_language_uid = '-1') AND tx_contacts_domain_model_contact.deleted = 0 AND tx_contacts_domain_model_contact.hidden = 0</foreign_table_where>
<size>3</size>
<minitems>1</minitems>
<maxitems>99</maxitems>
</config>
</settings.contactUids>
<settings.categoriesList>
<exclude>1</exclude>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.contacts.action.contact.list.categories</label>
<displayCond>FIELD:switchableControllerActions:=:Contact->list;Contact->show</displayCond>
<config>
<type>select</type>
<autoSizeMax>50</autoSizeMax>
Expand All @@ -78,7 +45,6 @@
</settings.categoriesList>
<settings.listSubcategories>
<label>LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.contacts.action.contact.list.subcategories</label>
<displayCond>FIELD:switchableControllerActions:=:Contact->list;Contact->show</displayCond>
<config>
<type>check</type>
</config>
Expand Down
44 changes: 5 additions & 39 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

defined('TYPO3') || die();

call_user_func(function () {
$_LLL_db = 'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf';

$pluginNames = [
'Address',
'AddressSearch',
'Companies',
'CompanyTeaser',
'Contacts',
'ContactTeaser',
];


foreach ($pluginNames as $pluginName) {
$pluginSignature = 'contacts_' . strtolower($pluginName);
ExtensionUtility::registerPlugin(
'Contacts',
$pluginName,
$_LLL_db . ':tx_contacts.plugin.' . lcfirst($pluginName),
'module-contacts',
);
$flexFormPath = 'EXT:contacts/Configuration/FlexForms/' . $pluginName . 'Plugin.xml';
if (file_exists(GeneralUtility::getFileAbsFileName($flexFormPath))) {
ExtensionManagementUtility::addToAllTCAtypes('tt_content', '--div--;Configuration,pi_flexform,', $pluginSignature, 'after:subheader');
ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:' . $flexFormPath,
$pluginSignature
);
}
}
$GLOBALS['TCA']['tt_content']['columns']['CType']['config']['itemGroups']['contacts'] =
'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.module.contacts';

$GLOBALS['TCA']['tt_content']['columns']['tx_contacts_domain_model_address']['config']['type'] = 'passthrough';
$GLOBALS['TCA']['tt_content']['columns']['tx_contacts_domain_model_company']['config']['type'] = 'passthrough';
$GLOBALS['TCA']['tt_content']['columns']['tx_contacts_domain_model_contact']['config']['type'] = 'passthrough';
});
$GLOBALS['TCA']['tt_content']['columns']['tx_contacts_domain_model_address']['config']['type'] = 'passthrough';
$GLOBALS['TCA']['tt_content']['columns']['tx_contacts_domain_model_company']['config']['type'] = 'passthrough';
$GLOBALS['TCA']['tt_content']['columns']['tx_contacts_domain_model_contact']['config']['type'] = 'passthrough';
30 changes: 30 additions & 0 deletions Configuration/TCA/Overrides/tt_content_address.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

(static function () {
$pluginSignature = ExtensionUtility::registerPlugin(
'Contacts',
'Address',
'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.address',
'module-contacts',
'contacts',
'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.address.description',
);

ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;LLL:EXT:contacts/Resources/Private/Language/locallang_tca.xlf:tt_content.div.contacts_configuration,pi_flexform',
$pluginSignature,
'after:subheader'
);

ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:contacts/Configuration/FlexForms/AddressPlugin.xml',
$pluginSignature
);
})();
30 changes: 30 additions & 0 deletions Configuration/TCA/Overrides/tt_content_address_search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

(static function () {
$pluginSignature = ExtensionUtility::registerPlugin(
'Contacts',
'AddressSearch',
'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.addressSearch',
'module-contacts',
'contacts',
'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.addressSearch.description',
);

ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;LLL:EXT:contacts/Resources/Private/Language/locallang_tca.xlf:tt_content.div.contacts_configuration,pi_flexform',
$pluginSignature,
'after:subheader'
);

ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:contacts/Configuration/FlexForms/AddressSearchPlugin.xml',
$pluginSignature
);
})();
30 changes: 30 additions & 0 deletions Configuration/TCA/Overrides/tt_content_companies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

(static function () {
$pluginSignature = ExtensionUtility::registerPlugin(
'Contacts',
'Companies',
'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.companies',
'module-contacts',
'contacts',
'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.companies.description',
);

ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;LLL:EXT:contacts/Resources/Private/Language/locallang_tca.xlf:tt_content.div.contacts_configuration,pi_flexform',
$pluginSignature,
'after:subheader'
);

ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:contacts/Configuration/FlexForms/CompaniesPlugin.xml',
$pluginSignature
);
})();
Loading