31 Commits
3.2.1 ... 3.2.3

Author SHA1 Message Date
David Molineus
0e491fcc6a Prepare release 3.2.3 2022-02-22 10:47:32 +01:00
David Molineus
ea293e327f Fix access of sub layers (#97) 2022-02-22 10:30:08 +01:00
David Molineus
18f1cb5756 Load language file for the help wizard (#99) 2022-02-22 10:11:41 +01:00
David Molineus
e38e926891 Avoid array index warning 2022-02-22 10:10:57 +01:00
David Molineus
700a87bd1f Drop leftover phpcq v1 files 2022-02-22 09:53:52 +01:00
David Molineus
94ecdf9d42 Show group icon (#101) 2022-02-22 09:53:41 +01:00
David Molineus
9434302a16 Use symfony translation contracts 2022-02-22 09:52:12 +01:00
David Molineus
b79a75ac21 Update supported providers 2022-02-22 08:42:54 +01:00
David Molineus
d498903645 Fix overlapping of fields (#107) 2022-02-22 08:33:50 +01:00
David Molineus
c544202ca8 Fix applying bounds to a tile layer (Closes #109) 2022-02-22 08:30:32 +01:00
David Molineus
93f176a738 Silence info of contao/components-installer 2022-02-21 20:15:45 +01:00
David Molineus
852b926252 Support doctrine/dbal 3 2022-02-21 20:11:56 +01:00
David Molineus
87bd720d6e Switch to phpcq dev-2.0 2022-02-21 17:13:53 +01:00
David Molineus
3f2020b0d1 Do not test against PHP 8.0. The toolchain is not ready for it :-( 2022-02-21 16:51:49 +01:00
David Molineus
e9b0d6156f Merge pull request #100 from netzmacht/dependabot/npm_and_yarn/y18n-3.2.2
Bump y18n from 3.2.1 to 3.2.2
2022-02-21 16:43:42 +01:00
David Molineus
e8f1fa2485 Merge pull request #103 from netzmacht/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.8 to 2.8.9
2022-02-21 16:43:15 +01:00
David Molineus
791eebaddb Merge pull request #106 from netzmacht/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2022-02-21 16:42:55 +01:00
David Molineus
2ed1000d4d Drop .travis.yml 2022-02-21 16:41:24 +01:00
David Molineus
4e52e31937 Add diagnostics 2022-02-21 16:40:33 +01:00
David Molineus
ef8b6d294d Require latest version of contao-toolkit 2022-02-21 16:37:54 +01:00
David Molineus
445729acfe Do not use templating engine where not required 2022-02-21 16:36:43 +01:00
David Molineus
d6a7e14a05 Bump requirements and fix symfony/event-dispatcher usage 2022-02-21 16:31:52 +01:00
dependabot[bot]
bd0eb5a416 Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 20:25:42 +00:00
dependabot[bot]
664ce11831 Bump hosted-git-info from 2.8.8 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-09 18:49:21 +00:00
dependabot[bot]
8a752b1955 Bump y18n from 3.2.1 to 3.2.2
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-30 15:31:51 +00:00
David Molineus
f2584d400c Update changelog 2020-12-18 09:48:41 +01:00
David Molineus
60e285c673 Generate absolute urls for file layers
https://github.com/netzmacht/contao-leaflet-maps/issues/92
2020-12-18 09:13:29 +01:00
David Molineus
49f3b7dbcd Remove template debug placeholders (#93) 2020-12-18 08:55:28 +01:00
David Molineus
89d83ab8e0 Merge pull request #95 from netzmacht/dependabot/npm_and_yarn/ini-1.3.7
Bump ini from 1.3.5 to 1.3.7
2020-12-18 08:55:15 +01:00
dependabot[bot]
141bb0f7b1 Bump ini from 1.3.5 to 1.3.7
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-10 23:52:13 +00:00
David Molineus
457bb612ef Update changelog 2020-09-02 07:42:33 +02:00
51 changed files with 414 additions and 211 deletions

View File

@@ -6,6 +6,10 @@
"array_insert",
"Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface",
"Contao\\ManagerPlugin\\Bundle\\Config\\BundleConfig",
"Contao\\ManagerPlugin\\Bundle\\Parser\\ParserInterface"
"Contao\\ManagerPlugin\\Bundle\\Parser\\ParserInterface",
"Contao\\ManagerPlugin\\Routing\\RoutingPluginInterface",
"Hofff\\Contao\\Consent\\Bridge\\Bridge",
"Hofff\\Contao\\Consent\\Bridge\\Plugin",
"Hofff\\Contao\\Consent\\Bridge\\Render\\RenderInformation"
]
}

82
.github/workflows/diagnostics.yml vendored Normal file
View File

@@ -0,0 +1,82 @@
name: Code Quality Diagnostics
on:
pull_request:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
include:
- php: 7.4
output: '-o github-action -o default'
phpcq_install: 'install'
- php: 8.0
output: '-o default'
phpcq_install: 'update'
- php: 8.1
output: '-o default'
phpcq_install: 'update'
- php: 8.2
output: '-o default'
phpcq_install: 'update'
steps:
- name: Pull source
uses: actions/checkout@v2
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Cache composer cache directory
uses: actions/cache@v1
env:
cache-name: composer-cache-dir
with:
path: ~/.cache/composer
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}
- name: Cache vendor directory
uses: actions/cache@v1
env:
cache-name: vendor
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
- name: Cache phpcq directory
uses: actions/cache@v1
env:
cache-name: phpcq
with:
path: .phpcq
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
- name: Install composer dependencies
run: composer install
- name: Install phpcq toolchain
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
- name: Run tests
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}
- name: Upload build directory to artifact
uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}
path: .phpcq/build/

3
.gitignore vendored
View File

@@ -25,3 +25,6 @@ build.properties
# NPM
node_modules
.phpcq
phpcq.yaml

1
.phpcq.lock Normal file
View File

@@ -0,0 +1 @@
{"plugins":{"composer-require-checker":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-require-checker-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8"}},"checksum":{"type":"sha-512","value":"5b0fd8cd5e0f5761c53b9d5375b6f6ba50f148468896248f823cc2a48361adfd872556066764b1b544ff51ffd5de60d6f9a75050db00b257d807976ac761bc3a"},"tools":{"composer-require-checker":{"version":"3.8.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.8.0/composer-require-checker.phar","requirements":{"php":{"php":"^7.4 || ^8.0","ext-json":"*","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.8.0/composer-require-checker.phar.asc"}}},"phpmd":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/phpmd-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"88e267b9c36b2edc85e924717606b626e005ac8d97b1f65f5331e2a3b3894dec2cf124f6187541bf759d026477b6d94daacc5d5c81bb09714a68ffabe5698dc5"},"tools":{"phpmd":{"version":"2.11.1","url":"https://github.com/phpmd/phpmd/releases/download/2.11.1/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":null}}},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}}},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}}},"phpcs":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcs-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"2737022369da1318cc4e0ea194e8a81019f7b079080d869aab878b7486052fdbe68fee3f28131f35573226def1aabd4bd005e038ee7b767c137b1107c1492a83"},"tools":{"phpcs":{"version":"3.6.2","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcs.phar.asc"},"phpcbf":{"version":"3.6.2","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcbf.phar.asc"}}},"composer-normalize":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-normalize-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d59d3557cb20630734878a9115df5dd32d5aff815e5b15be36f6fb5d6e9d83dd36efd84215ab6529edcc924f600946f739a0d9e67723deff95c88346ab502498"},"tools":{"composer-normalize":{"version":"2.23.1","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.1/composer-normalize.phar","requirements":{"php":{"php":"^7.4 || ^8.0"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.1/composer-normalize.phar.asc"}}}},"tools":[]}

View File

@@ -1,41 +0,0 @@
dist: xenial
addons:
apt:
packages:
- ant-optional
language: php
php:
- "7.3"
- "7.2"
- "7.1"
- "7.4snapshot"
- "nightly"
env:
- CONTAO_VERSION=contao/core-bundle ~4.4.0
- CONTAO_VERSION=contao/core-bundle ~4.5.0
- CONTAO_VERSION=contao/core-bundle ~4.6.0
matrix:
exclude:
allow_failures:
- php: "nightly"
- php: "7.4snapshot"
before_script:
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- travis_retry composer self-update && composer --version
- travis_retry composer require $CONTAO_VERSION --no-update
- travis_retry composer update --prefer-dist --no-interaction
script: ant -keep-going
git:
depth: 2147483647
cache:
directories:
- vendor

View File

@@ -8,6 +8,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [3.2.3] - 2022-02-22
### Changed
- Support symfony 5 (Contao 4.13 support) ([#110](https://github.com/netzmacht/contao-leaflet-maps/issues/110))
- Support doctrine/dbal 3 (Contao 4.13 support) ([#110](https://github.com/netzmacht/contao-leaflet-maps/issues/110))
- Fix missing icon in backend navigation ([#101](https://github.com/netzmacht/contao-leaflet-maps/issues/101))
- Fix empty help wizard ([#99](https://github.com/netzmacht/contao-leaflet-maps/issues/99))
- Update leaflet providers ([111](https://github.com/netzmacht/contao-leaflet-maps/issues/111), [102](https://github.com/netzmacht/contao-leaflet-maps/issues/102))
- Fix tile layer implementation ([#108](https://github.com/netzmacht/contao-leaflet-maps/issues/108))
- Fix access to tile layer fields ([#107](https://github.com/netzmacht/contao-leaflet-maps/issues/107))
- Fix nexted folder structure ([#97](https://github.com/netzmacht/contao-leaflet-maps/issues/97))
## [3.2.2] - 2020-12-18
### Fixed
- Remove template debug placeholders, it breaks generated javascript ([#93](https://github.com/netzmacht/contao-leaflet-maps/issues/93))
- Generate absolute urls for file layers ([#92](https://github.com/netzmacht/contao-leaflet-maps/issues/92))
## [3.2.1] - 2020-09-02
### Fixed
@@ -163,7 +183,9 @@ Implemented enhancements
- Bypass filesystem cache in debug mode
- Changelog added
[Unreleased]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.2.0...hotfix/3.2.1
[Unreleased]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.2.2...hotfix/3.2.3
[3.2.2]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.2.1...3.2.2
[3.2.1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.2.0...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

View File

@@ -1,4 +0,0 @@
phpcs.standard = ${basedir}/vendor/phpcq/coding-standard/phpcs/PhpCodeQuality/ruleset.xml
phpmd.ruleset = ${basedir}/vendor/phpcq/coding-standard/phpmd/ruleset.xml
phpcs.excluded = src/Bundle/Resources/contao/languages,src/Bundle/Resources/public/js
phpcpd.excluded = contao

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="netzmacht/contao-leaflet-maps" default="build">
<!-- import the main build system -->
<import file="vendor/phpcq/phpcq/phpcq.main.xml" />
</project>

View File

@@ -1,13 +1,13 @@
{
"name": "netzmacht/contao-leaflet-maps",
"type": "contao-bundle",
"description": "Contao Leaflet maps integration",
"license": "LGPL-3.0-or-later",
"type": "contao-bundle",
"keywords": [
"contao",
"maps",
"leaflet"
],
"license": "LGPL-3.0-or-later",
"authors": [
{
"name": "David Molineus",
@@ -16,68 +16,75 @@
"role": "Developer"
}
],
"support": {
"email": "mail@netzmacht.de",
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
"source": "https://github.com/netzmacht/contao-leaflet-maps",
"docs": "http://leaflet-maps-for-contao.readthedocs.org/"
},
"require": {
"php": ">=7.1",
"php": "^7.1 || ^8.0",
"ext-json": "*",
"ext-pdo": "*",
"contao-community-alliance/meta-palettes": "^2.0 || ^1.11",
"contao/core-bundle": "~4.4",
"contao-community-alliance/meta-palettes": "^2.0",
"contao/core-bundle": "^4.9",
"doctrine/cache": "^1.0",
"doctrine/dbal": "^2.5",
"menatwork/contao-multicolumnwizard": "^3.3",
"doctrine/dbal": "^2.11 || ^3.0",
"menatwork/contao-multicolumnwizard-bundle": "^3.4",
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
"netzmacht/contao-leaflet-libraries": "^1.3.4",
"netzmacht/contao-leaflet-libraries": "^1.7.1.1",
"netzmacht/contao-page-context": "~1.0",
"netzmacht/contao-toolkit": "~3.0",
"netzmacht/contao-toolkit": "^3.7",
"netzmacht/php-javascript-builder": "^1.0",
"netzmacht/php-leaflet": "^1.1.0",
"symfony/config": "~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",
"symfony/twig-bundle": "~3.3 || ~4.0",
"symfony/translation": "~3.3 || ~4.0",
"twig/twig": "^1.3.35 || ^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/translation-contracts": "^1.1 || ^2.0",
"symfony/twig-bundle": "~4.4 || ^5.1",
"twig/twig": "^2.0 || ^3.0"
},
"require-dev": {
"contao/manager-plugin": "^2.1",
"hofff/contao-consent-bridge": "^1.0",
"phpcq/all-tasks": "^1.2"
"phpcq/coding-standard": "^2.1",
"phpcq/runner-bootstrap": "^1.0@dev"
},
"conflict": {
"hofff/contao-consent-bridge": "<1.0 || >= 2.0"
},
"extra": {
"branch-alias": {
"dev-master": "3.2.x-dev",
"dev-develop": "3.3.x-dev",
"dev-support/2.x": "2.0.x-dev"
},
"contao": {
"transifex": {
"project": "contao-leaflet-maps",
"prefix": "core-",
"languages_cto": "src/Bundle/Resources/contao/languages",
"languages_tx": ".tx"
}
},
"contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\Bundle\\ContaoManager\\Plugin"
},
"autoload": {
"psr-4": {
"Netzmacht\\Contao\\Leaflet\\": "src/"
}
},
"autoload-dev": {
"files": [
"vendor/phpcq/autoload-validation/hacks/contao-hack.php"
]
"config": {
"allow-plugins": {
"contao-components/installer": true,
"contao/manager-plugin": true,
"contao-community-alliance/composer-plugin": true
}
},
"support": {
"email": "mail@netzmacht.de",
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
"source": "https://github.com/netzmacht/contao-leaflet-maps",
"docs": "http://leaflet-maps-for-contao.readthedocs.org/"
"extra": {
"branch-alias": {
"dev-develop": "3.3.x-dev",
"dev-master": "3.2.x-dev",
"dev-support/2.x": "2.0.x-dev"
},
"contao": {
"transifex": {
"languages_cto": "src/Bundle/Resources/contao/languages",
"languages_tx": ".tx",
"prefix": "core-",
"project": "contao-leaflet-maps"
}
},
"contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\Bundle\\ContaoManager\\Plugin"
}
}

24
package-lock.json generated
View File

@@ -1259,9 +1259,9 @@
}
},
"hosted-git-info": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg=="
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="
},
"inflight": {
"version": "1.0.6",
@@ -1278,9 +1278,9 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"ini": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz",
"integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ=="
},
"interpret": {
"version": "1.4.0",
@@ -1932,9 +1932,9 @@
"integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM="
},
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
},
"path-root": {
"version": "0.1.1",
@@ -2804,9 +2804,9 @@
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
},
"y18n": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
"integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ=="
},
"yargs": {
"version": "7.1.1",

98
phpcq.yaml.dist Normal file
View File

@@ -0,0 +1,98 @@
phpcq:
repositories:
- https://phpcq.github.io/repository/repository.json
directories:
- src
plugins:
composer-require-checker:
version: ^1.0
signed: false
phpmd:
version: ^1.0
signed: false
requirements:
phpmd:
signed: false
phpcpd:
version: ^1.1
signed: false
phploc:
version: ^1.0
signed: false
phpcs:
version: ^1.0
signed: false
composer-normalize:
version: ^1.0
signed: false
trusted-keys:
# composer require checker
- 033E5F8D801A2F8D
# sb@sebastian-bergmann.de
- 4AA394086372C20A
# magl@magll.net
- D2CCAC42F6295E7D
# PHP_CodeSniffer
- 31C7E470E2138192
# Composer normalize
- C00543248C87FB13
# phpmd
- 0F9684B8B16B7AB0
tasks:
fix:
- composer-normalize-fix
- phpcbf
verify:
- composer-require-checker
- composer-normalize
analyze:
- phploc
- phpcpd
- phpmd
- phpcs
default:
- verify
- analyze
phpcpd:
plugin: phpcpd
phpmd:
config:
ruleset:
- vendor/phpcq/coding-standard/phpmd/ruleset.xml
composer-normalize:
config:
ignore_output:
- '#Root package is not of type "project", we will not installing Contao extensions\.#'
composer-require-checker:
plugin: composer-require-checker
config:
config_file: '.composer-require-checker.json'
phpcs:
plugin: phpcs
config: &phpcs-config
standard: ~
excluded:
- src/Bundle/Resources/contao/languages
- src/Bundle/Resources/public/js
phpcbf:
plugin: phpcs
config:
<<: *phpcs-config
fix: true
composer-normalize-fix:
plugin: composer-normalize
config:
dry_run: false

4
phpcs.xml.dist Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="ContaoToolkit">
<rule ref="vendor/phpcq/coding-standard/phpcs/PhpCodeQuality/ruleset.xml" />
</ruleset>

View File

@@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class ChainRenderer.

View File

@@ -16,7 +16,7 @@ namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Contao\FilesModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class FileLabelRenderer

View File

@@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Interface LayerLabelRenderer.

View File

@@ -16,7 +16,7 @@ namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Netzmacht\Contao\Leaflet\Model\MarkerModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class MarkersLabelRenderer.

View File

@@ -15,7 +15,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Contao\StringUtil;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class OverpassLabelRenderer.

View File

@@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Backend label renderer for provider layer.

View File

@@ -16,7 +16,7 @@ namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class ReferenceLabelRenderer.

View File

@@ -16,7 +16,7 @@ namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Netzmacht\Contao\Leaflet\Model\VectorModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class VectorsLabelRenderer.

View File

@@ -18,6 +18,8 @@ use Netzmacht\LeafletPHP\Assets;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use function array_pad;
/**
* Class RegisterLibrariesPass.
*
@@ -43,12 +45,12 @@ class RegisterLibrariesPass implements CompilerPassInterface
foreach ($libraries as $name => $assets) {
if (!empty($assets['css'])) {
list ($source, $type) = (array) $assets['css'];
[$source, $type] = array_pad((array) $assets['css'], 2, null);
$definition->addMethodCall('registerStylesheet', [$name, $source, $type ?: Assets::TYPE_FILE]);
}
if (!empty($assets['javascript'])) {
list ($source, $type) = (array) $assets['javascript'];
[$source, $type] = array_pad((array) $assets['javascript'], 2, null);
$definition->addMethodCall('registerJavascript', [$name, $source, $type ?: Assets::TYPE_FILE]);
}
}

View File

@@ -4,7 +4,7 @@ services:
public: true
arguments:
- '@netzmacht.contao_toolkit.repository_manager'
- '@templating'
- '@netzmacht.contao_toolkit.template_renderer'
- '@filesystem'
- '@netzmacht.contao_toolkit.contao.system_adapter'
- '%netzmacht.contao_leaflet.cache_dir%'

View File

@@ -77,6 +77,7 @@ services:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\FileLayerMapper
arguments:
- '@netzmacht.contao_toolkit.repository_manager'
- '@netzmacht.contao_toolkit.contao.environment_adapter'
tags:
- { name: netzmacht.contao_leaflet.mapper }

View File

@@ -1,13 +1,13 @@
parameters:
netzmacht.contao_leaflet.providers:
OpenStreetMap:
variants: ['Mapnik', 'BlackAndWhite', 'DE', 'CH', 'France', 'HOT', 'BZH']
variants: ['Mapnik', 'DE', 'CH', 'France', 'HOT', 'BZH']
OpenSeaMap: []
OpenTopoMap: []
OPNVKarte: []
OpenPtMap: []
OpenTopoMap: []
OpenRailwayMap: []
@@ -15,6 +15,9 @@ parameters:
SafeCast: []
Stadia:
variants: ['AlidadeSmooth', 'AlidadeSmoothDark', 'OSMBright', 'Outdoors']
Thunderforest:
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\ThunderforestProvider'
variants:
@@ -25,12 +28,13 @@ parameters:
- 'Landscape'
- 'Outdoors'
- 'Pioneer'
- 'MobileAtlas'
- 'Neighbourhood'
options:
apiKey: 'tile_provider_key'
fields: ['tile_provider_key']
OpenMapSurfer:
variants: ['Roads', 'AdminBounds', 'Grayscale']
CyclOSM: []
Hydda:
variants: ['Full', 'Base', 'RoadsAndLabels']
@@ -41,6 +45,8 @@ parameters:
accessToken: 'tile_provider_key'
fields: ['tile_provider_key']
MapTiler: []
Stamen:
variants:
- 'Toner'
@@ -112,6 +118,7 @@ parameters:
- 'hybridDayMobile'
- 'hybridDayTransit'
- 'hybridDayGrey'
- 'hybridDayTraffic'
- 'pedestrianDay'
- 'pedestrianNight'
- 'satelliteDay'

View File

@@ -16,7 +16,7 @@ services:
- '@netzmacht.contao_leaflet.cache'
- '@netzmacht.contao_leaflet.frontend.data_controller'
- '@netzmacht.contao_toolkit.repository_manager'
- '@templating'
- '@netzmacht.contao_toolkit.template_renderer'
netzmacht.contao_leaflet.libraries:
class: Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration
@@ -141,4 +141,4 @@ services:
Netzmacht\Contao\Leaflet\Bundle\ConsentBridge\Plugin:
tags:
- { name: hofff_contao_consent_bridge.plugin }
- { name: hofff_contao_consent_bridge.plugin }

View File

@@ -10,6 +10,8 @@
* @filesource
*/
\Contao\Controller::loadLanguageFile('leaflet');
$GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'config' => [
'dataContainer' => 'Table',
@@ -71,6 +73,11 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'toggleNodes' => [
'href' => 'ptg=all',
'class' => 'header_toggle',
'showOnSelect' => true,
],
],
'operations' => [
'markers' => [
@@ -633,7 +640,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['maxlength' => 255, 'tl_class' => 'long', 'allowHtml' => true],
'eval' => ['maxlength' => 255, 'tl_class' => 'clr long', 'allowHtml' => true],
'sql' => "varchar(255) NOT NULL default ''",
],
'tms' => [

View File

@@ -23,6 +23,10 @@
padding-left: 20px !important;
}
.tl_listing .tl_left {
overflow: unset;
}
.long .tl_text_2 {
width: 325px;
}

View File

@@ -1,5 +1,5 @@
#tl_navigation .tl_level_1_group .group-leaflet {
#tl_navigation .group-leaflet {
background: url(../img/leaflet.svg) 3px 2px no-repeat;
}

View File

@@ -15,7 +15,7 @@ namespace Netzmacht\Contao\Leaflet\Event;
use Contao\Model;
use Netzmacht\Contao\Leaflet\Mapper\Request;
use Netzmacht\LeafletPHP\Definition;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Class BuildDefinitionEvent is emitted when the mapper maps between the model and the definition.

View File

@@ -14,7 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Event;
use Netzmacht\LeafletPHP\Definition;
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonObject;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Class ConvertToGeoJsonEvent is emitted when the DefinitionMapper converts a definition to a geo json feature.

View File

@@ -12,7 +12,7 @@
namespace Netzmacht\Contao\Leaflet\Event;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Class GetHashEvent is emitted then a hash for a data object with an unknown type is required.

View File

@@ -13,7 +13,7 @@
namespace Netzmacht\Contao\Leaflet\Event;
use Netzmacht\LeafletPHP\Definition\Map;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Class GetJavascriptEvent is emitted after the map javascript was created.

View File

@@ -24,7 +24,7 @@ use Netzmacht\Contao\Leaflet\Model\MapModel;
use Netzmacht\Contao\Toolkit\Component\Hybrid\AbstractHybrid;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class HybridTrait provides method required by the frontend module and content element the same time.

View File

@@ -22,7 +22,7 @@ use Netzmacht\Contao\Toolkit\Component\Component;
use Netzmacht\Contao\Toolkit\Component\ComponentFactory;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class MapElementFactory

View File

@@ -93,7 +93,7 @@ class DataController
$filter = null;
}
list($data, $error) = $this->loadData($mapProvider, $input['type'], $input['id'], $filter);
[$data, $error] = $this->loadData($mapProvider, $input['type'], $input['id'], $filter);
$this->encodeData($input['format'], $data);
} catch (\Exception $e) {
if ($this->debugMode) {

View File

@@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Frontend\Module;
use Contao\Config;
use Contao\CoreBundle\Framework\Adapter;
use Contao\Input;
use Netzmacht\Contao\Leaflet\MapProvider;
@@ -22,7 +21,7 @@ use Netzmacht\Contao\Toolkit\Component\Component;
use Netzmacht\Contao\Toolkit\Component\ComponentFactory;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class MapElementFactory

View File

@@ -18,7 +18,7 @@ use Contao\CoreBundle\Event\MenuEvent;
use Netzmacht\Contao\Toolkit\View\Assets\AssetsManager;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\RouterInterface as Router;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class BackendMenuListener adds backend entries to the navigation.

View File

@@ -147,9 +147,9 @@ class ControlDcaListener extends AbstractListener
$statement = $this->connection->prepare($query);
$statement->bindValue('cid', $dataContainer->id);
$statement->execute();
$result = $statement->executeQuery();
return $statement->fetchAll();
return $result->fetchAllAssociative();
}
/**
@@ -167,9 +167,9 @@ class ControlDcaListener extends AbstractListener
$query = 'SELECT * FROM tl_leaflet_control_layer WHERE cid=:cid order BY sorting';
$statement = $this->connection->prepare($query);
$statement->bindValue('cid', $dataContainer->id);
$statement->execute();
$result = $statement->executeQuery();
while ($row = $statement->fetch()) {
while ($row = $result->fetchAssociative()) {
$values[$row['lid']] = $row;
}

View File

@@ -20,7 +20,7 @@ use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Model\MapModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class Module is the helper for the tl_module dca.
@@ -103,7 +103,7 @@ final class FrontendIntegrationListener
)
),
Image::getHtml(
'alias.gif',
'alias.svg',
$this->translator->trans('editalias.0', [$dataContainer->value], 'contao_tl_content'),
'style="vertical-align:top"'
)

View File

@@ -25,7 +25,7 @@ use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener;
use Netzmacht\Contao\Toolkit\Dca\Manager;
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class Layer is the helper class for the tl_leaflet_layer dca.
@@ -197,7 +197,7 @@ class LayerDcaListener extends AbstractListener
if (!empty($this->layers[$row['type']]['icon'])) {
$src = $this->layers[$row['type']]['icon'];
} else {
$src = 'iconPLAIN.gif';
$src = 'iconPLAIN.svg';
}
$activeIcon = $src;
@@ -275,12 +275,12 @@ class LayerDcaListener extends AbstractListener
$pasteAfterUrl,
StringUtil::specialchars($this->translator->trans('pasteafter.1', [$row['id']], 'contao_' . $table)),
Image::getHtml(
'pasteafter.gif',
'pasteafter.svg',
$this->translator->trans('pasteafter.1', [$row['id']], 'contao_' . $table)
)
);
if (!empty($this->layers[$row['type']]['children'])) {
if (isset($row['type']) && !empty($this->layers[$row['type']]['children'])) {
$pasteIntoUrl = $this->backendAdapter->addToUrl(
sprintf(
'act=%s&amp;mode=2&amp;pid=%s%s',
@@ -295,12 +295,12 @@ class LayerDcaListener extends AbstractListener
$pasteIntoUrl,
StringUtil::specialchars($this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table)),
Image::getHtml(
'pasteinto.gif',
'pasteinto.svg',
$this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table)
)
);
} elseif ($row['id'] > 0) {
$buffer .= Image::getHtml('pasteinto_.gif');
$buffer .= Image::getHtml('pasteinto_.svg');
}
return $buffer;
@@ -361,25 +361,25 @@ class LayerDcaListener extends AbstractListener
if ($undoId) {
$statement = $this->connection->prepare('SELECT * FROM tl_undo WHERE id=:id LIMIT 0,1');
$statement->bindValue('id', $undoId);
$statement->execute();
$result = $statement->executeQuery();
$undo = $statement->fetch();
$undo = $result->fetchAssociative();
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE lid=:lid');
$statement->bindValue('lid', $dataContainer->id);
$statement->execute();
$result = $statement->executeQuery();
$undo['data'] = StringUtil::deserialize($undo['data'], true);
while ($row = $statement->fetch()) {
while ($row = $result->fetchAssociative()) {
$undo['data']['tl_leaflet_map_layer'][] = $row;
}
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_control_layer WHERE lid=:lid');
$statement->bindValue('lid', $dataContainer->id);
$statement->execute();
$result = $statement->executeQuery();
$undo['data']['tl_leaflet_control_layer'] = $statement->fetchAll();
$undo['data']['tl_leaflet_control_layer'] = $result->fetchAllAssociative();
$this->connection->update('tl_undo', ['data' => $undo['data']], ['id' => $undo['id']]);
}

View File

@@ -17,9 +17,9 @@ use Contao\DataContainer;
use Contao\System;
use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\View\Template\TemplateRenderer;
use Netzmacht\LeafletPHP\Value\LatLng;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
/**
* Class Leaflet is the base helper providing different methods.
@@ -50,11 +50,11 @@ class LeafletDcaListener
private $repositoryManager;
/**
* Template engine.
* Template renderer.
*
* @var TemplateEngine
* @var TemplateRenderer
*/
private $templateEngine;
private $templateRenderer;
/**
* System adapter.
@@ -67,20 +67,20 @@ class LeafletDcaListener
* LeafletCallbacks constructor.
*
* @param RepositoryManager $repositoryManager Repository manager.
* @param TemplateEngine $templateEngine Template engine.
* @param TemplateRenderer $templateRenderer Template renderer.
* @param Filesystem $fileSystem File system.
* @param Adapter|System $systemAdapter Contao system adapter.
* @param string $cacheDir Cache dir.
*/
public function __construct(
RepositoryManager $repositoryManager,
TemplateEngine $templateEngine,
TemplateRenderer $templateRenderer,
Filesystem $fileSystem,
$systemAdapter,
string $cacheDir
) {
$this->repositoryManager = $repositoryManager;
$this->templateEngine = $templateEngine;
$this->templateRenderer = $templateRenderer;
$this->fileSystem = $fileSystem;
$this->systemAdapter = $systemAdapter;
$this->cacheDir = $cacheDir;
@@ -125,7 +125,7 @@ class LeafletDcaListener
$data['marker'] = null;
}
return $this->templateEngine->render('toolkit:be:be_leaflet_geocode.html5', $data);
return $this->templateRenderer->render('be:be_leaflet_geocode', $data);
}
/**

View File

@@ -24,9 +24,8 @@ use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener;
use Netzmacht\Contao\Toolkit\Dca\Manager;
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder;
use PDO;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class Map is the helper class for the tl_leaflet_map dca.
@@ -136,12 +135,9 @@ class MapDcaListener extends AbstractListener
{
$statement = $this->connection->prepare('SELECT lid FROM tl_leaflet_map_layer WHERE mid=:mid ORDER BY sorting');
$statement->bindValue('mid', $dataContainer->id);
$result = $statement->executeQuery();
if ($statement->execute()) {
return $statement->fetchAll(PDO::FETCH_COLUMN, 0);
}
return [];
return $result->fetchFirstColumn();
}
/**
@@ -159,9 +155,9 @@ class MapDcaListener extends AbstractListener
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting');
$statement->bindValue('mid', $dataContainer->id);
$statement->execute();
$result = $statement->executeQuery();
while ($row = $statement->fetch()) {
while ($row = $result->fetchAssociative()) {
$values[$row['lid']] = $row;
}
@@ -239,9 +235,9 @@ class MapDcaListener extends AbstractListener
{
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting');
$statement->bindValue('mid', $dataContainer->id);
$statement->execute();
$result = $statement->executeQuery();
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
while ($row = $result->fetchAssociative()) {
unset($row['id']);
$row['tstamp'] = time();
$row['mid'] = $insertId;

View File

@@ -145,9 +145,9 @@ class MarkerDcaListener
$statement = $this->connection->prepare($query);
$statement->bindValue('id', $dataContainer->id);
$statement->execute();
$result = $statement->executeQuery();
if ($row = $statement->fetch()) {
if ($row = $result->fetchAssociative()) {
$buffer = $row['latitude'];
if ($buffer && $row['longitude']) {

View File

@@ -16,7 +16,7 @@ use Contao\DataContainer;
use Contao\StringUtil;
use Netzmacht\Contao\Toolkit\Dca\Manager;
use Netzmacht\LeafletPHP\Value\LatLng;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/**
* Class Validator.

View File

@@ -178,8 +178,8 @@ final class GeoJsonListener
private function parseModelValue(Model $model, &$property)
{
if (is_array($property)) {
list($property, $type) = $property;
$value = $model->$property;
[$property, $type] = $property;
$value = $model->$property;
switch ($type) {
case 'array':

View File

@@ -143,12 +143,12 @@ class LoadAssetsListener
$assets = $this->libraries[$library];
if (!empty($assets['css'])) {
list ($source, $type) = (array) $assets['css'];
[$source, $type] = array_pad((array) $assets['css'], 2, null);
$this->assets->addStylesheet($source, $type ?: Assets::TYPE_FILE);
}
if (!empty($assets['javascript'])) {
list ($source, $type) = (array) $assets['javascript'];
[$source, $type] = array_pad((array) $assets['javascript'], 2, null);
$this->assets->addJavascript($source, $type ?: Assets::TYPE_FILE);
}
}

View File

@@ -60,11 +60,11 @@ final class RegisterLibrariesListener
{
foreach ($this->libraries as $name => $assets) {
if (!empty($assets['css'])) {
list ($source, $type) = (array) $assets['css'];
[$source, $type] = array_pad((array) $assets['css'], 2, null);
$this->leaflet->registerStylesheet($name, $source, $type ?: Assets::TYPE_FILE);
}
if (!empty($assets['javascript'])) {
list ($source, $type) = (array) $assets['javascript'];
[$source, $type] = array_pad((array) $assets['javascript'], 2, null);
$this->leaflet->registerJavascript($name, $source, $type ?: Assets::TYPE_FILE);
}
}

View File

@@ -24,11 +24,11 @@ use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\Contao\Leaflet\Model\MapModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\View\Template\TemplateReference;
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\EventDispatcher\EventDispatcherInterface as EventDispatcher;
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
/**
* Class MapProvider.
@@ -94,11 +94,11 @@ class MapProvider
private $repositoryManager;
/**
* Template engine.
* Template renderer.
*
* @var TemplateEngine
* @var TemplateRenderer
*/
private $templateEngine;
private $templateRenderer;
/**
* Construct.
@@ -111,7 +111,7 @@ class MapProvider
* @param Cache $cache Cache.
* @param DataController $dataController Data controller.
* @param RepositoryManager $repositoryManager Repository manager.
* @param TemplateEngine $templateEngine Template engine.
* @param TemplateRenderer $templateRenderer Template rednerer.
*/
public function __construct(
DefinitionMapper $mapper,
@@ -122,7 +122,7 @@ class MapProvider
Cache $cache,
DataController $dataController,
RepositoryManager $repositoryManager,
TemplateEngine $templateEngine
TemplateRenderer $templateRenderer
) {
$this->mapper = $mapper;
$this->leaflet = $leaflet;
@@ -132,7 +132,7 @@ class MapProvider
$this->cache = $cache;
$this->dataController = $dataController;
$this->repositoryManager = $repositoryManager;
$this->templateEngine = $templateEngine;
$this->templateRenderer = $templateRenderer;
}
/**
@@ -374,7 +374,7 @@ class MapProvider
$javascript = $this->leaflet->build($definition, $this->assets);
$mapId = $definition->getId();
$templateReference = new TemplateReference($template, 'html5', TemplateReference::SCOPE_FRONTEND);
$templateReference = 'fe:' . $template;
$parameters = [
'definition' => $definition,
'model' => $model,
@@ -384,12 +384,16 @@ class MapProvider
'mapId' => $mapId,
];
$content = $this->templateEngine->render($templateReference, $parameters);
$event = new GetJavascriptEvent($definition, $content);
$this->eventDispatcher->dispatch($event::NAME, $event);
$content = $this->templateRenderer->render($templateReference, $parameters);
$content = preg_replace(
['/^<!-- TEMPLATE (START): .+ -->\n*/', '/\n*<!-- TEMPLATE (END): .+ -->$/'],
'',
$content
);
$buffer = $event->getJavascript();
$event = new GetJavascriptEvent($definition, $content);
$this->eventDispatcher->dispatch($event, $event::NAME);
return $buffer;
return $event->getJavascript();
}
}

View File

@@ -20,7 +20,7 @@ use Netzmacht\LeafletPHP\Value\GeoJson\ConvertsToGeoJsonFeature;
use Netzmacht\LeafletPHP\Value\GeoJson\Feature;
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonFeature;
use Symfony\Component\EventDispatcher\EventDispatcherInterface as EventDispatcher;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
/**
* Class DefinitionMapper is the main mapper instance which contains all other mappers as children.
@@ -111,7 +111,7 @@ class DefinitionMapper
if ($definition) {
$event = new BuildDefinitionEvent($definition, $model, $request);
$this->eventDispatcher->dispatch($event::NAME, $event);
$this->eventDispatcher->dispatch($event, $event::NAME);
}
$this->mapped[$hash] = $definition;
@@ -172,7 +172,7 @@ class DefinitionMapper
}
$event = new ConvertToGeoJsonEvent($definition, $feature, $model);
$this->eventDispatcher->dispatch($event::NAME, $event);
$this->eventDispatcher->dispatch($event, $event::NAME);
return $feature;
}
@@ -190,7 +190,7 @@ class DefinitionMapper
private function hash($model, $elementId = null)
{
$event = new GetHashEvent($model);
$this->eventDispatcher->dispatch($event::NAME, $event);
$this->eventDispatcher->dispatch($event, $event::NAME);
$hash = $event->getHash();
if (!$hash) {

View File

@@ -14,6 +14,8 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Mapper\Layer;
use Contao\CoreBundle\Framework\Adapter;
use Contao\Environment;
use Contao\FilesModel;
use Contao\Model;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
@@ -58,16 +60,25 @@ class FileLayerMapper extends AbstractLayerMapper
*/
private $repositoryManager;
/**
* Environment.
*
* @var Adapter<Environment>
*/
private $environmentAdapter;
/**
* Construct.
*
* @param RepositoryManager $repositoryManager Repository manager.
* @param RepositoryManager $repositoryManager Repository manager.
* @param Adapter<Environment> $environmentAdapter Environment adapter.
*/
public function __construct(RepositoryManager $repositoryManager)
public function __construct(RepositoryManager $repositoryManager, Adapter $environmentAdapter)
{
$this->repositoryManager = $repositoryManager;
parent::__construct();
$this->repositoryManager = $repositoryManager;
$this->environmentAdapter = $environmentAdapter;
}
/**
@@ -103,25 +114,26 @@ class FileLayerMapper extends AbstractLayerMapper
$layerId = $this->getElementId($model, $elementId);
if ($fileModel instanceof FilesModel && $fileModel->type === 'file') {
$url = $this->environmentAdapter->get('url') . '/' . $fileModel->path;
switch ($model->fileFormat) {
case 'gpx':
$layer = new Gpx($layerId, $fileModel->path);
$layer = new Gpx($layerId, $url);
break;
case 'kml':
$layer = new Kml($layerId, $fileModel->path);
$layer = new Kml($layerId, $url);
break;
case 'wkt':
$layer = new Wkt($layerId, $fileModel->path);
$layer = new Wkt($layerId, $url);
break;
case 'geojson':
$layer = new OmnivoreGeoJson($layerId, $fileModel->path);
$layer = new OmnivoreGeoJson($layerId, $url);
break;
case 'topojson':
$layer = new TopoJson($layerId, $fileModel->path);
$layer = new TopoJson($layerId, $url);
break;
default:

View File

@@ -93,7 +93,7 @@ class TileLayerMapper extends AbstractLayerMapper
/** @var TileLayer $definition */
$bounds = StringUtil::deserialize($model->bounds);
if ($request[0] && $request[1]) {
if ($bounds[0] && $bounds[1]) {
$bounds = array_map(
function ($value) {
return explode(',', $value, 3);