mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-28 11:04:08 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d47186d26 | ||
|
|
512ecef899 | ||
|
|
06400f9d1a | ||
|
|
b346efeb0a | ||
|
|
dd23a1594e | ||
|
|
ae800257d8 | ||
|
|
35e86ec1b9 | ||
|
|
a2d1ae683d | ||
|
|
91ba3ebf04 | ||
|
|
8ab3cf286c | ||
|
|
ec30f4b4b9 | ||
|
|
fd54d739d7 | ||
|
|
44546e4952 | ||
|
|
9814ed31ad | ||
|
|
bfa70d9f21 | ||
|
|
ff6aae3a6e | ||
|
|
c4980c481d | ||
|
|
d0b9e7cf10 | ||
|
|
097cd5c31f | ||
|
|
c01610271c | ||
|
|
bcb68af234 |
File diff suppressed because one or more lines are too long
@@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [3.2.4] - 2023-02-20
|
||||
|
||||
### Fixed
|
||||
|
||||
- Load after `netzmacht-contao-leaflet-libraries` ([#116](https://github.com/netzmacht/contao-leaflet-maps/pull/116, [#120](https://github.com/netzmacht/contao-leaflet-maps/pull/120, [#121](https://github.com/netzmacht/contao-leaflet-maps/issues/121), [#122](https://github.com/netzmacht/contao-leaflet-maps/issues/122))
|
||||
- Do not use `doctrine/cache` anymore ([#118](https://github.com/netzmacht/contao-leaflet-maps/pull/118))
|
||||
- Fix issues of js generation in debug mode ([#114](https://github.com/netzmacht/contao-leaflet-maps/issues/114))
|
||||
|
||||
## [3.2.3] - 2022-02-22
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
"ext-pdo": "*",
|
||||
"contao-community-alliance/meta-palettes": "^2.0",
|
||||
"contao/core-bundle": "^4.9",
|
||||
"doctrine/cache": "^1.0",
|
||||
"doctrine/dbal": "^2.11 || ^3.0",
|
||||
"menatwork/contao-multicolumnwizard-bundle": "^3.4",
|
||||
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
|
||||
@@ -37,17 +36,18 @@
|
||||
"netzmacht/contao-toolkit": "^3.7",
|
||||
"netzmacht/php-javascript-builder": "^1.0",
|
||||
"netzmacht/php-leaflet": "^1.1.0",
|
||||
"symfony/config": "~4.4 || ^5.1",
|
||||
"symfony/dependency-injection": "~4.4 || ^5.1",
|
||||
"symfony/event-dispatcher": "~4.4 || ^5.1",
|
||||
"symfony/cache-contracts": "^1.1 || ^2.0",
|
||||
"symfony/config": "^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/filesystem": "~4.4 || ^5.1",
|
||||
"symfony/http-foundation": "~4.4 || ^5.1",
|
||||
"symfony/http-kernel": "~4.4 || ^5.1",
|
||||
"symfony/routing": "~4.4 || ^5.1",
|
||||
"symfony/templating": "~4.4 || ^5.1",
|
||||
"symfony/filesystem": "^4.4 || ^5.1",
|
||||
"symfony/http-foundation": "^4.4 || ^5.1",
|
||||
"symfony/http-kernel": "^4.4 || ^5.1",
|
||||
"symfony/routing": "^4.4 || ^5.1",
|
||||
"symfony/templating": "^4.4 || ^5.1 || ^6.2",
|
||||
"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"
|
||||
},
|
||||
"require-dev": {
|
||||
@@ -68,7 +68,8 @@
|
||||
"allow-plugins": {
|
||||
"contao-components/installer": true,
|
||||
"contao/manager-plugin": true,
|
||||
"contao-community-alliance/composer-plugin": true
|
||||
"contao-community-alliance/composer-plugin": true,
|
||||
"php-http/discovery": true
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
|
||||
17
package-lock.json
generated
17
package-lock.json
generated
@@ -519,12 +519,19 @@
|
||||
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
|
||||
},
|
||||
"copy-props": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz",
|
||||
"integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==",
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz",
|
||||
"integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==",
|
||||
"requires": {
|
||||
"each-props": "^1.3.0",
|
||||
"is-plain-object": "^2.0.1"
|
||||
"each-props": "^1.3.2",
|
||||
"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": {
|
||||
|
||||
@@ -39,7 +39,7 @@ phpcq:
|
||||
# Composer normalize
|
||||
- C00543248C87FB13
|
||||
# phpmd
|
||||
- 0F9684B8B16B7AB0
|
||||
- A4E55EA12C7C085C
|
||||
|
||||
tasks:
|
||||
fix:
|
||||
|
||||
@@ -44,7 +44,8 @@ class Plugin implements BundlePluginInterface, RoutingPluginInterface
|
||||
[
|
||||
ContaoCoreBundle::class,
|
||||
NetzmachtContaoToolkitBundle::class,
|
||||
NetzmachtContaoPageContextBundle::class
|
||||
NetzmachtContaoPageContextBundle::class,
|
||||
'leaflet-libs',
|
||||
]
|
||||
)
|
||||
->setReplace(['leaflet']),
|
||||
|
||||
@@ -29,12 +29,14 @@ services:
|
||||
- '%netzmacht.contao_leaflet.filters%'
|
||||
|
||||
netzmacht.contao_leaflet.cache.default:
|
||||
class: Doctrine\Common\Cache\FilesystemCache
|
||||
class: Symfony\Component\Cache\Adapter\FilesystemAdapter
|
||||
arguments:
|
||||
- 'netzmacht.contao_leaflet'
|
||||
- 0
|
||||
- '%netzmacht.contao_leaflet.cache_dir%'
|
||||
|
||||
netzmacht.contao_leaflet.cache.debug:
|
||||
class: Doctrine\Common\Cache\ArrayCache
|
||||
class: Symfony\Component\Cache\Adapter\ArrayAdapter
|
||||
|
||||
netzmacht.contao_leaflet.frontend.value_filter:
|
||||
class: Netzmacht\Contao\Leaflet\Frontend\ValueFilter
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -67,7 +68,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'toggle' => [
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -78,7 +79,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'toggle' => [
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -112,7 +113,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'toggle' => [
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -73,7 +75,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'show' => [
|
||||
@@ -426,10 +428,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
|
||||
'exclude' => true,
|
||||
'inputType' => 'textarea',
|
||||
'eval' => [
|
||||
'tl_class' => 'clr lng',
|
||||
'allowHtml' => true,
|
||||
'style' => 'min-height: 40px;',
|
||||
'rte' => 'ace|json',
|
||||
'tl_class' => 'clr lng',
|
||||
'preserveTags' => true,
|
||||
'decodeEntities' => true,
|
||||
'allowHtml' => true,
|
||||
'style' => 'min-height: 40px;',
|
||||
'rte' => 'ace|json',
|
||||
],
|
||||
'sql' => 'text NULL',
|
||||
],
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -78,7 +80,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'toggle' => [
|
||||
@@ -339,9 +341,11 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
|
||||
'inputType' => 'textarea',
|
||||
'eval' => [
|
||||
'tl_class' => 'clr lng',
|
||||
'allowHtml' => true,
|
||||
'style' => 'min-height: 40px;',
|
||||
'rte' => 'ace|json',
|
||||
'preserveTags' => true,
|
||||
'decodeEntities' => true,
|
||||
'allowHtml' => true,
|
||||
'style' => 'min-height: 40px;',
|
||||
'rte' => 'ace|json',
|
||||
],
|
||||
'sql' => 'text NULL',
|
||||
],
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -78,7 +79,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'toggle' => [
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -78,7 +79,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'toggle' => [
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -84,7 +86,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['delete'],
|
||||
'href' => 'act=delete',
|
||||
'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()"',
|
||||
],
|
||||
'toggle' => [
|
||||
@@ -378,10 +380,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
|
||||
'exclude' => true,
|
||||
'inputType' => 'textarea',
|
||||
'eval' => [
|
||||
'tl_class' => 'clr lng',
|
||||
'allowHtml' => true,
|
||||
'style' => 'min-height: 40px;',
|
||||
'rte' => 'ace|json',
|
||||
'tl_class' => 'clr lng',
|
||||
'preserveTags' => true,
|
||||
'decodeEntities' => true,
|
||||
'allowHtml' => true,
|
||||
'style' => 'min-height: 40px;',
|
||||
'rte' => 'ace|json',
|
||||
],
|
||||
'sql' => 'text NULL',
|
||||
],
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @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
|
||||
* @filesource
|
||||
*/
|
||||
@@ -15,6 +16,7 @@ declare(strict_types=1);
|
||||
namespace Netzmacht\Contao\Leaflet\Frontend\Assets;
|
||||
|
||||
use Contao\CoreBundle\Framework\ContaoFrameworkInterface as ContaoFramework;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
* Class LibrariesConfiguration.
|
||||
@@ -45,7 +47,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.Superglobals)
|
||||
*/
|
||||
public function getIterator()
|
||||
public function getIterator(): Traversable
|
||||
{
|
||||
$this->framework->initialize();
|
||||
|
||||
@@ -57,7 +59,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.Superglobals)
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
$this->framework->initialize();
|
||||
|
||||
@@ -81,7 +83,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.Superglobals)
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
$this->framework->initialize();
|
||||
|
||||
@@ -93,7 +95,7 @@ class LibrariesConfiguration implements \IteratorAggregate, \ArrayAccess
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.Superglobals)
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
$this->framework->initialize();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @author Stefan Heimes <stefan_heimes@hotmail.com>
|
||||
* @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,6 @@
|
||||
namespace Netzmacht\Contao\Leaflet;
|
||||
|
||||
use Contao\Input;
|
||||
use Doctrine\Common\Cache\Cache;
|
||||
use Netzmacht\Contao\Leaflet\Encoder\ContaoAssets;
|
||||
use Netzmacht\Contao\Leaflet\Event\GetJavascriptEvent;
|
||||
use Netzmacht\Contao\Leaflet\Filter\Filter;
|
||||
@@ -28,7 +28,10 @@ use Netzmacht\Contao\Toolkit\View\Template\TemplateRenderer;
|
||||
use Netzmacht\LeafletPHP\Definition\Map;
|
||||
use Netzmacht\LeafletPHP\Leaflet;
|
||||
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
|
||||
use Symfony\Component\Cache\CacheItem;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
|
||||
use Symfony\Contracts\Cache\CacheInterface as Cache;
|
||||
use function dd;
|
||||
|
||||
/**
|
||||
* Class MapProvider.
|
||||
@@ -212,25 +215,29 @@ class MapProvider
|
||||
if ($doCache) {
|
||||
$cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style);
|
||||
|
||||
if ($this->cache->contains($cacheKey)) {
|
||||
$cached = $this->cache->fetch($cacheKey);
|
||||
$this->assets->fromArray($cached['assets']);
|
||||
if ($this->cache->hasItem($cacheKey)) {
|
||||
$cached = $this->cache->getItem($cacheKey);
|
||||
$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);
|
||||
|
||||
if ($doCache) {
|
||||
$this->cache->save(
|
||||
$cacheKey,
|
||||
[
|
||||
'assets' => $this->assets->toArray(),
|
||||
'javascript' => $buffer,
|
||||
],
|
||||
(int) $model->cacheLifeTime
|
||||
);
|
||||
$cached
|
||||
->expiresAfter((int) $model->cacheLifeTime)
|
||||
->set(
|
||||
[
|
||||
'assets' => $this->assets->toArray(),
|
||||
'javascript' => $buffer,
|
||||
]
|
||||
);
|
||||
$this->cache->save($cached);
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
@@ -270,12 +277,19 @@ class MapProvider
|
||||
$cacheKey .= '.filter_' . md5($filter->toRequest());
|
||||
}
|
||||
|
||||
if ($this->cache->contains($cacheKey)) {
|
||||
return $this->cache->fetch($cacheKey);
|
||||
if ($this->cache->hasItem($cacheKey)) {
|
||||
$cachedItem = $this->cache->getItem($cacheKey);
|
||||
|
||||
return $cachedItem->get();
|
||||
} else {
|
||||
$cachedItem = $this->cache->getItem($cacheKey);
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
@@ -386,8 +400,8 @@ class MapProvider
|
||||
|
||||
$content = $this->templateRenderer->render($templateReference, $parameters);
|
||||
$content = preg_replace(
|
||||
['/^<!-- TEMPLATE (START): .+ -->\n*/', '/\n*<!-- TEMPLATE (END): .+ -->$/'],
|
||||
'',
|
||||
['/^(\s*)<!-- TEMPLATE \(?START\)?: .+ -->\n*/', '/\n*<!-- TEMPLATE \(?END\)?: .+ -->$/'],
|
||||
['$1', ''],
|
||||
$content
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user