mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-28 19:13:55 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6054def7aa | ||
|
|
86026a473b | ||
|
|
90c4621918 | ||
|
|
e5263a6315 | ||
|
|
515a191a66 | ||
|
|
f2f7e87fd3 | ||
|
|
4198b2b6cd | ||
|
|
fbd1ef81b0 | ||
|
|
92a376a307 | ||
|
|
bf6a1f9db0 | ||
|
|
c523aed70d | ||
|
|
4795767a8b | ||
|
|
c0efdb058e | ||
|
|
a4547ffb17 | ||
|
|
a63c836535 | ||
|
|
711b06c6d3 | ||
|
|
70b7d0ab9c | ||
|
|
ea59841d6e |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
github: [dmolineus]
|
||||
38
CHANGELOG.md
38
CHANGELOG.md
@@ -6,12 +6,39 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [3.1.5] - 2019-08-21
|
||||
## [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
|
||||
|
||||
- Duplicate map layer relations ([#89](https://github.com/netzmacht/contao-leaflet-maps/issues/89))
|
||||
|
||||
## [3.1.6] - 2020-01-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Do not add options which value is `NULL`
|
||||
- Fix button labels ([#83](https://github.com/netzmacht/contao-leaflet-maps/issues/83))
|
||||
- Fix potential security issue of symfony/dependency-injection (https://github.com/advisories/GHSA-pgwj-prpq-jpc2)
|
||||
|
||||
### Changed
|
||||
|
||||
- Use relative path for backend icon ([#82](https://github.com/netzmacht/contao-leaflet-maps/issues/82))
|
||||
|
||||
|
||||
## [3.1.5] - 2019-08-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Use twig directly instead of templating component to restore Contao 4.8
|
||||
|
||||
|
||||
## [3.1.4] - 2019-02-13
|
||||
|
||||
### Fixed
|
||||
@@ -130,7 +157,12 @@ Implemented enhancements
|
||||
- Bypass filesystem cache in debug mode
|
||||
- Changelog added
|
||||
|
||||
[3.1.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.2...3.1.4
|
||||
[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
|
||||
[3.1.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.3...3.1.4
|
||||
[3.1.3]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.2...3.1.3
|
||||
[3.1.1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...3.1.1
|
||||
[3.0.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.3...3.0.4
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
"netzmacht/php-javascript-builder": "^1.0",
|
||||
"netzmacht/php-leaflet": "^1.1.0",
|
||||
"symfony/config": "~3.3 || ~4.0",
|
||||
"symfony/dependency-injection": "~3.3 || ~4.0",
|
||||
"symfony/dependency-injection": "^3.4.26 || ^4.1.12",
|
||||
"symfony/event-dispatcher": "~3.3 || ~4.0",
|
||||
"symfony/filesystem": "~3.3 || ~4.0",
|
||||
"symfony/http-kernel": "~3.3 || ~4.0",
|
||||
@@ -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": {
|
||||
|
||||
919
package-lock.json
generated
919
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
src/Bundle/ConsentBridge/Plugin.php
Normal file
37
src/Bundle/ConsentBridge/Plugin.php
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -138,3 +138,7 @@ services:
|
||||
arguments:
|
||||
- '@twig'
|
||||
- '%kernel.project_dir%'
|
||||
|
||||
Netzmacht\Contao\Leaflet\Bundle\ConsentBridge\Plugin:
|
||||
tags:
|
||||
- { name: hofff_contao_consent_bridge.plugin }
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
|
||||
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
|
||||
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
|
||||
* @filesource
|
||||
@@ -13,7 +14,7 @@
|
||||
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [
|
||||
'type' => ['type', 'headline'],
|
||||
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'],
|
||||
'templates' => [':hide', 'customTpl', 'leaflet_template'],
|
||||
'template' => [':hide', 'customTpl', 'leaflet_template'],
|
||||
'protected' => [':hide', 'protected'],
|
||||
'expert' => [':hide', 'guests', 'cssID', 'space'],
|
||||
'invisible' => [':hide', 'invisible', 'start', 'start'],
|
||||
|
||||
@@ -28,6 +28,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
|
||||
'onsubmit_callback' => [
|
||||
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
||||
],
|
||||
'oncopy_callback' => [
|
||||
['netzmacht.contao_leaflet.listeners.dca.map', 'copyLayerRelations'],
|
||||
],
|
||||
],
|
||||
|
||||
'list' => [
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
|
||||
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
|
||||
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
|
||||
* @filesource
|
||||
@@ -13,7 +14,7 @@
|
||||
$GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = [
|
||||
'type' => ['name', 'type', 'headline'],
|
||||
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'],
|
||||
'templates' => [':hide', 'customTpl'],
|
||||
'template' => [':hide', 'customTpl'],
|
||||
'protected' => [':hide', 'protected'],
|
||||
'expert' => [':hide', 'guests', 'cssID', 'space'],
|
||||
'invisible' => [':hide', 'invisible', 'start', 'start'],
|
||||
|
||||
@@ -58,7 +58,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes']['layer']['1'] = 'Ba
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['0'] = 'Cluster-Icon-Funktion erstellen';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['1'] = 'Diese Funktion wird zum Erstellen des Cluster-Icons benutzt.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['0'] = 'Icons verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['1'] = 'Stile verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['1'] = 'Icon-Stile verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['0'] = 'Karten verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['1'] = 'Leaflet-Karten verwalten.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['markerCluster']['0'] = 'Marker-Cluster';
|
||||
@@ -83,7 +83,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['pasteafter']['1'] = 'Na
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['pasteinto']['1'] = 'In Layer %s einfügen';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['polygonOptions']['0'] = 'Polygon-Optionen';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['0'] = 'Popups verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['1'] = 'Popup-Icons verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['1'] = 'Marker Popups verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['0'] = 'Referenz';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['1'] = 'Wählen Sie den Referenzlayer aus. Ansonsten wird dasselbe JavaScript-Objekt benutzt.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['removeOutsideVisibleBounds']['0'] = 'Entfernen, wenn außerhalb der sichtbaren Begrenzung';
|
||||
|
||||
@@ -35,8 +35,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_popup']['delete']['0'] = 'Popup löschen
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete']['1'] = 'Popup ID %s löschen';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['0'] = 'Popup bearbeiten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['1'] = 'Popup ID %s bearbeiten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['0'] = 'Popups verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['1'] = 'Marker-Popups verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['0'] = 'Icons verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['1'] = 'Marker-Icons verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['0'] = 'Im Sichtfeld behalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['1'] = 'Aktivieren Sie diese Einstellung um ein herausschieben des Popups aus dem sichbaren Bereich zu verhindern.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn']['0'] = 'Layer verwalten';
|
||||
|
||||
@@ -44,7 +44,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_style']['new']['1'] = 'Neuen Stil erstel
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['0'] = 'Linientransparenz';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['1'] = 'Die Transparenz des Striches kann einen Wert zwischen 0 und 1 annehmen.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['0'] = 'Popups verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['1'] = 'Popup-Icons verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['1'] = 'Popup-Stile verwalten';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['show']['0'] = 'Details anzeigen';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['show']['1'] = 'Details des Stils ID %s anzeigen';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['stroke']['0'] = 'Linie ziehen';
|
||||
|
||||
@@ -21,7 +21,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['map'][1] = 'Manage leaflet maps';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][0] = 'Manage icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][1] = 'Manage marker icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][0] = 'Manage popups';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][1] = 'Manage popups icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][1] = 'Manage popups styles';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][0] = 'Manage styles';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][1] = 'Manage vector styles';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['new'][0] = 'Create layer';
|
||||
|
||||
@@ -19,8 +19,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'][0] = 'Manage layers';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'][1] = 'Manage leaflet layers';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][0] = 'Manage styles';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][1] = 'Manage vector styles';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][0] = 'Manage popups';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][1] = 'Manage marker popups';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][0] = 'Manage icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][1] = 'Manage marker icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][0] = 'Create popup';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][1] = 'Create new popup';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit'][0] = 'Edit popup';
|
||||
|
||||
@@ -19,7 +19,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_style']['layersBtn'][1] = 'Manage leaflet layers
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][0] = 'Manage icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][1] = 'Manage marker icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][0] = 'Manage popups';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][1] = 'Manage popups icons';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][1] = 'Manage popups styles';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['new'][0] = 'Create style';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['new'][1] = 'Create new style';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_style']['edit'][0] = 'Edit style';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#tl_navigation .tl_level_1_group .group-leaflet {
|
||||
background: url(/bundles/netzmachtcontaoleaflet/img/leaflet.svg) 3px 2px no-repeat;
|
||||
background: url(../img/leaflet.svg) 3px 2px no-repeat;
|
||||
}
|
||||
|
||||
.tl_help_table a {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -226,4 +226,26 @@ class MapDcaListener extends AbstractListener
|
||||
->asTree()
|
||||
->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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,6 +210,10 @@ class OptionsBuilder
|
||||
foreach ($options as $option => $mapping) {
|
||||
$default = static::getDefaultOption($option, $definition);
|
||||
|
||||
if ($model->$mapping === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($model->$mapping === '1' || $model->$mapping === '') {
|
||||
if (((bool) $model->$mapping) !== $default) {
|
||||
static::applyOption($option, $model->$mapping, $definition);
|
||||
|
||||
Reference in New Issue
Block a user