Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
616186ed07 Bump decode-uri-component from 0.2.0 to 0.2.2
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 15:26:21 +00:00
17 changed files with 69 additions and 114 deletions

File diff suppressed because one or more lines are too long

View File

@@ -8,14 +8,6 @@ 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

View File

@@ -28,6 +28,7 @@
"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",
@@ -36,18 +37,17 @@
"netzmacht/contao-toolkit": "^3.7",
"netzmacht/php-javascript-builder": "^1.0",
"netzmacht/php-leaflet": "^1.1.0",
"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/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 || ^6.2",
"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/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,8 +68,7 @@
"allow-plugins": {
"contao-components/installer": true,
"contao/manager-plugin": true,
"contao-community-alliance/composer-plugin": true,
"php-http/discovery": true
"contao-community-alliance/composer-plugin": true
}
},
"extra": {

6
package-lock.json generated
View File

@@ -562,9 +562,9 @@
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
},
"decode-uri-component": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
"integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ=="
},
"default-compare": {
"version": "1.0.0",

View File

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

View File

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

View File

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

View File

@@ -5,8 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -68,7 +67,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' => [

View File

@@ -5,8 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -79,7 +78,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' => [

View File

@@ -5,8 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -113,7 +112,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' => [

View File

@@ -5,9 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -75,7 +73,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' => [
@@ -428,12 +426,10 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'tl_class' => 'clr lng',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
'tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
],
'sql' => 'text NULL',
],

View File

@@ -5,9 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -80,7 +78,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' => [
@@ -341,11 +339,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
'inputType' => 'textarea',
'eval' => [
'tl_class' => 'clr lng',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
],
'sql' => 'text NULL',
],

View File

@@ -5,8 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -79,7 +78,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' => [

View File

@@ -5,8 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -79,7 +78,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' => [

View File

@@ -5,9 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @copyright 2014-2022 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
* @filesource
*/
@@ -86,7 +84,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' => [
@@ -380,12 +378,10 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'tl_class' => 'clr lng',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
'tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
],
'sql' => 'text NULL',
],

View File

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

View File

@@ -5,7 +5,6 @@
*
* @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
@@ -14,6 +13,7 @@
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,10 +28,7 @@ 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.
@@ -215,29 +212,25 @@ class MapProvider
if ($doCache) {
$cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style);
if ($this->cache->hasItem($cacheKey)) {
$cached = $this->cache->getItem($cacheKey);
$cachedData = $cached->get();
$this->assets->fromArray($cachedData['assets']);
if ($this->cache->contains($cacheKey)) {
$cached = $this->cache->fetch($cacheKey);
$this->assets->fromArray($cached['assets']);
return $cachedData['javascript'];
} else {
$cached = $this->cache->getItem($cacheKey);
return $cached['javascript'];
}
}
$buffer = $this->doGenerate($model, $filter, $elementId, $template, $style);
if ($doCache) {
$cached
->expiresAfter((int) $model->cacheLifeTime)
->set(
[
'assets' => $this->assets->toArray(),
'javascript' => $buffer,
]
);
$this->cache->save($cached);
$this->cache->save(
$cacheKey,
[
'assets' => $this->assets->toArray(),
'javascript' => $buffer,
],
(int) $model->cacheLifeTime
);
}
return $buffer;
@@ -277,19 +270,12 @@ class MapProvider
$cacheKey .= '.filter_' . md5($filter->toRequest());
}
if ($this->cache->hasItem($cacheKey)) {
$cachedItem = $this->cache->getItem($cacheKey);
return $cachedItem->get();
} else {
$cachedItem = $this->cache->getItem($cacheKey);
if ($this->cache->contains($cacheKey)) {
return $this->cache->fetch($cacheKey);
}
$collection = $this->mapper->handleGeoJson($model, $request);
$cachedItem
->expiresAfter($model->cacheLifeTime)
->set($collection);
$this->cache->save($cachedItem);
$this->cache->save($cacheKey, $collection, $model->cacheLifeTime);
return $collection;
}
@@ -400,8 +386,8 @@ class MapProvider
$content = $this->templateRenderer->render($templateReference, $parameters);
$content = preg_replace(
['/^(\s*)<!-- TEMPLATE \(?START\)?: .+ -->\n*/', '/\n*<!-- TEMPLATE \(?END\)?: .+ -->$/'],
['$1', ''],
['/^<!-- TEMPLATE (START): .+ -->\n*/', '/\n*<!-- TEMPLATE (END): .+ -->$/'],
'',
$content
);