-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #708 - Fix custom TimeTable registration for TYPO3 v12
- Loading branch information
1 parent
e1cca0b
commit 7af2244
Showing
4 changed files
with
58 additions
and
6 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
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
49 changes: 49 additions & 0 deletions
49
Configuration/TCA/Overrides/tx_calendarize_domain_model_configuration.php
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,49 @@ | ||
<?php | ||
|
||
use HDNET\Calendarize\Domain\Model\Configuration; | ||
use HDNET\Calendarize\Service\SecondaryTimeTableService; | ||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
$flexForms = []; | ||
|
||
/** @var SecondaryTimeTableService $secondaryTimeTableService */ | ||
$secondaryTimeTableService = GeneralUtility::makeInstance(SecondaryTimeTableService::class); | ||
$services = $secondaryTimeTableService->getSecondaryTimeTables(); | ||
|
||
if (!empty($services)) { | ||
ExtensionManagementUtility::addTcaSelectItemGroup( | ||
'tx_calendarize_domain_model_configuration', | ||
'type', | ||
'secondary', | ||
'Secondary' | ||
); | ||
foreach ($services as $service) { | ||
$timeTable = [ | ||
'label' => $service->getLabel(), | ||
'value' => $service->getIdentifier(), | ||
'group' => 'secondary', | ||
]; | ||
$flexForms[$service->getIdentifier()] = $service->getFlexForm(); | ||
ExtensionManagementUtility::addTcaSelectItem( | ||
'tx_calendarize_domain_model_configuration', | ||
'type', | ||
$timeTable | ||
); | ||
$GLOBALS['TCA']['tx_calendarize_domain_model_configuration']['ctrl']['typeicon_classes'][$service->getIdentifier()] = 'apps-calendarize-type-' . Configuration::TYPE_TIME; | ||
$GLOBALS['TCA']['tx_calendarize_domain_model_configuration']['types'][$service->getIdentifier()]['showitem'] = $service->getTcaServiceTypeFields(); | ||
} | ||
} | ||
ExtensionManagementUtility::addTCAcolumns( | ||
'tx_calendarize_domain_model_configuration', | ||
[ | ||
'flex_form' => [ | ||
'label' => 'LLL:EXT:calendarize/Resources/Private/Language/locallang.xlf:tx_calendarize_domain_model_configuration.flex_form', | ||
'config' => [ | ||
'type' => 'flex', | ||
'ds_pointerField' => 'type', | ||
'ds' => $flexForms, | ||
], | ||
], | ||
] | ||
); |
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