diff --git a/Classes/Updates/ExtcodeContactsCTypeMigration.php b/Classes/Updates/ExtcodeContactsCTypeMigration.php index a17c09b..487010e 100644 --- a/Classes/Updates/ExtcodeContactsCTypeMigration.php +++ b/Classes/Updates/ExtcodeContactsCTypeMigration.php @@ -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 */ 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', ]; } } diff --git a/Configuration/FlexForms/AddressPlugin.xml b/Configuration/FlexForms/AddressPlugin.xml index 0abfdf3..4c770f8 100644 --- a/Configuration/FlexForms/AddressPlugin.xml +++ b/Configuration/FlexForms/AddressPlugin.xml @@ -3,11 +3,10 @@ - Optionen array - + select selectSingle @@ -24,10 +23,11 @@ select + selectSingle + 1 Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout contacts Address - selectSingle diff --git a/Configuration/FlexForms/AddressSearchPlugin.xml b/Configuration/FlexForms/AddressSearchPlugin.xml index 913a4b0..5d15af1 100644 --- a/Configuration/FlexForms/AddressSearchPlugin.xml +++ b/Configuration/FlexForms/AddressSearchPlugin.xml @@ -3,17 +3,17 @@ - Optionen array - + select + selectSingle + 1 Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout contacts AddressSearch - selectSingle diff --git a/Configuration/FlexForms/CompaniesPlugin.xml b/Configuration/FlexForms/CompaniesPlugin.xml index 06a9a3e..3a5cdd0 100644 --- a/Configuration/FlexForms/CompaniesPlugin.xml +++ b/Configuration/FlexForms/CompaniesPlugin.xml @@ -3,30 +3,8 @@ - Optionen array - - - - select - selectSingle - - - - Company->list;Company->show - - - - Company->teaser - - - - @@ -44,23 +22,9 @@ - - - FIELD:switchableControllerActions:=:Company->teaser - - select - selectMultipleSideBySide - tx_contacts_domain_model_company - 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 - 3 - 1 - 99 - - 1 - FIELD:switchableControllerActions:=:Company->list;Company->show select 50 @@ -82,7 +46,6 @@ - FIELD:switchableControllerActions:=:Company->list;Company->show check diff --git a/Configuration/FlexForms/CompanyTeaserPlugin.xml b/Configuration/FlexForms/CompanyTeaserPlugin.xml index 9d576bb..8511768 100644 --- a/Configuration/FlexForms/CompanyTeaserPlugin.xml +++ b/Configuration/FlexForms/CompanyTeaserPlugin.xml @@ -3,7 +3,6 @@ - Optionen array @@ -22,10 +21,11 @@ select + selectSingle + 1 Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout contacts CompanyTeaser - selectSingle diff --git a/Configuration/FlexForms/ContactTeaserPlugin.xml b/Configuration/FlexForms/ContactTeaserPlugin.xml index 6db8b9c..1358fc4 100644 --- a/Configuration/FlexForms/ContactTeaserPlugin.xml +++ b/Configuration/FlexForms/ContactTeaserPlugin.xml @@ -3,7 +3,6 @@ - Optionen array @@ -22,10 +21,11 @@ select + selectSingle + 1 Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout contacts ContactTeaser - selectSingle diff --git a/Configuration/FlexForms/ContactsPlugin.xml b/Configuration/FlexForms/ContactsPlugin.xml index 8353111..aa67a2c 100644 --- a/Configuration/FlexForms/ContactsPlugin.xml +++ b/Configuration/FlexForms/ContactsPlugin.xml @@ -3,27 +3,8 @@ - Optionen array - - - reload - - select - selectSingle - - - - Contact->list;Contact->show - - - - Contact->teaser - - - - @@ -41,23 +22,9 @@ - - - FIELD:switchableControllerActions:=:Contact->teaser - - select - selectMultipleSideBySide - tx_contacts_domain_model_contact - 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 - 3 - 1 - 99 - - 1 - FIELD:switchableControllerActions:=:Contact->list;Contact->show select 50 @@ -78,7 +45,6 @@ - FIELD:switchableControllerActions:=:Contact->list;Contact->show check diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 734718c..9433dd0 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,44 +1,10 @@ Beschreibung + + Configuration + Einstellungen + + diff --git a/Resources/Private/Language/locallang_tca.xlf b/Resources/Private/Language/locallang_tca.xlf index d1bfd75..3dae567 100644 --- a/Resources/Private/Language/locallang_tca.xlf +++ b/Resources/Private/Language/locallang_tca.xlf @@ -22,6 +22,9 @@ Description + + Configuration + diff --git a/ext_localconf.php b/ext_localconf.php index f9a659f..337225a 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -4,108 +4,103 @@ use Extcode\Contacts\Controller\CompanyController; use Extcode\Contacts\Controller\ContactController; use Extcode\Contacts\DataHandler\EvalFloat8; +use Extcode\Contacts\Domain\Model\Dto\ExtensionConfiguration; use Extcode\Contacts\Hooks\DataHandler; -use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility; defined('TYPO3') || die(); -$_LLL_be = 'LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf'; - -ExtensionUtility::configurePlugin( - 'Contacts', - 'Contacts', - [ - ContactController::class => 'list, show, teaser', - ], - [ - ContactController::class => 'list', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'Contacts', - 'ContactTeaser', - [ - ContactController::class => 'teaser', - ], - [ - ContactController::class => '', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'Contacts', - 'Companies', - [ - CompanyController::class => 'list, show, teaser', - ], - [ - CompanyController::class => 'list', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'Contacts', - 'CompanyTeaser', - [ - CompanyController::class => 'teaser', - ], - [ - CompanyController::class => '', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'Contacts', - 'AddressSearch', - [ - AddressController::class => 'search', - ], - [ - AddressController::class => 'search', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -ExtensionUtility::configurePlugin( - 'Contacts', - 'Address', - [ - AddressController::class => 'show', - ], - [ - AddressController::class => '', - ], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT -); - -// register "contacts:" namespace -$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['contacts'][] - = 'Extcode\\Contacts\\ViewHelpers'; - -// clearCachePostProc Hook - -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['contacts_clearcache'] = - DataHandler::class . '->clearCachePostProc'; - -// provide extension configuration for TypoScript -$extensionConfiguration = new ExtensionConfiguration(); -$contactsConfiguration = $extensionConfiguration->get('contacts'); - -ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsApiKey=' . $contactsConfiguration['googleMapsApiKey']); -ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsLibrary=' . $contactsConfiguration['googleMapsLibrary']); - -// register class to be available in 'eval' of TCA -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][EvalFloat8::class] = ''; - -// register layouts -$GLOBALS['TYPO3_CONF_VARS']['EXT']['contacts']['templateLayouts']['address'][] = [$_LLL_be . ':flexforms_template.templateLayout.address.gmaps', 'gmaps']; - -$GLOBALS['TYPO3_CONF_VARS']['EXT']['contacts']['templateLayouts']['contact_teaser'][] = [$_LLL_be . ':flexforms_template.templateLayout.contact_teaser.default', 'default']; -$GLOBALS['TYPO3_CONF_VARS']['EXT']['contacts']['templateLayouts']['company_teaser'][] = [$_LLL_be . ':flexforms_template.templateLayout.company_teaser.default', 'default']; +(static function () { + ExtensionUtility::configurePlugin( + 'Contacts', + 'Contacts', + [ + ContactController::class => 'list, show, teaser', + ], + [ + ContactController::class => 'list', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'Contacts', + 'ContactTeaser', + [ + ContactController::class => 'teaser', + ], + [ + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'Contacts', + 'Companies', + [ + CompanyController::class => 'list, show, teaser', + ], + [ + CompanyController::class => 'list', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'Contacts', + 'CompanyTeaser', + [ + CompanyController::class => 'teaser', + ], + [ + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'Contacts', + 'AddressSearch', + [ + AddressController::class => 'search', + ], + [ + AddressController::class => 'search', + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + ExtensionUtility::configurePlugin( + 'Contacts', + 'Address', + [ + AddressController::class => 'show', + ], + [ + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT + ); + + // register "contacts:" namespace + $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['contacts'][] + = 'Extcode\\Contacts\\ViewHelpers'; + + // clearCachePostProc Hook + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['contacts_clearcache'] = + DataHandler::class . '->clearCachePostProc'; + + // provide extension configuration for TypoScript + $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class); + ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsApiKey=' . $extensionConfiguration->getMapsApiKey()); + ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsLibrary=' . $extensionConfiguration->getMapsApiUrl()); + + // register evaluation class to be available in 'eval' of TCA + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][EvalFloat8::class] = ''; + + // register layouts + $_LLL_be = 'LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf'; + $GLOBALS['TYPO3_CONF_VARS']['EXT']['contacts']['templateLayouts']['address'][] = [$_LLL_be . ':flexforms_template.templateLayout.address.gmaps', 'gmaps']; + $GLOBALS['TYPO3_CONF_VARS']['EXT']['contacts']['templateLayouts']['contact_teaser'][] = [$_LLL_be . ':flexforms_template.templateLayout.contact_teaser.default', 'default']; + $GLOBALS['TYPO3_CONF_VARS']['EXT']['contacts']['templateLayouts']['company_teaser'][] = [$_LLL_be . ':flexforms_template.templateLayout.company_teaser.default', 'default']; +})(); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7ce0d80..f0c20c4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1578,6 +1578,12 @@ parameters: count: 1 path: Classes/ViewHelpers/MetaTagViewHelper.php + - + message: '#^Cannot access offset ''CType'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: Configuration/TCA/Overrides/tt_content.php + - message: '#^Cannot access offset ''columns'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible @@ -1587,7 +1593,19 @@ parameters: - message: '#^Cannot access offset ''config'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible - count: 3 + count: 4 + path: Configuration/TCA/Overrides/tt_content.php + + - + message: '#^Cannot access offset ''contacts'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: Configuration/TCA/Overrides/tt_content.php + + - + message: '#^Cannot access offset ''itemGroups'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 path: Configuration/TCA/Overrides/tt_content.php - @@ -1794,12 +1812,6 @@ parameters: count: 2 path: Configuration/TCA/tx_contacts_domain_model_phone.php - - - message: '#^Binary operation "\." between ''plugin\.tx_contacts…'' and mixed results in an error\.$#' - identifier: binaryOp.invalid - count: 2 - path: ext_localconf.php - - message: '#^Cannot access an offset on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible @@ -1878,18 +1890,6 @@ parameters: count: 1 path: ext_localconf.php - - - message: '#^Cannot access offset ''googleMapsApiKey'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: ext_localconf.php - - - - message: '#^Cannot access offset ''googleMapsLibrary'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: ext_localconf.php - - message: '#^Cannot access offset ''namespaces'' on mixed\.$#' identifier: offsetAccess.nonOffsetAccessible