13 Commits
3.1.6 ... 3.2.1

Author SHA1 Message Date
David Molineus
118bb9a829 Do not append javascript at the body but inject them in the element/module
Consent tools might interrupt the rendering
2020-09-02 07:40:44 +02:00
David Molineus
e49c74c546 Merge tag '3.2.0' into master 2020-08-28 17:19:23 +02:00
David Molineus
6054def7aa Prepare release 2020-08-28 17:19:04 +02:00
David Molineus
86026a473b Add support for hofff/contao-consent-bridge #81 2020-08-28 17:14:33 +02:00
David Molineus
90c4621918 Prepare release 2020-08-28 16:57:52 +02:00
David Molineus
e5263a6315 Copy map layer relations (Fix #89) 2020-08-28 16:56:11 +02:00
David Molineus
515a191a66 Bump npm dependencies and recompile js 2020-08-28 16:46:58 +02:00
David Molineus
f2f7e87fd3 Merge pull request #88 from fritzmg/patch-1
Use template_legend instead of templates_legend
2020-08-10 16:56:58 +02:00
Fritz Michael Gschwantner
4198b2b6cd add author 2020-05-04 09:12:00 +01:00
Fritz Michael Gschwantner
fbd1ef81b0 use template_legend instead of templates_legend 2020-05-03 16:19:16 +01:00
Fritz Michael Gschwantner
92a376a307 use template_legend instead of template_legend 2020-05-03 16:18:33 +01:00
David Molineus
bf6a1f9db0 Add funding information 2020-01-03 09:21:09 +01:00
David Molineus
c523aed70d Merge tag '3.1.6' 2020-01-03 09:09:21 +01:00
14 changed files with 341 additions and 687 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: [dmolineus]

View File

@@ -8,6 +8,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [3.2.1] - 2020-09-02
### Fixed
- Do not append javascript to the body anymore as consent tools might interrupt rendering
## [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
- Duplicate map layer relations ([#89](https://github.com/netzmacht/contao-leaflet-maps/issues/89))
## [3.1.6] - 2020-01-03 ## [3.1.6] - 2020-01-03
### Fixed ### Fixed
@@ -145,7 +163,9 @@ Implemented enhancements
- Bypass filesystem cache in debug mode - Bypass filesystem cache in debug mode
- Changelog added - Changelog added
[Unreleased]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.6...hotfix/3.1.7 [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.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 [3.1.5]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.4...3.1.5
[3.1.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.3...3.1.4 [3.1.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.3...3.1.4

View File

@@ -42,12 +42,16 @@
}, },
"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.2.x-dev",
"dev-develop": "3.2.x-dev", "dev-develop": "3.3.x-dev",
"dev-support/2.x": "2.0.x-dev" "dev-support/2.x": "2.0.x-dev"
}, },
"contao": { "contao": {

919
package-lock.json generated

File diff suppressed because it is too large Load Diff

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 }

View File

@@ -5,6 +5,7 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource * @filesource
@@ -13,7 +14,7 @@
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [ $GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [
'type' => ['type', 'headline'], 'type' => ['type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'], 'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'],
'templates' => [':hide', 'customTpl', 'leaflet_template'], 'template' => [':hide', 'customTpl', 'leaflet_template'],
'protected' => [':hide', 'protected'], 'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'], 'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'], 'invisible' => [':hide', 'invisible', 'start', 'start'],

View File

@@ -28,6 +28,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
'onsubmit_callback' => [ 'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'], ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
], ],
'oncopy_callback' => [
['netzmacht.contao_leaflet.listeners.dca.map', 'copyLayerRelations'],
],
], ],
'list' => [ 'list' => [

View File

@@ -5,6 +5,7 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource * @filesource
@@ -13,7 +14,7 @@
$GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = [ $GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = [
'type' => ['name', 'type', 'headline'], 'type' => ['name', 'type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'], 'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'],
'templates' => [':hide', 'customTpl'], 'template' => [':hide', 'customTpl'],
'protected' => [':hide', 'protected'], 'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'], 'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'], 'invisible' => [':hide', 'invisible', 'start', 'start'],

View File

@@ -9,5 +9,5 @@
</div> </div>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript . '</script>'; ?> <script><?= $this->javascript ?></script>

View File

@@ -9,4 +9,4 @@
</div> </div>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript . '</script>'; ?> <script><?= $this->javascript ?></script>

File diff suppressed because one or more lines are too long

View File

@@ -226,4 +226,26 @@ class MapDcaListener extends AbstractListener
->asTree() ->asTree()
->getOptions(); ->getOptions();
} }
/**
* Copy layer relations if a map is duplicated.
*
* @param string|int $insertId Insert id of the new map.
* @param DataContainer $dataContainer Data container driver.
*
* @return void
*/
public function copyLayerRelations($insertId, DataContainer $dataContainer): void
{
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting');
$statement->bindValue('mid', $dataContainer->id);
$statement->execute();
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
unset($row['id']);
$row['tstamp'] = time();
$row['mid'] = $insertId;
$this->connection->insert('tl_leaflet_map_layer', $row);
}
}
} }