Skip to content

Commit

Permalink
[TASK] remove content defender configuration event
Browse files Browse the repository at this point in the history
  • Loading branch information
achimfritz committed Aug 3, 2024
1 parent 75a3893 commit b01759c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 89 deletions.
71 changes: 0 additions & 71 deletions Classes/Events/ApplyContentDefenderConfigurationEvent.php

This file was deleted.

15 changes: 3 additions & 12 deletions Classes/Tca/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b01759c

Please sign in to comment.