-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from clickstorm/TYPO3-12
Merge in branch Typo3-12
- Loading branch information
Showing
10 changed files
with
62 additions
and
78 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
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
25 changes: 25 additions & 0 deletions
25
Classes/EventListener/FormControllerCreateActionBeforeRenderViewEventListener.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,25 @@ | ||
<?php | ||
|
||
namespace Clickstorm\CsPowermailGdpr\EventListener; | ||
|
||
use Clickstorm\CsPowermailGdpr\Domain\Model\Mail; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use In2code\Powermail\Events\FormControllerCreateActionBeforeRenderViewEvent; | ||
|
||
class FormControllerCreateActionBeforeRenderViewEventListener | ||
{ | ||
public function __invoke(FormControllerCreateActionBeforeRenderViewEvent $event) | ||
{ | ||
$mail = $event->getMail(); | ||
if (!$mail->isTxCspowermailgdprAccepted()) { | ||
$mail->setTxCspowermailgdprAccepted(self::checkParam()); | ||
} | ||
} | ||
|
||
public static function checkParam(): int | ||
{ | ||
$params = GeneralUtility::_GP('tx_powermail_pi1'); | ||
|
||
return $params['field']['tx_cspowermailgdpr_accepted'] ? 1 : 0; | ||
} | ||
} |
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
File renamed without changes.
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
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 |
---|---|---|
|
@@ -8,10 +8,11 @@ | |
'author_email' => '[email protected]', | ||
'author_company' => 'clickstorm GmbH', | ||
'state' => 'beta', | ||
'version' => '3.1.5', | ||
'version' => '4.0.0', | ||
'constraints' => [ | ||
'depends' => [ | ||
'typo3' => '11.5.0-11.5.99' | ||
'typo3' => '', | ||
'powermail' => '' | ||
], | ||
'conflicts' => [ | ||
], | ||
|
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 |
---|---|---|
@@ -1,42 +1,19 @@ | ||
<?php | ||
|
||
defined('TYPO3') || die('Access denied.'); | ||
defined('TYPO3') || die(); | ||
|
||
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */ | ||
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( | ||
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class | ||
); | ||
(function () { | ||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:powermail/Resources/Private/Language/locallang.xlf'][] | ||
= 'EXT:cs_powermail_gdpr/Resources/Private/Language/locallang.xlf'; | ||
|
||
$signalSlotDispatcher->connect( | ||
'In2code\Powermail\Controller\FormController', | ||
'createActionBeforeRenderView', | ||
'Clickstorm\CsPowermailGdpr\Hook\FormController', | ||
'manipulateForm', | ||
false | ||
); | ||
|
||
$signalSlotDispatcher->connect( | ||
'In2code\Powermail\Controller\FormController', | ||
'confirmationActionBeforeRenderView', | ||
'Clickstorm\CsPowermailGdpr\Hook\FormController', | ||
'manipulateFormForConfirmation', | ||
false | ||
); | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:powermail/Resources/Private/Language/locallang.xlf'][] | ||
= 'EXT:cs_powermail_gdpr/Resources/Private/Language/locallang.xlf'; | ||
|
||
// Extend models | ||
$extbaseObjectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class); | ||
$extbaseObjectContainer->registerImplementation( | ||
\In2code\Powermail\Domain\Model\Form::class, | ||
\Clickstorm\CsPowermailGdpr\Domain\Model\Form::class | ||
); | ||
$extbaseObjectContainer->registerImplementation( | ||
\In2code\Powermail\Domain\Model\Mail::class, | ||
\Clickstorm\CsPowermailGdpr\Domain\Model\Mail::class | ||
); | ||
$extbaseObjectContainer->registerImplementation( | ||
\In2code\Powermail\Domain\Factory\FileFactory::class, | ||
\Clickstorm\CsPowermailGdpr\Domain\Factory\FileFactory::class | ||
); | ||
// use XClasses instead of sublcasses | ||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Domain\Model\Mail::class] = [ | ||
'className' => \Clickstorm\CsPowermailGdpr\Domain\Model\Mail::class, | ||
]; | ||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Domain\Model\Form::class] = [ | ||
'className' => \Clickstorm\CsPowermailGdpr\Domain\Model\Form::class, | ||
]; | ||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Domain\Factory\FileFactory::class] = [ | ||
'className' => \Clickstorm\CsPowermailGdpr\Domain\Factory\FileFactory::class, | ||
]; | ||
})(); |