diff --git a/CHANGELOG.md b/CHANGELOG.md index aa21a40..24b67d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.2.0] - 2020-08-28 + +### Added + + - Add support for consent tools based on `hofff/contao-consent-bridge` + ## [3.1.7] - 2020-08-28 ### Fixed @@ -151,7 +157,8 @@ Implemented enhancements - Bypass filesystem cache in debug mode - Changelog added -[Unreleased]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.7...hotfix/3.1.8 +[Unreleased]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.2.0...hotfix/3.2.1 +[3.2.0]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.7...3.2.0 [3.1.7]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.6...3.1.7 [3.1.6]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.5...3.1.6 [3.1.5]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.4...3.1.5 diff --git a/composer.json b/composer.json index 3ab278f..07af2f6 100644 --- a/composer.json +++ b/composer.json @@ -42,12 +42,16 @@ }, "require-dev": { "contao/manager-plugin": "^2.1", + "hofff/contao-consent-bridge": "^1.0", "phpcq/all-tasks": "^1.2" }, + "conflict": { + "hofff/contao-consent-bridge": "<1.0 || >= 2.0" + }, "extra": { "branch-alias": { - "dev-master": "3.1.x-dev", - "dev-develop": "3.2.x-dev", + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev", "dev-support/2.x": "2.0.x-dev" }, "contao": { diff --git a/src/Bundle/ConsentBridge/Plugin.php b/src/Bundle/ConsentBridge/Plugin.php new file mode 100644 index 0000000..9fe9c32 --- /dev/null +++ b/src/Bundle/ConsentBridge/Plugin.php @@ -0,0 +1,37 @@ + + * @copyright 2014-2017 netzmacht David Molineus. All rights reserved. + * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE + * @filesource + */ + +declare(strict_types=1); + +namespace Netzmacht\Contao\Leaflet\Bundle\ConsentBridge; + +use Hofff\Contao\Consent\Bridge\Bridge; +use Hofff\Contao\Consent\Bridge\Plugin as ConsentBridgePlugin; +use Hofff\Contao\Consent\Bridge\Render\RenderInformation; + +/** + * Consent Bridge plugin for leaflet. + */ +final class Plugin implements ConsentBridgePlugin +{ + /** + * {@inheritDoc} + */ + public function load(Bridge $bridge): void + { + $renderInformation = RenderInformation::autoRenderWithPlaceholder('leaflet_consent_bridge_placeholder'); + + $bridge + ->supportContentElement('leaflet', $renderInformation) + ->supportFrontendModule('leaflet', $renderInformation); + } +} diff --git a/src/Bundle/Resources/config/services.yml b/src/Bundle/Resources/config/services.yml index 5052736..05d9769 100644 --- a/src/Bundle/Resources/config/services.yml +++ b/src/Bundle/Resources/config/services.yml @@ -138,3 +138,7 @@ services: arguments: - '@twig' - '%kernel.project_dir%' + + Netzmacht\Contao\Leaflet\Bundle\ConsentBridge\Plugin: + tags: + - { name: hofff_contao_consent_bridge.plugin } \ No newline at end of file diff --git a/src/Bundle/Resources/contao/templates/leaflet_consent_bridge_placeholder.html5 b/src/Bundle/Resources/contao/templates/leaflet_consent_bridge_placeholder.html5 new file mode 100644 index 0000000..e69de29