-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New release v5.2.20 - Support of TYPO3 v12 & drop support of v11
- Loading branch information
Helmut Hackbarth
authored and
Helmut Hackbarth
committed
May 28, 2023
1 parent
2ea4965
commit 414fc2e
Showing
202 changed files
with
20,312 additions
and
19,733 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,57 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace T3SBS\T3sbootstrap\Backend\EventListener\FlexForm; | ||
|
||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Core\Configuration\Event\AfterFlexFormDataStructureParsedEvent; | ||
use TYPO3\CMS\Core\Utility\ArrayUtility; | ||
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; | ||
use TYPO3\CMS\Core\Core\Environment; | ||
|
||
/* | ||
* This file is part of the TYPO3 extension t3sbootstrap. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
class FlexformEvent | ||
{ | ||
public function __invoke(AfterFlexFormDataStructureParsedEvent $event): void | ||
{ | ||
$extconf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('t3sbootstrap'); | ||
|
||
if (array_key_exists('flexformExtend', $extconf) && $extconf['flexformExtend'] === '1') { | ||
|
||
$dataStructure = $event->getDataStructure(); | ||
$identifier = $event->getIdentifier(); | ||
|
||
$ffPath = '/fileadmin/T3SB/FlexForms/'; | ||
|
||
foreach ( $GLOBALS['TCA']['tt_content']['columns']['tx_t3sbootstrap_flexform']['config']['ds'] as $key=>$flexForm ) { | ||
|
||
$flexForms[$key] = substr($flexForm, 46, -4); | ||
} | ||
|
||
if ( array_key_exists($identifier['dataStructureKey'],$flexForms) ) { | ||
|
||
if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content' | ||
&& $identifier['fieldName'] === 'tx_t3sbootstrap_flexform' && $identifier['dataStructureKey']) { | ||
|
||
$file = Environment::getPublicPath() . $ffPath.$flexForms[$identifier['dataStructureKey']].'.xml'; | ||
if (file_exists($file)) { | ||
$content = @file_get_contents($file); | ||
if ($content) { | ||
$dataStructure['sheets']['extraEntry'] = GeneralUtility::xml2array($content); | ||
|
||
$extraDataStructure['sheets']['extraEntry'] = GeneralUtility::xml2array($content); | ||
ArrayUtility::mergeRecursiveWithOverrule($dataStructure, $extraDataStructure); | ||
} | ||
} | ||
} | ||
|
||
$event->setDataStructure($dataStructure); | ||
} | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
Classes/Backend/EventListener/FlexForm/NewsFlexformEvent.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,30 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace T3SBS\T3sbootstrap\Backend\EventListener\FlexForm; | ||
|
||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Core\Configuration\Event\AfterFlexFormDataStructureParsedEvent; | ||
use TYPO3\CMS\Core\Utility\ArrayUtility; | ||
|
||
class NewsFlexformEvent | ||
{ | ||
public function __invoke(AfterFlexFormDataStructureParsedEvent $event): void | ||
{ | ||
$dataStructure = $event->getDataStructure(); | ||
$identifier = $event->getIdentifier(); | ||
|
||
if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content' | ||
&& ($identifier['dataStructureKey'] === '*,news_pi1' || $identifier['dataStructureKey'] === '*,news_newsliststicky')) { | ||
|
||
$file = GeneralUtility::getFileAbsFileName('EXT:t3sbootstrap/Resources/Private/Extensions/news/Configuration/FlexForms/News.xml'); | ||
$content = @file_get_contents($file); | ||
if ($content) { | ||
$extraDataStructure['sheets']['extraEntry'] = GeneralUtility::xml2array($content); | ||
ArrayUtility::mergeRecursiveWithOverrule($dataStructure, $extraDataStructure); | ||
} | ||
} | ||
|
||
$event->setDataStructure($dataStructure); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
Classes/EventListener/TCA/TcaCompilation.php → ...kend/EventListener/TCA/TcaCompilation.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
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
Oops, something went wrong.