forked from Snck3rs/contao-leaflet-maps
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88927a3de8 | ||
|
|
8fdc7dab29 | ||
|
|
9a1b6dee01 | ||
|
|
9e0f11ec18 | ||
|
|
f60ed1b7be | ||
|
|
3d45f6b2eb | ||
|
|
e73a4d4bdf |
11
.composer-require-checker.json
Normal file
11
.composer-require-checker.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"symbol-whitelist": [
|
||||
"null", "true", "false",
|
||||
"static", "self", "parent",
|
||||
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
|
||||
"array_insert",
|
||||
"Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface",
|
||||
"Contao\\ManagerPlugin\\Bundle\\Config\\BundleConfig",
|
||||
"Contao\\ManagerPlugin\\Bundle\\Parser\\ParserInterface"
|
||||
]
|
||||
}
|
||||
41
CHANGELOG.md
41
CHANGELOG.md
@@ -1,23 +1,38 @@
|
||||
|
||||
Changelog
|
||||
=========
|
||||
# Changelog
|
||||
|
||||
3.0.1 (2018-xx-xx)
|
||||
------------------
|
||||
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.0.3 - 2018-09-18
|
||||
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.2...3.0.3)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Make alias generator services public for Contao 4.6/Symfony 4.0 compatibility.
|
||||
|
||||
## 3.0.2 - 2018-08-23
|
||||
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.1...3.0.2)
|
||||
|
||||
- Run composer require checker and solve issues.
|
||||
|
||||
## 3.0.1 - 2018-06-20
|
||||
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0...3.0.1)
|
||||
|
||||
- Fix broken dynamic bbox related data loading (#57)
|
||||
|
||||
3.0.0 (2018-01-05)
|
||||
------------------
|
||||
## 3.0.0 - 2018-01-05
|
||||
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-beta1...3.0.0)
|
||||
|
||||
- Make hook/dca listener services public
|
||||
|
||||
3.0.0-beta1 (2017-11-15)
|
||||
------------------------
|
||||
## 3.0.0-beta1 - 2017-11-15
|
||||
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha2...3.0.0-beta1)
|
||||
|
||||
@@ -30,15 +45,9 @@ Bugfixes
|
||||
- Broken service definitions
|
||||
- Broken file layer id
|
||||
|
||||
3.0.0-alpha2
|
||||
------------
|
||||
## 3.0.0-alpha1 - 2017-10-19
|
||||
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha2...2.0.0-alpha3)
|
||||
|
||||
3.0.0-alpha1 (2017-10-19)
|
||||
------------------------
|
||||
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha1...2.0.0-alpha2)
|
||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha1...3.0.0-alpha2)
|
||||
|
||||
Implemented enhancements
|
||||
|
||||
|
||||
@@ -23,7 +23,17 @@
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0",
|
||||
"ext-json": "*",
|
||||
"ext-pdo": "*",
|
||||
"contao/core-bundle": "~4.4",
|
||||
"doctrine/dbal": "^2.5",
|
||||
"symfony/config": "~3.3 || ~4.0",
|
||||
"symfony/event-dispatcher": "~3.3 || ~4.0",
|
||||
"symfony/dependency-injection": "~3.3 || ~4.0",
|
||||
"symfony/filesystem": "~3.3 || ~4.0",
|
||||
"symfony/http-kernel": "~3.3 || ~4.0",
|
||||
"symfony/translation": "~3.3 || ~4.0",
|
||||
"symfony/templating": "~3.3 || ~4.0",
|
||||
"netzmacht/contao-leaflet-libraries": "^1.0",
|
||||
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
|
||||
"netzmacht/php-javascript-builder": "^1.0",
|
||||
@@ -35,7 +45,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phpcq/all-tasks": "^1.2",
|
||||
"contao/manager-plugin": "^2.1"
|
||||
"contao/manager-plugin": "^2.1",
|
||||
"phpstan/phpstan": "^0.10.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Backend;
|
||||
|
||||
use Contao\BackendTemplate;
|
||||
|
||||
/**
|
||||
* Credits backend module.
|
||||
*
|
||||
@@ -26,7 +28,7 @@ class About
|
||||
*/
|
||||
public function generate()
|
||||
{
|
||||
$template = new \BackendTemplate('be_leaflet_about');
|
||||
$template = new BackendTemplate('be_leaflet_about');
|
||||
|
||||
$template->headline = 'Leaftlet maps integration for Contao CMS';
|
||||
$template->libraries = $this->getLibraries();
|
||||
@@ -57,9 +59,8 @@ class About
|
||||
|
||||
if ($library['homepage']) {
|
||||
$library['homepage'] = sprintf(
|
||||
'<a href="%s" %s>%s</a>',
|
||||
'<a href="%s" target="_blank">%s</a>',
|
||||
$library['homepage'],
|
||||
LINK_NEW_WINDOW,
|
||||
preg_replace('#^(https?://(www)?)#i', '', $library['homepage'])
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,11 +74,13 @@ services:
|
||||
|
||||
netzmacht.contao_leaflet.definition.alias_generator.factory_default:
|
||||
class: Netzmacht\Contao\Leaflet\Alias\DefaultAliasGeneratorFactory
|
||||
public: true
|
||||
arguments:
|
||||
- '@database_connection'
|
||||
|
||||
netzmacht.contao_leaflet.definition.alias_generator.factory_parent:
|
||||
class: Netzmacht\Contao\Leaflet\Alias\ParentAliasGeneratorFactory
|
||||
public: true
|
||||
arguments:
|
||||
- '@database_connection'
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="http://www.netzmacht.de" <?php echo LINK_NEW_WINDOW; ?>>
|
||||
<a href="http://www.netzmacht.de" target="_blank">
|
||||
<img src="bundles/netzmachtcontaoleaflet/img/logo.png"></a>
|
||||
<p>
|
||||
<strong class="company">netzmacht </strong><br>
|
||||
|
||||
@@ -36,7 +36,7 @@ class BuildDefinitionEvent extends Event
|
||||
/**
|
||||
* The model.
|
||||
*
|
||||
* @var \Model
|
||||
* @var Model
|
||||
*/
|
||||
private $model;
|
||||
|
||||
@@ -74,7 +74,7 @@ class BuildDefinitionEvent extends Event
|
||||
/**
|
||||
* Get the model.
|
||||
*
|
||||
* @return \Model
|
||||
* @return Model
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ use Contao\Database\Result;
|
||||
use Contao\Input;
|
||||
use Contao\Model;
|
||||
use Contao\Model\Collection;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\MapProvider;
|
||||
use Netzmacht\Contao\Leaflet\Model\MapModel;
|
||||
use Netzmacht\Contao\Toolkit\Component\Hybrid\AbstractHybrid;
|
||||
@@ -127,8 +128,8 @@ abstract class AbstractMapHybrid extends AbstractHybrid
|
||||
$data['mapId'] = $mapId;
|
||||
|
||||
$style = '';
|
||||
$height = deserialize($this->get('leaflet_height'), true);
|
||||
$width = deserialize($this->get('leaflet_width'), true);
|
||||
$height = StringUtil::deserialize($this->get('leaflet_height'), true);
|
||||
$width = StringUtil::deserialize($this->get('leaflet_width'), true);
|
||||
|
||||
if (!empty($width['value'])) {
|
||||
$style .= 'width:' . $width['value'] . $width['unit'] . ';';
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Frontend;
|
||||
|
||||
use Contao\Config;
|
||||
use Contao\Frontend;
|
||||
use Netzmacht\Contao\Leaflet\Filter\Filter;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||
|
||||
@@ -72,7 +74,7 @@ class RequestUrl implements \JsonSerializable
|
||||
$query .= '&f=' . $filter->getName() . '&v=' . $filter->toRequest();
|
||||
}
|
||||
|
||||
$url = \Config::get('websitePath') . '/' . \Frontend::addToUrl($query, false);
|
||||
$url = Config::get('websitePath') . '/' . Frontend::addToUrl($query, false);
|
||||
|
||||
return new static($url, $hash, $request);
|
||||
}
|
||||
|
||||
@@ -517,9 +517,9 @@ class LayerDcaListener extends AbstractListener
|
||||
{
|
||||
return sprintf(
|
||||
'<a href="%s" title="%s">%s</a> ',
|
||||
\Backend::addToUrl($href . '&id=' . $row['id']),
|
||||
Backend::addToUrl($href . '&id=' . $row['id']),
|
||||
$title,
|
||||
\Image::getHtml($icon, $label, $attributes)
|
||||
Image::getHtml($icon, $label, $attributes)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
||||
|
||||
use Contao\Controller;
|
||||
use Contao\StringUtil;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Netzmacht\Contao\Leaflet\Model\IconModel;
|
||||
use Netzmacht\Contao\Leaflet\Model\PopupModel;
|
||||
@@ -113,7 +114,7 @@ class MarkerDcaListener
|
||||
'altitude' => null,
|
||||
];
|
||||
|
||||
$values = trimsplit(',', $value);
|
||||
$values = StringUtil::trimsplit(',', $value);
|
||||
$keys = array_keys($combined);
|
||||
$count = count($values);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
||||
|
||||
use Contao\DataContainer;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Toolkit\Dca\Manager;
|
||||
use Netzmacht\LeafletPHP\Value\LatLng;
|
||||
use Symfony\Component\Translation\TranslatorInterface as Translator;
|
||||
@@ -116,7 +117,7 @@ class Validator
|
||||
*/
|
||||
public function validateMultipleCoordinateSets($values, $dataContainer)
|
||||
{
|
||||
$sets = deserialize($values, true);
|
||||
$sets = StringUtil::deserialize($values, true);
|
||||
foreach ($sets as $lines) {
|
||||
$this->validateMultipleCoordinates($lines, $dataContainer);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Netzmacht\Contao\Leaflet\Listener;
|
||||
|
||||
use Contao\FilesModel;
|
||||
use Contao\Model;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\Event\ConvertToGeoJsonEvent;
|
||||
use Netzmacht\Contao\Leaflet\Model\LayerModel;
|
||||
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
|
||||
@@ -117,7 +118,7 @@ final class GeoJsonListener
|
||||
public function enrichObjects(GeoJsonObject $feature, LeafletDefinition $definition, $model)
|
||||
{
|
||||
if (($definition instanceof Marker || $definition instanceof Vector)
|
||||
&& $model instanceof \Model && $feature instanceof Feature) {
|
||||
&& $model instanceof Model && $feature instanceof Feature) {
|
||||
$this->setDataProperty($model, $feature);
|
||||
$this->setBoundsInformation($model, $feature);
|
||||
}
|
||||
@@ -148,7 +149,7 @@ final class GeoJsonListener
|
||||
*/
|
||||
public function setModelData(GeoJsonObject $feature, $model)
|
||||
{
|
||||
if (!$model instanceof \Model || !$feature instanceof Feature
|
||||
if (!$model instanceof Model || !$feature instanceof Feature
|
||||
|| empty($this->featureModelProperties[$model->getTable()])) {
|
||||
return;
|
||||
}
|
||||
@@ -169,12 +170,12 @@ final class GeoJsonListener
|
||||
/**
|
||||
* Parse the model value based on the config.
|
||||
*
|
||||
* @param \Model $model The model.
|
||||
* @param mixed $property The property config.
|
||||
* @param Model $model The model.
|
||||
* @param mixed $property The property config.
|
||||
*
|
||||
* @return array|mixed|null
|
||||
*/
|
||||
private function parseModelValue(\Model $model, &$property)
|
||||
private function parseModelValue(Model $model, &$property)
|
||||
{
|
||||
if (is_array($property)) {
|
||||
list($property, $type) = $property;
|
||||
@@ -183,7 +184,7 @@ final class GeoJsonListener
|
||||
switch ($type) {
|
||||
case 'array':
|
||||
case 'object':
|
||||
$value = deserialize($value, true);
|
||||
$value = StringUtil::deserialize($value, true);
|
||||
break;
|
||||
|
||||
case 'file':
|
||||
@@ -194,7 +195,7 @@ final class GeoJsonListener
|
||||
|
||||
case 'files':
|
||||
$repository = $this->repositoryManager->getRepository(FilesModel::class);
|
||||
$collection = $repository->findMultipleByUuids(deserialize($value, true));
|
||||
$collection = $repository->findMultipleByUuids(StringUtil::deserialize($value, true));
|
||||
|
||||
if ($collection) {
|
||||
$value = $collection->fetchEach('path');
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Listener;
|
||||
|
||||
use Contao\Model;
|
||||
use Netzmacht\Contao\Leaflet\Event\GetHashEvent;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
@@ -46,7 +47,7 @@ class HashSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
$data = $event->getData();
|
||||
|
||||
if ($data instanceof \Model) {
|
||||
if ($data instanceof Model) {
|
||||
$event->setHash($data->getTable() . '::' . $data->{$data->getPk()});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Listener;
|
||||
|
||||
use Contao\File;
|
||||
use Netzmacht\Contao\Leaflet\Encoder\ContaoAssets;
|
||||
use Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
@@ -117,7 +118,7 @@ class LoadAssetsListener
|
||||
// TODO: Cache it.
|
||||
// codingStandardsIgnoreEnd
|
||||
|
||||
$file = new \File('assets/leaflet/js/icons.js');
|
||||
$file = new File('assets/leaflet/js/icons.js');
|
||||
$file->write($buffer);
|
||||
$file->close();
|
||||
|
||||
|
||||
@@ -206,7 +206,10 @@ class MapProvider
|
||||
$model = $this->getModel($mapId);
|
||||
}
|
||||
|
||||
if ($model->cache) {
|
||||
$cacheKey = null;
|
||||
$doCache = $model->cache;
|
||||
|
||||
if ($doCache) {
|
||||
$cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style);
|
||||
|
||||
if ($this->cache->contains($cacheKey)) {
|
||||
@@ -219,7 +222,7 @@ class MapProvider
|
||||
|
||||
$buffer = $this->doGenerate($model, $filter, $elementId, $template, $style);
|
||||
|
||||
if ($model->cache) {
|
||||
if ($doCache) {
|
||||
$this->cache->save(
|
||||
$cacheKey,
|
||||
[
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper\Control;
|
||||
|
||||
use Contao\Model;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||
use Netzmacht\LeafletPHP\Definition;
|
||||
@@ -68,7 +69,7 @@ class AttributionControlMapper extends AbstractControlMapper
|
||||
$parent->setAttributionControl(false);
|
||||
}
|
||||
|
||||
$attributions = deserialize($model->attributions, true);
|
||||
$attributions = StringUtil::deserialize($model->attributions, true);
|
||||
|
||||
foreach ($attributions as $attribution) {
|
||||
$definition->addAttribution($attribution);
|
||||
|
||||
@@ -170,7 +170,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
* @param Model $model The layer model.
|
||||
* @param Request $request Optional building request.
|
||||
*
|
||||
* @return \Model\Collection|null
|
||||
* @return \Contao\Model\Collection|null
|
||||
*/
|
||||
protected function loadMarkerModels(Model $model, Request $request = null)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper\Layer;
|
||||
|
||||
use Contao\Model;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\Definition\Layer\OverpassLayer;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||
@@ -146,7 +147,7 @@ class OverpassLayerMapper extends AbstractLayerMapper
|
||||
*/
|
||||
private function filterAmenityIconsConfig($amenityIconsConfig)
|
||||
{
|
||||
$amenityIconsConfig = deserialize($amenityIconsConfig, true);
|
||||
$amenityIconsConfig = StringUtil::deserialize($amenityIconsConfig, true);
|
||||
$amenityIconsMap = [];
|
||||
|
||||
foreach ($amenityIconsConfig as $config) {
|
||||
|
||||
@@ -188,11 +188,11 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
* Add javascript callbacks.
|
||||
*
|
||||
* @param GeoJson $definition The definition.
|
||||
* @param \Model $model The database model.
|
||||
* @param Model $model The database model.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function addCallbacks(GeoJson $definition, \Model $model)
|
||||
protected function addCallbacks(GeoJson $definition, Model $model)
|
||||
{
|
||||
if ($model->pointToLayer) {
|
||||
$definition->setPointToLayer(new Expression($model->pointToLayer));
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper;
|
||||
|
||||
use Contao\Model;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\Model\ControlModel;
|
||||
use Netzmacht\Contao\Leaflet\Model\MapModel;
|
||||
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
|
||||
@@ -195,7 +196,7 @@ class MapMapper extends AbstractMapper
|
||||
*/
|
||||
private function buildBoundsCalculation(Map $map, MapModel $model)
|
||||
{
|
||||
$adjustBounds = deserialize($model->adjustBounds, true);
|
||||
$adjustBounds = StringUtil::deserialize($model->adjustBounds, true);
|
||||
|
||||
if (in_array('deferred', $adjustBounds)) {
|
||||
$map->setOption('adjustBounds', true);
|
||||
|
||||
@@ -131,7 +131,7 @@ class OptionsBuilder
|
||||
* Build options and conditional options.
|
||||
*
|
||||
* @param Definition $definition The definition being built.
|
||||
* @param \Model $model The model.
|
||||
* @param Model $model The model.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@@ -147,7 +147,7 @@ class OptionsBuilder
|
||||
* Build options.
|
||||
*
|
||||
* @param Definition $definition The definition being built.
|
||||
* @param \Model $model The model.
|
||||
* @param Model $model The model.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -160,11 +160,11 @@ class OptionsBuilder
|
||||
* Build conditional options.
|
||||
*
|
||||
* @param Definition $definition The definition being built.
|
||||
* @param \Model $model The model.
|
||||
* @param Model $model The model.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function buildConditionals($definition, \Model $model)
|
||||
private function buildConditionals($definition, Model $model)
|
||||
{
|
||||
foreach ($this->conditional as $column => $conditions) {
|
||||
foreach ($conditions as $value => $options) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper\Type;
|
||||
|
||||
use Contao\File;
|
||||
use Contao\FilesModel;
|
||||
use Contao\Model;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
@@ -118,7 +119,7 @@ class ImageIconMapper extends AbstractIconMapper
|
||||
if ($file) {
|
||||
$definition->setIconUrl($file->path);
|
||||
|
||||
$file = new \File($file->path);
|
||||
$file = new File($file->path);
|
||||
$definition->setIconSize([$file->width, $file->height]);
|
||||
|
||||
if (!$model->iconAnchor) {
|
||||
@@ -162,7 +163,7 @@ class ImageIconMapper extends AbstractIconMapper
|
||||
if ($file) {
|
||||
$definition->setShadowUrl($file->path);
|
||||
|
||||
$file = new \File($file->path);
|
||||
$file = new File($file->path);
|
||||
$definition->setShadowSize([$file->width, $file->height]);
|
||||
|
||||
if (!$model->shadowAnchor) {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper\UI;
|
||||
|
||||
use Contao\Model;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\AbstractMapper;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||
@@ -76,9 +77,9 @@ class PopupMapper extends AbstractMapper
|
||||
if ($model->autoPan) {
|
||||
$padding = array_map(
|
||||
function ($value) {
|
||||
return array_map('intval', trimsplit(',', $value));
|
||||
return array_map('intval', StringUtil::trimsplit(',', $value));
|
||||
},
|
||||
deserialize($model->autoPanPadding, true)
|
||||
StringUtil::deserialize($model->autoPanPadding, true)
|
||||
);
|
||||
|
||||
if ($padding[0] === $padding[1]) {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper\Vector;
|
||||
|
||||
use Contao\Model;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||
use Netzmacht\LeafletPHP\Definition;
|
||||
@@ -67,7 +68,7 @@ class MultiPolylineMapper extends AbstractVectorMapper
|
||||
*/
|
||||
protected function createLatLngs(Polyline $definition, Model $model)
|
||||
{
|
||||
foreach (deserialize($model->multiData, true) as $ring => $data) {
|
||||
foreach (StringUtil::deserialize($model->multiData, true) as $ring => $data) {
|
||||
$latLngs = array_map(
|
||||
function ($row) {
|
||||
return LatLng::fromString($row);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
namespace Netzmacht\Contao\Leaflet\Mapper\Vector;
|
||||
|
||||
use Contao\Model;
|
||||
use Contao\StringUtil;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\Request;
|
||||
use Netzmacht\LeafletPHP\Definition\Vector\Rectangle;
|
||||
@@ -53,7 +54,7 @@ class RectangleMapper extends AbstractVectorMapper
|
||||
function ($latLng) {
|
||||
return LatLng::fromString($latLng);
|
||||
},
|
||||
deserialize($model->bounds, true)
|
||||
StringUtil::deserialize($model->bounds, true)
|
||||
);
|
||||
|
||||
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Model;
|
||||
|
||||
use Contao\Model;
|
||||
use Contao\Model\Collection;
|
||||
|
||||
/**
|
||||
@@ -19,7 +20,7 @@ use Contao\Model\Collection;
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Model
|
||||
*/
|
||||
abstract class AbstractActiveModel extends \Model
|
||||
abstract class AbstractActiveModel extends Model
|
||||
{
|
||||
/**
|
||||
* Find an active model by its model id.
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Model;
|
||||
|
||||
use Model\Collection;
|
||||
use Contao\Database;
|
||||
use Contao\Model\Collection;
|
||||
|
||||
/**
|
||||
* Class ControlModel for the tl_leaflet_vector table.
|
||||
@@ -42,7 +43,7 @@ LEFT JOIN tl_leaflet_control_layer c ON l.id = c.lid
|
||||
WHERE c.cid=?
|
||||
SQL;
|
||||
|
||||
$result = \Database::getInstance()
|
||||
$result = Database::getInstance()
|
||||
->prepare($query)
|
||||
->execute($this->id);
|
||||
|
||||
@@ -68,7 +69,7 @@ c ON l.id = c.lid
|
||||
WHERE c.cid=? AND l.active=1
|
||||
SQL;
|
||||
|
||||
$result = \Database::getInstance()
|
||||
$result = Database::getInstance()
|
||||
->prepare($query)
|
||||
->execute($this->id);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Model;
|
||||
|
||||
use Model\Collection;
|
||||
use Contao\Model\Collection;
|
||||
|
||||
/**
|
||||
* Class LayerModel for the tl_leaflet_layer table.
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Model;
|
||||
|
||||
use Model\Collection;
|
||||
use Contao\Database;
|
||||
use Contao\Model;
|
||||
use Contao\Model\Collection;
|
||||
|
||||
/**
|
||||
* Class MapModel for the tl_leaflet_map table.
|
||||
@@ -22,7 +24,7 @@ use Model\Collection;
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Model
|
||||
*/
|
||||
class MapModel extends \Model
|
||||
class MapModel extends Model
|
||||
{
|
||||
/**
|
||||
* Model table.
|
||||
@@ -39,7 +41,7 @@ class MapModel extends \Model
|
||||
public function findLayers()
|
||||
{
|
||||
$query = 'SELECT l.* FROM tl_leaflet_layer l LEFT JOIN tl_leaflet_map_layer m ON l.id = m.lid WHERE m.mid=?';
|
||||
$result = \Database::getInstance()
|
||||
$result = Database::getInstance()
|
||||
->prepare($query)
|
||||
->execute($this->id);
|
||||
|
||||
@@ -65,7 +67,7 @@ ON l.id = m.lid
|
||||
WHERE m.mid=? AND l.active=1
|
||||
SQL;
|
||||
|
||||
$result = \Database::getInstance()->prepare($query)->execute($this->id);
|
||||
$result = Database::getInstance()->prepare($query)->execute($this->id);
|
||||
|
||||
if ($result->numRows) {
|
||||
return Collection::createFromDbResult($result, 'tl_leaflet_layer');
|
||||
|
||||
@@ -36,7 +36,7 @@ class MarkerModel extends AbstractActiveModel
|
||||
* @param int $pid The parent id.
|
||||
* @param Filter $filter The filter.
|
||||
*
|
||||
* @return \Model\Collection|null
|
||||
* @return \Contao\Model\Collection|null
|
||||
*/
|
||||
public static function findByFilter($pid, Filter $filter = null)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ class MarkerModel extends AbstractActiveModel
|
||||
* @param int $pid The layer id.
|
||||
* @param BboxFilter $filter The bbox filter.
|
||||
*
|
||||
* @return \Model\Collection|null
|
||||
* @return \Contao\Model\Collection|null
|
||||
*/
|
||||
public static function findByBBoxFilter($pid, BboxFilter $filter)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user