20 Commits

Author SHA1 Message Date
dependabot[bot]
d5c7a44c07 Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 09:45:36 +00:00
David Molineus
06400f9d1a Merge branch 'support-mm-2-3' 2023-02-20 10:37:20 +01:00
David Molineus
b346efeb0a Update phpcq tools 2023-02-20 10:36:01 +01:00
David Molineus
dd23a1594e Fix coding standard violations 2023-02-20 10:35:00 +01:00
David Molineus
ae800257d8 Do not silence warnings with @ 2023-02-20 10:28:21 +01:00
David Molineus
35e86ec1b9 Remove dependency of doctrine/cache 2023-02-20 09:58:43 +01:00
David Molineus
a2d1ae683d Load after leaflet-libs (See #120) 2023-02-20 09:11:07 +01:00
Stefan Heimes
91ba3ebf04 Correct a misspelled variable name 2023-01-11 12:15:30 +01:00
Stefan Heimes
8ab3cf286c Change the required minimum version of "doctrine/cache"
Remove the version 1.0 'cause of API changes.
2023-01-11 12:10:57 +01:00
Stefan Heimes
ec30f4b4b9 Correct PHP doc and add missing author 2023-01-11 12:10:18 +01:00
Stefan Heimes
fd54d739d7 Code styling 2023-01-11 12:09:58 +01:00
Sven Baumann
44546e4952 Added missing evaluation flags, for save not encoded json in the database 2022-12-10 11:18:57 +01:00
Sven Baumann
9814ed31ad Suppress warnings for undefined array key 2022-12-08 20:02:46 +01:00
Sven Baumann
bfa70d9f21 Fixed issue for deprecated missing return type 2022-12-08 19:40:02 +01:00
Sven Baumann
ff6aae3a6e Allow symfony/templating ^6.2 2022-12-08 19:26:54 +01:00
Stefan Heimes
c4980c481d Update for PHP 8.1 and MetaModels 2.3 2022-11-25 17:53:28 +01:00
Stefan Heimes
d0b9e7cf10 Update for metamodels
- MetaModels need doctrine/cache in the version ^2.1
2022-11-16 16:56:46 +01:00
David Molineus
097cd5c31f Merge pull request #113 from netzmacht/dependabot/npm_and_yarn/copy-props-2.0.5
Bump copy-props from 2.0.4 to 2.0.5
2022-02-22 10:52:33 +01:00
dependabot[bot]
c01610271c Bump copy-props from 2.0.4 to 2.0.5
Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/gulpjs/copy-props/releases)
- [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5)

---
updated-dependencies:
- dependency-name: copy-props
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-22 09:49:57 +00:00
David Molineus
bcb68af234 Merge tag '3.2.3' 2022-02-22 10:49:14 +01:00
16 changed files with 115 additions and 72 deletions

File diff suppressed because one or more lines are too long

View File

@@ -28,7 +28,6 @@
"ext-pdo": "*", "ext-pdo": "*",
"contao-community-alliance/meta-palettes": "^2.0", "contao-community-alliance/meta-palettes": "^2.0",
"contao/core-bundle": "^4.9", "contao/core-bundle": "^4.9",
"doctrine/cache": "^1.0",
"doctrine/dbal": "^2.11 || ^3.0", "doctrine/dbal": "^2.11 || ^3.0",
"menatwork/contao-multicolumnwizard-bundle": "^3.4", "menatwork/contao-multicolumnwizard-bundle": "^3.4",
"netzmacht/contao-leaflet-geocode-widget": "^1.2", "netzmacht/contao-leaflet-geocode-widget": "^1.2",
@@ -37,17 +36,18 @@
"netzmacht/contao-toolkit": "^3.7", "netzmacht/contao-toolkit": "^3.7",
"netzmacht/php-javascript-builder": "^1.0", "netzmacht/php-javascript-builder": "^1.0",
"netzmacht/php-leaflet": "^1.1.0", "netzmacht/php-leaflet": "^1.1.0",
"symfony/config": "~4.4 || ^5.1", "symfony/cache-contracts": "^1.1 || ^2.0",
"symfony/dependency-injection": "~4.4 || ^5.1", "symfony/config": "^4.4 || ^5.1",
"symfony/event-dispatcher": "~4.4 || ^5.1", "symfony/dependency-injection": "^4.4 || ^5.1",
"symfony/event-dispatcher": "^4.4 || ^5.1",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0", "symfony/event-dispatcher-contracts": "^1.1 || ^2.0",
"symfony/filesystem": "~4.4 || ^5.1", "symfony/filesystem": "^4.4 || ^5.1",
"symfony/http-foundation": "~4.4 || ^5.1", "symfony/http-foundation": "^4.4 || ^5.1",
"symfony/http-kernel": "~4.4 || ^5.1", "symfony/http-kernel": "^4.4 || ^5.1",
"symfony/routing": "~4.4 || ^5.1", "symfony/routing": "^4.4 || ^5.1",
"symfony/templating": "~4.4 || ^5.1", "symfony/templating": "^4.4 || ^5.1 || ^6.2",
"symfony/translation-contracts": "^1.1 || ^2.0", "symfony/translation-contracts": "^1.1 || ^2.0",
"symfony/twig-bundle": "~4.4 || ^5.1", "symfony/twig-bundle": "^4.4 || ^5.1",
"twig/twig": "^2.0 || ^3.0" "twig/twig": "^2.0 || ^3.0"
}, },
"require-dev": { "require-dev": {
@@ -68,7 +68,8 @@
"allow-plugins": { "allow-plugins": {
"contao-components/installer": true, "contao-components/installer": true,
"contao/manager-plugin": true, "contao/manager-plugin": true,
"contao-community-alliance/composer-plugin": true "contao-community-alliance/composer-plugin": true,
"php-http/discovery": true
} }
}, },
"extra": { "extra": {

23
package-lock.json generated
View File

@@ -519,12 +519,19 @@
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
}, },
"copy-props": { "copy-props": {
"version": "2.0.4", "version": "2.0.5",
"resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz",
"integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==",
"requires": { "requires": {
"each-props": "^1.3.0", "each-props": "^1.3.2",
"is-plain-object": "^2.0.1" "is-plain-object": "^5.0.0"
},
"dependencies": {
"is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
}
} }
}, },
"core-util-is": { "core-util-is": {
@@ -1658,9 +1665,9 @@
} }
}, },
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }

View File

@@ -39,7 +39,7 @@ phpcq:
# Composer normalize # Composer normalize
- C00543248C87FB13 - C00543248C87FB13
# phpmd # phpmd
- 0F9684B8B16B7AB0 - A4E55EA12C7C085C
tasks: tasks:
fix: fix:

View File

@@ -44,7 +44,8 @@ class Plugin implements BundlePluginInterface, RoutingPluginInterface
[ [
ContaoCoreBundle::class, ContaoCoreBundle::class,
NetzmachtContaoToolkitBundle::class, NetzmachtContaoToolkitBundle::class,
NetzmachtContaoPageContextBundle::class NetzmachtContaoPageContextBundle::class,
'leaflet-libs',
] ]
) )
->setReplace(['leaflet']), ->setReplace(['leaflet']),

View File

@@ -29,12 +29,14 @@ services:
- '%netzmacht.contao_leaflet.filters%' - '%netzmacht.contao_leaflet.filters%'
netzmacht.contao_leaflet.cache.default: netzmacht.contao_leaflet.cache.default:
class: Doctrine\Common\Cache\FilesystemCache class: Symfony\Component\Cache\Adapter\FilesystemAdapter
arguments: arguments:
- 'netzmacht.contao_leaflet'
- 0
- '%netzmacht.contao_leaflet.cache_dir%' - '%netzmacht.contao_leaflet.cache_dir%'
netzmacht.contao_leaflet.cache.debug: netzmacht.contao_leaflet.cache.debug:
class: Doctrine\Common\Cache\ArrayCache class: Symfony\Component\Cache\Adapter\ArrayAdapter
netzmacht.contao_leaflet.frontend.value_filter: netzmacht.contao_leaflet.frontend.value_filter:
class: Netzmacht\Contao\Leaflet\Frontend\ValueFilter class: Netzmacht\Contao\Leaflet\Frontend\ValueFilter

View File

@@ -5,7 +5,8 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
*/ */
@@ -67,7 +68,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'toggle' => [ 'toggle' => [

View File

@@ -5,7 +5,8 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
*/ */
@@ -78,7 +79,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'toggle' => [ 'toggle' => [

View File

@@ -5,7 +5,8 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
*/ */
@@ -112,7 +113,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'toggle' => [ 'toggle' => [

View File

@@ -5,7 +5,9 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @copyright 2014-2022 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
*/ */
@@ -73,7 +75,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'show' => [ 'show' => [
@@ -426,10 +428,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
'exclude' => true, 'exclude' => true,
'inputType' => 'textarea', 'inputType' => 'textarea',
'eval' => [ 'eval' => [
'tl_class' => 'clr lng', 'tl_class' => 'clr lng',
'allowHtml' => true, 'preserveTags' => true,
'style' => 'min-height: 40px;', 'decodeEntities' => true,
'rte' => 'ace|json', 'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
], ],
'sql' => 'text NULL', 'sql' => 'text NULL',
], ],

View File

@@ -5,7 +5,9 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @copyright 2014-2022 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
*/ */
@@ -78,7 +80,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'toggle' => [ 'toggle' => [
@@ -339,9 +341,11 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
'inputType' => 'textarea', 'inputType' => 'textarea',
'eval' => [ 'eval' => [
'tl_class' => 'clr lng', 'tl_class' => 'clr lng',
'allowHtml' => true, 'preserveTags' => true,
'style' => 'min-height: 40px;', 'decodeEntities' => true,
'rte' => 'ace|json', 'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
], ],
'sql' => 'text NULL', 'sql' => 'text NULL',
], ],

View File

@@ -5,7 +5,8 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
*/ */
@@ -78,7 +79,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'toggle' => [ 'toggle' => [

View File

@@ -5,7 +5,8 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
*/ */
@@ -78,7 +79,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'toggle' => [ 'toggle' => [

View File

@@ -5,7 +5,9 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumann <baumann.sv@gmail.com>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @copyright 2014-2022 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
*/ */
@@ -84,7 +86,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['delete'], 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['delete'],
'href' => 'act=delete', 'href' => 'act=delete',
'icon' => 'delete.gif', 'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] 'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '')
. '\'))return false;Backend.getScrollOffset()"', . '\'))return false;Backend.getScrollOffset()"',
], ],
'toggle' => [ 'toggle' => [
@@ -378,10 +380,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
'exclude' => true, 'exclude' => true,
'inputType' => 'textarea', 'inputType' => 'textarea',
'eval' => [ 'eval' => [
'tl_class' => 'clr lng', 'tl_class' => 'clr lng',
'allowHtml' => true, 'preserveTags' => true,
'style' => 'min-height: 40px;', 'decodeEntities' => true,
'rte' => 'ace|json', 'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
], ],
'sql' => 'text NULL', 'sql' => 'text NULL',
], ],

View File

@@ -5,7 +5,8 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @author Sven Baumnn <baumann.sv@gmail.com>
* @copyright 2014-2022 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
*/ */
@@ -15,6 +16,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Frontend\Assets; namespace Netzmacht\Contao\Leaflet\Frontend\Assets;
use Contao\CoreBundle\Framework\ContaoFrameworkInterface as ContaoFramework; use Contao\CoreBundle\Framework\ContaoFrameworkInterface as ContaoFramework;
use Traversable;
/** /**
* Class LibrariesConfiguration. * Class LibrariesConfiguration.
@@ -45,7 +47,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
* *
* @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.Superglobals)
*/ */
public function getIterator() public function getIterator(): Traversable
{ {
$this->framework->initialize(); $this->framework->initialize();
@@ -57,7 +59,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
* *
* @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.Superglobals)
*/ */
public function offsetExists($offset) public function offsetExists($offset): bool
{ {
$this->framework->initialize(); $this->framework->initialize();
@@ -81,7 +83,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
* *
* @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.Superglobals)
*/ */
public function offsetSet($offset, $value) public function offsetSet($offset, $value): void
{ {
$this->framework->initialize(); $this->framework->initialize();
@@ -93,7 +95,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
* *
* @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.Superglobals)
*/ */
public function offsetUnset($offset) public function offsetUnset($offset): void
{ {
$this->framework->initialize(); $this->framework->initialize();

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 Stefan Heimes <stefan_heimes@hotmail.com>
* @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,6 @@
namespace Netzmacht\Contao\Leaflet; namespace Netzmacht\Contao\Leaflet;
use Contao\Input; use Contao\Input;
use Doctrine\Common\Cache\Cache;
use Netzmacht\Contao\Leaflet\Encoder\ContaoAssets; use Netzmacht\Contao\Leaflet\Encoder\ContaoAssets;
use Netzmacht\Contao\Leaflet\Event\GetJavascriptEvent; use Netzmacht\Contao\Leaflet\Event\GetJavascriptEvent;
use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Filter\Filter;
@@ -28,7 +28,9 @@ use Netzmacht\Contao\Toolkit\View\Template\TemplateRenderer;
use Netzmacht\LeafletPHP\Definition\Map; use Netzmacht\LeafletPHP\Definition\Map;
use Netzmacht\LeafletPHP\Leaflet; use Netzmacht\LeafletPHP\Leaflet;
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection; use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
use Symfony\Component\Cache\CacheItem;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
use Symfony\Contracts\Cache\CacheInterface as Cache;
/** /**
* Class MapProvider. * Class MapProvider.
@@ -212,25 +214,29 @@ class MapProvider
if ($doCache) { if ($doCache) {
$cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style); $cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style);
if ($this->cache->contains($cacheKey)) { if ($this->cache->hasItem($cacheKey)) {
$cached = $this->cache->fetch($cacheKey); $cached = $this->cache->getItem($cacheKey);
$this->assets->fromArray($cached['assets']); $cachedData = $cached->get();
$this->assets->fromArray($cachedData['assets']);
return $cached['javascript']; return $cachedData['javascript'];
} else {
$cached = $this->cache->getItem($cacheKey);
} }
} }
$buffer = $this->doGenerate($model, $filter, $elementId, $template, $style); $buffer = $this->doGenerate($model, $filter, $elementId, $template, $style);
if ($doCache) { if ($doCache) {
$this->cache->save( $cached
$cacheKey, ->expiresAfter((int) $model->cacheLifeTime)
[ ->set(
'assets' => $this->assets->toArray(), [
'javascript' => $buffer, 'assets' => $this->assets->toArray(),
], 'javascript' => $buffer,
(int) $model->cacheLifeTime ]
); );
$this->cache->save($cached);
} }
return $buffer; return $buffer;
@@ -270,12 +276,19 @@ class MapProvider
$cacheKey .= '.filter_' . md5($filter->toRequest()); $cacheKey .= '.filter_' . md5($filter->toRequest());
} }
if ($this->cache->contains($cacheKey)) { if ($this->cache->hasItem($cacheKey)) {
return $this->cache->fetch($cacheKey); $cachedItem = $this->cache->getItem($cacheKey);
return $cachedItem->get();
} else {
$cachedItem = $this->cache->getItem($cacheKey);
} }
$collection = $this->mapper->handleGeoJson($model, $request); $collection = $this->mapper->handleGeoJson($model, $request);
$this->cache->save($cacheKey, $collection, $model->cacheLifeTime); $cachedItem
->expiresAfter($model->cacheLifeTime)
->set($collection);
$this->cache->save($cachedItem);
return $collection; return $collection;
} }