From b01759cfa29da43e302fcd822f4178c5fc819b75 Mon Sep 17 00:00:00 2001 From: Achim Fritz Date: Sat, 3 Aug 2024 16:50:00 +0200 Subject: [PATCH] [TASK] remove content defender configuration event --- ...ApplyContentDefenderConfigurationEvent.php | 71 ------------------- Classes/Tca/Registry.php | 15 +--- README.md | 8 +-- 3 files changed, 5 insertions(+), 89 deletions(-) delete mode 100644 Classes/Events/ApplyContentDefenderConfigurationEvent.php diff --git a/Classes/Events/ApplyContentDefenderConfigurationEvent.php b/Classes/Events/ApplyContentDefenderConfigurationEvent.php deleted file mode 100644 index ef4e9908..00000000 --- a/Classes/Events/ApplyContentDefenderConfigurationEvent.php +++ /dev/null @@ -1,71 +0,0 @@ -cType = $cType; - $this->colPos = $colPos; - $this->allowed = $allowed; - $this->disallowed = $disallowed; - $this->maxItems = $maxItems; - } - - public function getAllowed(): array - { - return $this->allowed; - } - - public function setAllowed(array $allowed): void - { - $this->allowed = $allowed; - } - - public function getDisallowed(): array - { - return $this->disallowed; - } - - public function setDisallowed(array $disallowed): void - { - $this->disallowed = $disallowed; - } - - public function getMaxItems(): int - { - return $this->maxItems; - } - - public function setMaxItems(int $maxItems): void - { - $this->maxItems = $maxItems; - } - - public function getCType(): string - { - return $this->cType; - } - - public function getColPos(): int - { - return $this->colPos; - } -} diff --git a/Classes/Tca/Registry.php b/Classes/Tca/Registry.php index 34ff7c81..f21d781b 100644 --- a/Classes/Tca/Registry.php +++ b/Classes/Tca/Registry.php @@ -12,7 +12,6 @@ * of the License, or any later version. */ -use B13\Container\Events\ApplyContentDefenderConfigurationEvent; use B13\Container\Events\BeforeContainerConfigurationIsAppliedEvent; use TYPO3\CMS\Core\EventDispatcher\EventDispatcher; use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider; @@ -121,17 +120,9 @@ public function getContentDefenderConfiguration(string $cType, int $colPos): arr foreach ($rows as $columns) { foreach ($columns as $column) { if ((int)$column['colPos'] === $colPos) { - $applyContentDefenderConfigurationEvent = new ApplyContentDefenderConfigurationEvent( - $cType, - $colPos, - $column['allowed'] ?? [], - $column['disallowed'] ?? [], - $column['maxitems'] ?? 0 - ); - $this->eventDispatcher->dispatch($applyContentDefenderConfigurationEvent); - $contentDefenderConfiguration['allowed.'] = $applyContentDefenderConfigurationEvent->getAllowed(); - $contentDefenderConfiguration['disallowed.'] = $applyContentDefenderConfigurationEvent->getDisallowed(); - $contentDefenderConfiguration['maxitems'] = $applyContentDefenderConfigurationEvent->getMaxItems(); + $contentDefenderConfiguration['allowed.'] = $column['allowed'] ?? []; + $contentDefenderConfiguration['disallowed.'] = $column['disallowed'] ?? []; + $contentDefenderConfiguration['maxitems'] = $column['maxitems'] ?? 0; return $contentDefenderConfiguration; } } diff --git a/README.md b/README.md index af6b28ec..ed0ca7f4 100644 --- a/README.md +++ b/README.md @@ -169,13 +169,9 @@ With explicit colPos defined use `{children_200|201}` as set in the example abov ### BeforeContainerConfigurationIsAppliedEvent -* change container configuration for 3rd party extensions container +* change container configuration for 3rd party extensions container you have installed * apply same configuration to all or a set of containers (e.g. ``gridTemplate``) - -### ApplyContentDefenderConfigurationEvent - -this allowes you to change content_defender configuration at runtime, usefull for multisite installations -e.g. have different allowed elements on different sites +* **Note** grid and CType cannot be changed ### BeforeContainerPreviewIsRendered