Add support for hofff/contao-consent-bridge #81

This commit is contained in:
David Molineus
2020-08-28 17:14:33 +02:00
parent 90c4621918
commit 86026a473b
4 changed files with 45 additions and 0 deletions

View File

@@ -42,8 +42,12 @@
}, },
"require-dev": { "require-dev": {
"contao/manager-plugin": "^2.1", "contao/manager-plugin": "^2.1",
"hofff/contao-consent-bridge": "^1.0",
"phpcq/all-tasks": "^1.2" "phpcq/all-tasks": "^1.2"
}, },
"conflict": {
"hofff/contao-consent-bridge": "<1.0 || >= 2.0"
},
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.1.x-dev", "dev-master": "3.1.x-dev",

View File

@@ -0,0 +1,37 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @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);
}
}

View File

@@ -138,3 +138,7 @@ services:
arguments: arguments:
- '@twig' - '@twig'
- '%kernel.project_dir%' - '%kernel.project_dir%'
Netzmacht\Contao\Leaflet\Bundle\ConsentBridge\Plugin:
tags:
- { name: hofff_contao_consent_bridge.plugin }