Compare commits

...

69 Commits
3.1.3 ... 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
David Molineus
118bb9a829 Do not append javascript at the body but inject them in the element/module
Consent tools might interrupt the rendering
2020-09-02 07:40:44 +02:00
David Molineus
e49c74c546 Merge tag '3.2.0' into master 2020-08-28 17:19:23 +02:00
David Molineus
6054def7aa Prepare release 2020-08-28 17:19:04 +02:00
David Molineus
86026a473b Add support for hofff/contao-consent-bridge #81 2020-08-28 17:14:33 +02:00
David Molineus
90c4621918 Prepare release 2020-08-28 16:57:52 +02:00
David Molineus
e5263a6315 Copy map layer relations (Fix #89) 2020-08-28 16:56:11 +02:00
David Molineus
515a191a66 Bump npm dependencies and recompile js 2020-08-28 16:46:58 +02:00
David Molineus
f2f7e87fd3 Merge pull request #88 from fritzmg/patch-1
Use template_legend instead of templates_legend
2020-08-10 16:56:58 +02:00
Fritz Michael Gschwantner
4198b2b6cd add author 2020-05-04 09:12:00 +01:00
Fritz Michael Gschwantner
fbd1ef81b0 use template_legend instead of templates_legend 2020-05-03 16:19:16 +01:00
Fritz Michael Gschwantner
92a376a307 use template_legend instead of template_legend 2020-05-03 16:18:33 +01:00
David Molineus
bf6a1f9db0 Add funding information 2020-01-03 09:21:09 +01:00
David Molineus
c523aed70d Merge tag '3.1.6' 2020-01-03 09:09:21 +01:00
David Molineus
4795767a8b Prepare the release 2020-01-03 09:08:59 +01:00
David Molineus
c0efdb058e Fix potential security issue 2020-01-03 09:08:52 +01:00
David Molineus
a4547ffb17 Use relative icon path for the backend group icon (#83) 2020-01-03 08:53:47 +01:00
David Molineus
a63c836535 Fix labels (See #83) 2020-01-03 08:49:07 +01:00
David Molineus
711b06c6d3 Do not apply options which value is null 2020-01-03 08:43:21 +01:00
David Molineus
70b7d0ab9c Fix release date 2019-08-26 09:04:19 +02:00
David Molineus
ea59841d6e Merge tag '3.1.5' 2019-08-26 09:03:57 +02:00
David Molineus
64c332bc25 Update node packages and recompile 2019-08-26 09:03:32 +02:00
David Molineus
3db5aad6d3 Fix composer.json 2019-08-21 13:29:08 +02:00
David Molineus
cef9d7ff44 Use twig instead of templating engine to render about page
This restores compatibility with Contao 4.8 without changing default
configuration of the symfony framework bundle.
2019-08-21 13:27:11 +02:00
David Molineus
06dd3655c0 Merge tag '3.1.4' 2019-02-13 12:56:00 +01:00
David Molineus
3b066dfeb7 Prepare release. 2019-02-13 12:53:50 +01:00
David Molineus
697e8d2f5e Drop unused function use statements. 2019-02-13 12:50:59 +01:00
David Molineus
a6c08ae8e5 Fix #71: Using multiple edit to copy entities leads to invalid aliases. Do not copy aliases at all. 2019-02-13 12:46:19 +01:00
David Molineus
bb8f9e42dc Fix #76: Urls to packagist used packagist.com instead of packagist.org. 2019-02-13 12:35:00 +01:00
David Molineus
3be5da9176 Fix #75: A non existing image of an image icon throws an exception. 2019-02-13 12:33:44 +01:00
David Molineus
55e4ed0702 Fix #74: Markers with negative coordinates aren't displayed on the map. 2019-02-13 12:09:40 +01:00
David Molineus
d42e0e122f Fix order changes in layer control element aren't applied (#72). 2019-02-13 12:06:30 +01:00
David Molineus
ac05d103f1 Normalize composer.json, add user documentation link to support section and to the readme (See #9). 2019-02-13 12:01:42 +01:00
David Molineus
cc9990cf4d Test against PHP 7.4snapshot. 2019-02-13 11:54:33 +01:00
David Molineus
9643b2c196 Link version number to the github compare link. 2019-02-13 11:27:32 +01:00
David Molineus
4d55b012fd Merge branch 'master' of github.com:netzmacht/contao-leaflet-maps 2019-01-10 16:42:31 +01:00
David Molineus
39a7207e23 Merge tag '3.1.3' 2019-01-10 16:41:33 +01:00
David Molineus
59e671f8ea Update CHANGELOG.md 2018-12-18 09:55:36 +01:00
David Molineus
b0df34b86e Update CHANGELOG.md 2018-12-18 09:55:18 +01:00
79 changed files with 1080 additions and 1156 deletions

View File

@@ -6,6 +6,10 @@
"array_insert", "array_insert",
"Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface", "Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface",
"Contao\\ManagerPlugin\\Bundle\\Config\\BundleConfig", "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"
] ]
} }

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: [dmolineus]

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 # NPM
node_modules 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,37 +0,0 @@
dist: xenial
addons:
apt:
packages:
- ant-optional
language: php
php:
- "7.3"
- "7.2"
- "7.1"
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:
sudo: false
install:
- 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

@@ -6,9 +6,75 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 3.1.3 - 2019-01-10 ## [Unreleased]
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.2...3.1.3) ## [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
- Do not append javascript to the body anymore as consent tools might interrupt rendering
## [3.2.0] - 2020-08-28
### Added
- Add support for consent tools based on `hofff/contao-consent-bridge`
## [3.1.7] - 2020-08-28
### Fixed
- Duplicate map layer relations ([#89](https://github.com/netzmacht/contao-leaflet-maps/issues/89))
## [3.1.6] - 2020-01-03
### Fixed
- Do not add options which value is `NULL`
- Fix button labels ([#83](https://github.com/netzmacht/contao-leaflet-maps/issues/83))
- Fix potential security issue of symfony/dependency-injection (https://github.com/advisories/GHSA-pgwj-prpq-jpc2)
### Changed
- Use relative path for backend icon ([#82](https://github.com/netzmacht/contao-leaflet-maps/issues/82))
## [3.1.5] - 2019-08-26
### Fixed
- Use twig directly instead of templating component to restore Contao 4.8
## [3.1.4] - 2019-02-13
### Fixed
- Fix ordering changes in layer control element aren't recognized ([#72](https://github.com/netzmacht/contao-leaflet-maps/issues/72))
- Fix markers with negative coordinates aren't displayed ([#74](https://github.com/netzmacht/contao-leaflet-maps/issues/74))
- Fix image icon with non existing image throws exception ([#75](https://github.com/netzmacht/contao-leaflet-maps/issues/75))
- Fix invalid alias then using multiple edit. Aliases aren't copied anymore. ([#71](https://github.com/netzmacht/contao-leaflet-maps/issues/71))
## [3.1.3] - 2019-01-10
### Fixed ### Fixed
@@ -38,9 +104,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add missing GeoportailFrance of leaflet-providers - Add missing GeoportailFrance of leaflet-providers
- Add missing OneMapSG of leaflet-providers - Add missing OneMapSG of leaflet-providers
## 3.1.1 - 2018-12-07 ## [3.1.1] - 2018-12-07
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...3.1.1)
### Fixed ### Fixed
@@ -74,43 +138,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix broken marker cluster layer (#60). - Fix broken marker cluster layer (#60).
## 3.0.4 - 2018-10-08 ## [3.0.4] - 2018-10-08
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.3...3.0.4)
### Fixed ### Fixed
- Fix broken content element attributes (Missing class and custom id). - Fix broken content element attributes (Missing class and custom id).
## 3.0.3 - 2018-09-18 ## [3.0.3] - 2018-09-18
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.2...3.0.3)
### Fixed ### Fixed
- Make alias generator services public for Contao 4.6/Symfony 4.0 compatibility. - Make alias generator services public for Contao 4.6/Symfony 4.0 compatibility.
## 3.0.2 - 2018-08-23 ## [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. - Run composer require checker and solve issues.
## 3.0.1 - 2018-06-20 ## [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) - 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 - 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)
Enhancements Enhancements
@@ -121,9 +173,7 @@ Bugfixes
- Broken service definitions - Broken service definitions
- Broken file layer id - Broken file layer id
## 3.0.0-alpha1 - 2017-10-19 ## [3.0.0-alpha2] - 2017-10-19
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha1...3.0.0-alpha2)
Implemented enhancements Implemented enhancements
@@ -132,3 +182,21 @@ Implemented enhancements
- New file layer for gpx,kml,wkt,topojson,geojson files added - New file layer for gpx,kml,wkt,topojson,geojson files added
- Bypass filesystem cache in debug mode - Bypass filesystem cache in debug mode
- Changelog added - Changelog added
[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
[3.1.5]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.4...3.1.5
[3.1.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.3...3.1.4
[3.1.3]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.2...3.1.3
[3.1.1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...3.1.1
[3.0.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.3...3.0.4
[3.0.3]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.2...3.0.3
[3.0.2]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.1...3.0.2
[3.0.1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-beta1...3.0.0
[3.0.0-beta1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha2...3.0.0-beta1
[3.0-0-alpha2]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha1...3.0.0-alpha2

View File

@@ -2,9 +2,9 @@ Leaflet integration into Contao CMS
=================================== ===================================
[![Build Status](http://img.shields.io/travis/netzmacht/contao-leaflet-maps/master.svg?style=flat-square)](https://travis-ci.org/netzmacht/contao-leaflet-maps) [![Build Status](http://img.shields.io/travis/netzmacht/contao-leaflet-maps/master.svg?style=flat-square)](https://travis-ci.org/netzmacht/contao-leaflet-maps)
[![Version](http://img.shields.io/packagist/v/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.com/packages/netzmacht/contao-leaflet-maps) [![Version](http://img.shields.io/packagist/v/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
[![License](http://img.shields.io/packagist/l/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.com/packages/netzmacht/contao-leaflet-maps) [![License](http://img.shields.io/packagist/l/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
[![Downloads](http://img.shields.io/packagist/dt/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.com/packages/netzmacht/contao-leaflet-maps) [![Downloads](http://img.shields.io/packagist/dt/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
[![Contao Community Alliance coding standard](http://img.shields.io/badge/cca-coding_standard-red.svg?style=flat-square)](https://github.com/contao-community-alliance/coding-standard) [![Contao Community Alliance coding standard](http://img.shields.io/badge/cca-coding_standard-red.svg?style=flat-square)](https://github.com/contao-community-alliance/coding-standard)
This extension provides a backend gui for integrating [Leaflet](http://leafletjs.com/) into the Contao CMS. This extension provides a backend gui for integrating [Leaflet](http://leafletjs.com/) into the Contao CMS.
@@ -38,6 +38,12 @@ Features
- Autoloading of required assets. - Autoloading of required assets.
- [Layer for MetaModels](https://github.com/netzmacht/contao-leaflet-metamodels) - [Layer for MetaModels](https://github.com/netzmacht/contao-leaflet-metamodels)
Documentation
-------------
A basic [user documentation](http://leaflet-maps-for-contao.readthedocs.org/) written in German is available.
Changelog Changelog
--------- ---------

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

1332
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,10 +4,10 @@
"description": "Leaflet maps for Contao", "description": "Leaflet maps for Contao",
"main": "gulpfile.js", "main": "gulpfile.js",
"dependencies": { "dependencies": {
"gulp": "^4.0.0", "gulp": "^4.0.2",
"gulp-cli": "^2.0.1", "gulp-cli": "^2.2.0",
"gulp-concat": "^2.6.1", "gulp-concat": "^2.6.1",
"gulp-uglify": "^3.0.1", "gulp-uglify": "^3.0.2",
"promised-del": "^1.0.2" "promised-del": "^1.0.2"
}, },
"devDependencies": {}, "devDependencies": {},

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

@@ -5,15 +5,15 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @copyright 2014-2019 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource * @filesource
*/ */
namespace Netzmacht\Contao\Leaflet\Backend\Action; namespace Netzmacht\Contao\Leaflet\Backend\Action;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface as Engine;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;
/** /**
* Credits backend module. * Credits backend module.
@@ -23,11 +23,11 @@ use Symfony\Component\HttpFoundation\Response;
final class AboutAction final class AboutAction
{ {
/** /**
* Templating engine. * Twig environment.
* *
* @var Engine * @var Environment
*/ */
private $engine; private $twig;
/** /**
* Project directory. * Project directory.
@@ -39,12 +39,12 @@ final class AboutAction
/** /**
* AboutAction constructor. * AboutAction constructor.
* *
* @param Engine $engine Templating engine. * @param Environment $twig Twig environment.
* @param string $projectDir Project directory. * @param string $projectDir Project directory.
*/ */
public function __construct(Engine $engine, string $projectDir) public function __construct(Environment $twig, string $projectDir)
{ {
$this->engine = $engine; $this->twig = $twig;
$this->projectDir = $projectDir; $this->projectDir = $projectDir;
} }
@@ -62,7 +62,9 @@ final class AboutAction
[$data['version'], $data['dependencies']] = $this->extractFromComposer(); [$data['version'], $data['dependencies']] = $this->extractFromComposer();
return $this->engine->renderResponse('@NetzmachtContaoLeaflet/backend/about.html.twig', $data); return new Response(
$this->twig->render('@NetzmachtContaoLeaflet/backend/about.html.twig', $data)
);
} }
/** /**

View File

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

View File

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

View File

@@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer; namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Symfony\Component\Translation\TranslatorInterface as Translator; use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/** /**
* Interface LayerLabelRenderer. * 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\Leaflet\Model\MarkerModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Translation\TranslatorInterface as Translator; use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/** /**
* Class MarkersLabelRenderer. * Class MarkersLabelRenderer.

View File

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

View File

@@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer; 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. * 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\Leaflet\Model\LayerModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Translation\TranslatorInterface as Translator; use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/** /**
* Class ReferenceLabelRenderer. * 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\Leaflet\Model\VectorModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Translation\TranslatorInterface as Translator; use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/** /**
* Class VectorsLabelRenderer. * Class VectorsLabelRenderer.

View File

@@ -0,0 +1,37 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle\ConsentBridge;
use Hofff\Contao\Consent\Bridge\Bridge;
use Hofff\Contao\Consent\Bridge\Plugin as ConsentBridgePlugin;
use Hofff\Contao\Consent\Bridge\Render\RenderInformation;
/**
* Consent Bridge plugin for leaflet.
*/
final class Plugin implements ConsentBridgePlugin
{
/**
* {@inheritDoc}
*/
public function load(Bridge $bridge): void
{
$renderInformation = RenderInformation::autoRenderWithPlaceholder('leaflet_consent_bridge_placeholder');
$bridge
->supportContentElement('leaflet', $renderInformation)
->supportFrontendModule('leaflet', $renderInformation);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,7 @@ services:
- '@netzmacht.contao_leaflet.cache' - '@netzmacht.contao_leaflet.cache'
- '@netzmacht.contao_leaflet.frontend.data_controller' - '@netzmacht.contao_leaflet.frontend.data_controller'
- '@netzmacht.contao_toolkit.repository_manager' - '@netzmacht.contao_toolkit.repository_manager'
- '@templating' - '@netzmacht.contao_toolkit.template_renderer'
netzmacht.contao_leaflet.libraries: netzmacht.contao_leaflet.libraries:
class: Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration class: Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration
@@ -136,5 +136,9 @@ services:
Netzmacht\Contao\Leaflet\Backend\Action\AboutAction: Netzmacht\Contao\Leaflet\Backend\Action\AboutAction:
public: true public: true
arguments: arguments:
- '@templating' - '@twig'
- '%kernel.project_dir%' - '%kernel.project_dir%'
Netzmacht\Contao\Leaflet\Bundle\ConsentBridge\Plugin:
tags:
- { name: hofff_contao_consent_bridge.plugin }

View File

@@ -5,6 +5,7 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource * @filesource
@@ -13,7 +14,7 @@
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [ $GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [
'type' => ['type', 'headline'], 'type' => ['type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'], 'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'],
'templates' => [':hide', 'customTpl', 'leaflet_template'], 'template' => [':hide', 'customTpl', 'leaflet_template'],
'protected' => [':hide', 'protected'], 'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'], 'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'], 'invisible' => [':hide', 'invisible', 'start', 'start'],

View File

@@ -164,6 +164,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = [
'maxlength' => 255, 'maxlength' => 255,
'tl_class' => 'w50', 'tl_class' => 'w50',
'nullIfEmpty' => true, 'nullIfEmpty' => true,
'doNotCopy' => true,
], ],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [

View File

@@ -179,7 +179,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'], ['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
], ],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], 'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default', 'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',

View File

@@ -10,6 +10,8 @@
* @filesource * @filesource
*/ */
\Contao\Controller::loadLanguageFile('leaflet');
$GLOBALS['TL_DCA']['tl_leaflet_layer'] = [ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'config' => [ 'config' => [
'dataContainer' => 'Table', 'dataContainer' => 'Table',
@@ -71,6 +73,11 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'class' => 'header_edit_all', 'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();"', 'attributes' => 'onclick="Backend.getScrollOffset();"',
], ],
'toggleNodes' => [
'href' => 'ptg=all',
'class' => 'header_toggle',
'showOnSelect' => true,
],
], ],
'operations' => [ 'operations' => [
'markers' => [ 'markers' => [
@@ -278,7 +285,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'], ['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
], ],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], 'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'nullIfEmpty' => true,
'doNotCopy' => true,
],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default', 'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -626,7 +640,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'exclude' => true, 'exclude' => true,
'inputType' => 'text', 'inputType' => 'text',
'default' => '', 'default' => '',
'eval' => ['maxlength' => 255, 'tl_class' => 'long', 'allowHtml' => true], 'eval' => ['maxlength' => 255, 'tl_class' => 'clr long', 'allowHtml' => true],
'sql' => "varchar(255) NOT NULL default ''", 'sql' => "varchar(255) NOT NULL default ''",
], ],
'tms' => [ 'tms' => [

View File

@@ -28,6 +28,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
'onsubmit_callback' => [ 'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'], ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
], ],
'oncopy_callback' => [
['netzmacht.contao_leaflet.listeners.dca.map', 'copyLayerRelations'],
],
], ],
'list' => [ 'list' => [
@@ -157,7 +160,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'], ['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
], ],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], 'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default', 'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',

View File

@@ -160,7 +160,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'], ['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
], ],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], 'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default', 'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',

View File

@@ -151,7 +151,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'], ['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
], ],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], 'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default', 'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',

View File

@@ -145,7 +145,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'], ['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
], ],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], 'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default', 'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',

View File

@@ -185,7 +185,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'], ['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'], ['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
], ],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true], 'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [ 'toolkit' => [
'alias_generator' => [ 'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default', 'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',

View File

@@ -5,6 +5,7 @@
* *
* @package contao-leaflet-maps * @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de> * @author David Molineus <david.molineus@netzmacht.de>
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved. * @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource * @filesource
@@ -13,7 +14,7 @@
$GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = [ $GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = [
'type' => ['name', 'type', 'headline'], 'type' => ['name', 'type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'], 'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'],
'templates' => [':hide', 'customTpl'], 'template' => [':hide', 'customTpl'],
'protected' => [':hide', 'protected'], 'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'], 'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'], 'invisible' => [':hide', 'invisible', 'start', 'start'],

View File

@@ -58,7 +58,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes']['layer']['1'] = 'Ba
$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['0'] = 'Cluster-Icon-Funktion erstellen'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['0'] = 'Cluster-Icon-Funktion erstellen';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['1'] = 'Diese Funktion wird zum Erstellen des Cluster-Icons benutzt.'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['1'] = 'Diese Funktion wird zum Erstellen des Cluster-Icons benutzt.';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['0'] = 'Icons verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['0'] = 'Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['1'] = 'Stile verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['1'] = 'Icon-Stile verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['0'] = 'Karten verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['0'] = 'Karten verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['1'] = 'Leaflet-Karten verwalten.'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['1'] = 'Leaflet-Karten verwalten.';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['markerCluster']['0'] = 'Marker-Cluster'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['markerCluster']['0'] = 'Marker-Cluster';
@@ -83,7 +83,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['pasteafter']['1'] = 'Na
$GLOBALS['TL_LANG']['tl_leaflet_layer']['pasteinto']['1'] = 'In Layer %s einfügen'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['pasteinto']['1'] = 'In Layer %s einfügen';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['polygonOptions']['0'] = 'Polygon-Optionen'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['polygonOptions']['0'] = 'Polygon-Optionen';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['0'] = 'Popups verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['0'] = 'Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['1'] = 'Popup-Icons verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['1'] = 'Marker Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['0'] = 'Referenz'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['0'] = 'Referenz';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['1'] = 'Wählen Sie den Referenzlayer aus. Ansonsten wird dasselbe JavaScript-Objekt benutzt.'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['1'] = 'Wählen Sie den Referenzlayer aus. Ansonsten wird dasselbe JavaScript-Objekt benutzt.';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['removeOutsideVisibleBounds']['0'] = 'Entfernen, wenn außerhalb der sichtbaren Begrenzung'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['removeOutsideVisibleBounds']['0'] = 'Entfernen, wenn außerhalb der sichtbaren Begrenzung';

View File

@@ -35,8 +35,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_popup']['delete']['0'] = 'Popup löschen
$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete']['1'] = 'Popup ID %s löschen'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['delete']['1'] = 'Popup ID %s löschen';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['0'] = 'Popup bearbeiten'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['0'] = 'Popup bearbeiten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['1'] = 'Popup ID %s bearbeiten'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['1'] = 'Popup ID %s bearbeiten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['0'] = 'Popups verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['0'] = 'Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['1'] = 'Marker-Popups verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['1'] = 'Marker-Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['0'] = 'Im Sichtfeld behalten'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['0'] = 'Im Sichtfeld behalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['1'] = 'Aktivieren Sie diese Einstellung um ein herausschieben des Popups aus dem sichbaren Bereich zu verhindern.'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['1'] = 'Aktivieren Sie diese Einstellung um ein herausschieben des Popups aus dem sichbaren Bereich zu verhindern.';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn']['0'] = 'Layer verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn']['0'] = 'Layer verwalten';

View File

@@ -44,7 +44,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_style']['new']['1'] = 'Neuen Stil erstel
$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['0'] = 'Linientransparenz'; $GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['0'] = 'Linientransparenz';
$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['1'] = 'Die Transparenz des Striches kann einen Wert zwischen 0 und 1 annehmen.'; $GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['1'] = 'Die Transparenz des Striches kann einen Wert zwischen 0 und 1 annehmen.';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['0'] = 'Popups verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['0'] = 'Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['1'] = 'Popup-Icons verwalten'; $GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['1'] = 'Popup-Stile verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_style']['show']['0'] = 'Details anzeigen'; $GLOBALS['TL_LANG']['tl_leaflet_style']['show']['0'] = 'Details anzeigen';
$GLOBALS['TL_LANG']['tl_leaflet_style']['show']['1'] = 'Details des Stils ID %s anzeigen'; $GLOBALS['TL_LANG']['tl_leaflet_style']['show']['1'] = 'Details des Stils ID %s anzeigen';
$GLOBALS['TL_LANG']['tl_leaflet_style']['stroke']['0'] = 'Linie ziehen'; $GLOBALS['TL_LANG']['tl_leaflet_style']['stroke']['0'] = 'Linie ziehen';

View File

@@ -21,7 +21,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['map'][1] = 'Manage leaflet maps';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][0] = 'Manage icons'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][0] = 'Manage icons';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][1] = 'Manage marker icons'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][1] = 'Manage marker icons';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][0] = 'Manage popups'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][0] = 'Manage popups';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][1] = 'Manage popups icons'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][1] = 'Manage popups styles';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][0] = 'Manage styles'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][0] = 'Manage styles';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][1] = 'Manage vector styles'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][1] = 'Manage vector styles';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['new'][0] = 'Create layer'; $GLOBALS['TL_LANG']['tl_leaflet_layer']['new'][0] = 'Create layer';

View File

@@ -19,8 +19,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'][0] = 'Manage layers';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'][1] = 'Manage leaflet layers'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'][1] = 'Manage leaflet layers';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][0] = 'Manage styles'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][0] = 'Manage styles';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][1] = 'Manage vector styles'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][1] = 'Manage vector styles';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][0] = 'Manage popups'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][0] = 'Manage icons';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][1] = 'Manage marker popups'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][1] = 'Manage marker icons';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][0] = 'Create popup'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][0] = 'Create popup';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][1] = 'Create new popup'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][1] = 'Create new popup';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit'][0] = 'Edit popup'; $GLOBALS['TL_LANG']['tl_leaflet_popup']['edit'][0] = 'Edit popup';

View File

@@ -19,7 +19,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_style']['layersBtn'][1] = 'Manage leaflet layers
$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][0] = 'Manage icons'; $GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][0] = 'Manage icons';
$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][1] = 'Manage marker icons'; $GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][1] = 'Manage marker icons';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][0] = 'Manage popups'; $GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][0] = 'Manage popups';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][1] = 'Manage popups icons'; $GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][1] = 'Manage popups styles';
$GLOBALS['TL_LANG']['tl_leaflet_style']['new'][0] = 'Create style'; $GLOBALS['TL_LANG']['tl_leaflet_style']['new'][0] = 'Create style';
$GLOBALS['TL_LANG']['tl_leaflet_style']['new'][1] = 'Create new style'; $GLOBALS['TL_LANG']['tl_leaflet_style']['new'][1] = 'Create new style';
$GLOBALS['TL_LANG']['tl_leaflet_style']['edit'][0] = 'Edit style'; $GLOBALS['TL_LANG']['tl_leaflet_style']['edit'][0] = 'Edit style';

View File

@@ -9,5 +9,5 @@
</div> </div>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript . '</script>'; ?> <script><?= $this->javascript ?></script>

View File

@@ -9,4 +9,4 @@
</div> </div>
<!-- indexer::continue --> <!-- indexer::continue -->
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript . '</script>'; ?> <script><?= $this->javascript ?></script>

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,7 @@ namespace Netzmacht\Contao\Leaflet\Event;
use Contao\Model; use Contao\Model;
use Netzmacht\Contao\Leaflet\Mapper\Request; use Netzmacht\Contao\Leaflet\Mapper\Request;
use Netzmacht\LeafletPHP\Definition; 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. * 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\Definition;
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonObject; 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. * 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; 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. * 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; namespace Netzmacht\Contao\Leaflet\Event;
use Netzmacht\LeafletPHP\Definition\Map; 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. * 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\Component\Hybrid\AbstractHybrid;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Templating\EngineInterface as TemplateEngine; 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. * 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\Component\ComponentFactory;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Symfony\Component\Templating\EngineInterface as TemplateEngine; use Symfony\Component\Templating\EngineInterface as TemplateEngine;
use Symfony\Component\Translation\TranslatorInterface as Translator; use Symfony\Contracts\Translation\TranslatorInterface as Translator;
/** /**
* Class MapElementFactory * Class MapElementFactory

View File

@@ -93,7 +93,7 @@ class DataController
$filter = null; $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); $this->encodeData($input['format'], $data);
} catch (\Exception $e) { } catch (\Exception $e) {
if ($this->debugMode) { if ($this->debugMode) {

View File

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

View File

@@ -18,7 +18,7 @@ use Contao\CoreBundle\Event\MenuEvent;
use Netzmacht\Contao\Toolkit\View\Assets\AssetsManager; use Netzmacht\Contao\Toolkit\View\Assets\AssetsManager;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\RouterInterface as Router; 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. * Class BackendMenuListener adds backend entries to the navigation.

View File

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

View File

@@ -20,7 +20,7 @@ use Contao\StringUtil;
use Netzmacht\Contao\Leaflet\Model\MapModel; use Netzmacht\Contao\Leaflet\Model\MapModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder; 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. * Class Module is the helper for the tl_module dca.
@@ -103,7 +103,7 @@ final class FrontendIntegrationListener
) )
), ),
Image::getHtml( Image::getHtml(
'alias.gif', 'alias.svg',
$this->translator->trans('editalias.0', [$dataContainer->value], 'contao_tl_content'), $this->translator->trans('editalias.0', [$dataContainer->value], 'contao_tl_content'),
'style="vertical-align:top"' '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\Listener\AbstractListener;
use Netzmacht\Contao\Toolkit\Dca\Manager; use Netzmacht\Contao\Toolkit\Dca\Manager;
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder; 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. * 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'])) { if (!empty($this->layers[$row['type']]['icon'])) {
$src = $this->layers[$row['type']]['icon']; $src = $this->layers[$row['type']]['icon'];
} else { } else {
$src = 'iconPLAIN.gif'; $src = 'iconPLAIN.svg';
} }
$activeIcon = $src; $activeIcon = $src;
@@ -275,12 +275,12 @@ class LayerDcaListener extends AbstractListener
$pasteAfterUrl, $pasteAfterUrl,
StringUtil::specialchars($this->translator->trans('pasteafter.1', [$row['id']], 'contao_' . $table)), StringUtil::specialchars($this->translator->trans('pasteafter.1', [$row['id']], 'contao_' . $table)),
Image::getHtml( Image::getHtml(
'pasteafter.gif', 'pasteafter.svg',
$this->translator->trans('pasteafter.1', [$row['id']], 'contao_' . $table) $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( $pasteIntoUrl = $this->backendAdapter->addToUrl(
sprintf( sprintf(
'act=%s&amp;mode=2&amp;pid=%s%s', 'act=%s&amp;mode=2&amp;pid=%s%s',
@@ -295,12 +295,12 @@ class LayerDcaListener extends AbstractListener
$pasteIntoUrl, $pasteIntoUrl,
StringUtil::specialchars($this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table)), StringUtil::specialchars($this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table)),
Image::getHtml( Image::getHtml(
'pasteinto.gif', 'pasteinto.svg',
$this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table) $this->translator->trans('pasteinto.1', [$row['id']], 'contao_' . $table)
) )
); );
} elseif ($row['id'] > 0) { } elseif ($row['id'] > 0) {
$buffer .= Image::getHtml('pasteinto_.gif'); $buffer .= Image::getHtml('pasteinto_.svg');
} }
return $buffer; return $buffer;
@@ -361,25 +361,25 @@ class LayerDcaListener extends AbstractListener
if ($undoId) { if ($undoId) {
$statement = $this->connection->prepare('SELECT * FROM tl_undo WHERE id=:id LIMIT 0,1'); $statement = $this->connection->prepare('SELECT * FROM tl_undo WHERE id=:id LIMIT 0,1');
$statement->bindValue('id', $undoId); $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 = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE lid=:lid');
$statement->bindValue('lid', $dataContainer->id); $statement->bindValue('lid', $dataContainer->id);
$statement->execute(); $result = $statement->executeQuery();
$undo['data'] = StringUtil::deserialize($undo['data'], true); $undo['data'] = StringUtil::deserialize($undo['data'], true);
while ($row = $statement->fetch()) { while ($row = $result->fetchAssociative()) {
$undo['data']['tl_leaflet_map_layer'][] = $row; $undo['data']['tl_leaflet_map_layer'][] = $row;
} }
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_control_layer WHERE lid=:lid'); $statement = $this->connection->prepare('SELECT * FROM tl_leaflet_control_layer WHERE lid=:lid');
$statement->bindValue('lid', $dataContainer->id); $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']]); $this->connection->update('tl_undo', ['data' => $undo['data']], ['id' => $undo['id']]);
} }

View File

@@ -17,9 +17,9 @@ use Contao\DataContainer;
use Contao\System; use Contao\System;
use Netzmacht\Contao\Leaflet\Model\LayerModel; use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\View\Template\TemplateRenderer;
use Netzmacht\LeafletPHP\Value\LatLng; use Netzmacht\LeafletPHP\Value\LatLng;
use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
/** /**
* Class Leaflet is the base helper providing different methods. * Class Leaflet is the base helper providing different methods.
@@ -50,11 +50,11 @@ class LeafletDcaListener
private $repositoryManager; private $repositoryManager;
/** /**
* Template engine. * Template renderer.
* *
* @var TemplateEngine * @var TemplateRenderer
*/ */
private $templateEngine; private $templateRenderer;
/** /**
* System adapter. * System adapter.
@@ -67,20 +67,20 @@ class LeafletDcaListener
* LeafletCallbacks constructor. * LeafletCallbacks constructor.
* *
* @param RepositoryManager $repositoryManager Repository manager. * @param RepositoryManager $repositoryManager Repository manager.
* @param TemplateEngine $templateEngine Template engine. * @param TemplateRenderer $templateRenderer Template renderer.
* @param Filesystem $fileSystem File system. * @param Filesystem $fileSystem File system.
* @param Adapter|System $systemAdapter Contao system adapter. * @param Adapter|System $systemAdapter Contao system adapter.
* @param string $cacheDir Cache dir. * @param string $cacheDir Cache dir.
*/ */
public function __construct( public function __construct(
RepositoryManager $repositoryManager, RepositoryManager $repositoryManager,
TemplateEngine $templateEngine, TemplateRenderer $templateRenderer,
Filesystem $fileSystem, Filesystem $fileSystem,
$systemAdapter, $systemAdapter,
string $cacheDir string $cacheDir
) { ) {
$this->repositoryManager = $repositoryManager; $this->repositoryManager = $repositoryManager;
$this->templateEngine = $templateEngine; $this->templateRenderer = $templateRenderer;
$this->fileSystem = $fileSystem; $this->fileSystem = $fileSystem;
$this->systemAdapter = $systemAdapter; $this->systemAdapter = $systemAdapter;
$this->cacheDir = $cacheDir; $this->cacheDir = $cacheDir;
@@ -125,7 +125,7 @@ class LeafletDcaListener
$data['marker'] = null; $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,11 +24,8 @@ use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener; use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener;
use Netzmacht\Contao\Toolkit\Dca\Manager; use Netzmacht\Contao\Toolkit\Dca\Manager;
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder; use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder;
use PDO;
use function strlen;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Translation\TranslatorInterface as Translator; use Symfony\Contracts\Translation\TranslatorInterface as Translator;
use function var_dump;
/** /**
* Class Map is the helper class for the tl_leaflet_map dca. * Class Map is the helper class for the tl_leaflet_map dca.
@@ -138,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 = $this->connection->prepare('SELECT lid FROM tl_leaflet_map_layer WHERE mid=:mid ORDER BY sorting');
$statement->bindValue('mid', $dataContainer->id); $statement->bindValue('mid', $dataContainer->id);
$result = $statement->executeQuery();
if ($statement->execute()) { return $result->fetchFirstColumn();
return $statement->fetchAll(PDO::FETCH_COLUMN, 0);
}
return [];
} }
/** /**
@@ -161,9 +155,9 @@ class MapDcaListener extends AbstractListener
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting'); $statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting');
$statement->bindValue('mid', $dataContainer->id); $statement->bindValue('mid', $dataContainer->id);
$statement->execute(); $result = $statement->executeQuery();
while ($row = $statement->fetch()) { while ($row = $result->fetchAssociative()) {
$values[$row['lid']] = $row; $values[$row['lid']] = $row;
} }
@@ -228,4 +222,26 @@ class MapDcaListener extends AbstractListener
->asTree() ->asTree()
->getOptions(); ->getOptions();
} }
/**
* Copy layer relations if a map is duplicated.
*
* @param string|int $insertId Insert id of the new map.
* @param DataContainer $dataContainer Data container driver.
*
* @return void
*/
public function copyLayerRelations($insertId, DataContainer $dataContainer): void
{
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting');
$statement->bindValue('mid', $dataContainer->id);
$result = $statement->executeQuery();
while ($row = $result->fetchAssociative()) {
unset($row['id']);
$row['tstamp'] = time();
$row['mid'] = $insertId;
$this->connection->insert('tl_leaflet_map_layer', $row);
}
}
} }

View File

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

View File

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

View File

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

View File

@@ -143,12 +143,12 @@ class LoadAssetsListener
$assets = $this->libraries[$library]; $assets = $this->libraries[$library];
if (!empty($assets['css'])) { 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); $this->assets->addStylesheet($source, $type ?: Assets::TYPE_FILE);
} }
if (!empty($assets['javascript'])) { 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); $this->assets->addJavascript($source, $type ?: Assets::TYPE_FILE);
} }
} }

View File

@@ -60,11 +60,11 @@ final class RegisterLibrariesListener
{ {
foreach ($this->libraries as $name => $assets) { foreach ($this->libraries as $name => $assets) {
if (!empty($assets['css'])) { 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); $this->leaflet->registerStylesheet($name, $source, $type ?: Assets::TYPE_FILE);
} }
if (!empty($assets['javascript'])) { 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); $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\Leaflet\Model\MapModel;
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager; use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
use Netzmacht\Contao\Toolkit\View\Template\TemplateReference; use Netzmacht\Contao\Toolkit\View\Template\TemplateReference;
use Netzmacht\Contao\Toolkit\View\Template\TemplateRenderer;
use Netzmacht\LeafletPHP\Definition\Map; use Netzmacht\LeafletPHP\Definition\Map;
use Netzmacht\LeafletPHP\Leaflet; use Netzmacht\LeafletPHP\Leaflet;
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection; use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
use Symfony\Component\EventDispatcher\EventDispatcherInterface as EventDispatcher; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
use Symfony\Component\Templating\EngineInterface as TemplateEngine;
/** /**
* Class MapProvider. * Class MapProvider.
@@ -94,11 +94,11 @@ class MapProvider
private $repositoryManager; private $repositoryManager;
/** /**
* Template engine. * Template renderer.
* *
* @var TemplateEngine * @var TemplateRenderer
*/ */
private $templateEngine; private $templateRenderer;
/** /**
* Construct. * Construct.
@@ -111,7 +111,7 @@ class MapProvider
* @param Cache $cache Cache. * @param Cache $cache Cache.
* @param DataController $dataController Data controller. * @param DataController $dataController Data controller.
* @param RepositoryManager $repositoryManager Repository manager. * @param RepositoryManager $repositoryManager Repository manager.
* @param TemplateEngine $templateEngine Template engine. * @param TemplateRenderer $templateRenderer Template rednerer.
*/ */
public function __construct( public function __construct(
DefinitionMapper $mapper, DefinitionMapper $mapper,
@@ -122,7 +122,7 @@ class MapProvider
Cache $cache, Cache $cache,
DataController $dataController, DataController $dataController,
RepositoryManager $repositoryManager, RepositoryManager $repositoryManager,
TemplateEngine $templateEngine TemplateRenderer $templateRenderer
) { ) {
$this->mapper = $mapper; $this->mapper = $mapper;
$this->leaflet = $leaflet; $this->leaflet = $leaflet;
@@ -132,7 +132,7 @@ class MapProvider
$this->cache = $cache; $this->cache = $cache;
$this->dataController = $dataController; $this->dataController = $dataController;
$this->repositoryManager = $repositoryManager; $this->repositoryManager = $repositoryManager;
$this->templateEngine = $templateEngine; $this->templateRenderer = $templateRenderer;
} }
/** /**
@@ -374,7 +374,7 @@ class MapProvider
$javascript = $this->leaflet->build($definition, $this->assets); $javascript = $this->leaflet->build($definition, $this->assets);
$mapId = $definition->getId(); $mapId = $definition->getId();
$templateReference = new TemplateReference($template, 'html5', TemplateReference::SCOPE_FRONTEND); $templateReference = 'fe:' . $template;
$parameters = [ $parameters = [
'definition' => $definition, 'definition' => $definition,
'model' => $model, 'model' => $model,
@@ -384,12 +384,16 @@ class MapProvider
'mapId' => $mapId, 'mapId' => $mapId,
]; ];
$content = $this->templateEngine->render($templateReference, $parameters); $content = $this->templateRenderer->render($templateReference, $parameters);
$event = new GetJavascriptEvent($definition, $content); $content = preg_replace(
$this->eventDispatcher->dispatch($event::NAME, $event); ['/^<!-- 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\Feature;
use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection; use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonFeature; 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. * Class DefinitionMapper is the main mapper instance which contains all other mappers as children.
@@ -111,7 +111,7 @@ class DefinitionMapper
if ($definition) { if ($definition) {
$event = new BuildDefinitionEvent($definition, $model, $request); $event = new BuildDefinitionEvent($definition, $model, $request);
$this->eventDispatcher->dispatch($event::NAME, $event); $this->eventDispatcher->dispatch($event, $event::NAME);
} }
$this->mapped[$hash] = $definition; $this->mapped[$hash] = $definition;
@@ -172,7 +172,7 @@ class DefinitionMapper
} }
$event = new ConvertToGeoJsonEvent($definition, $feature, $model); $event = new ConvertToGeoJsonEvent($definition, $feature, $model);
$this->eventDispatcher->dispatch($event::NAME, $event); $this->eventDispatcher->dispatch($event, $event::NAME);
return $feature; return $feature;
} }
@@ -190,7 +190,7 @@ class DefinitionMapper
private function hash($model, $elementId = null) private function hash($model, $elementId = null)
{ {
$event = new GetHashEvent($model); $event = new GetHashEvent($model);
$this->eventDispatcher->dispatch($event::NAME, $event); $this->eventDispatcher->dispatch($event, $event::NAME);
$hash = $event->getHash(); $hash = $event->getHash();
if (!$hash) { if (!$hash) {

View File

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

View File

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

View File

@@ -210,6 +210,10 @@ class OptionsBuilder
foreach ($options as $option => $mapping) { foreach ($options as $option => $mapping) {
$default = static::getDefaultOption($option, $definition); $default = static::getDefaultOption($option, $definition);
if ($model->$mapping === null) {
continue;
}
if ($model->$mapping === '1' || $model->$mapping === '') { if ($model->$mapping === '1' || $model->$mapping === '') {
if (((bool) $model->$mapping) !== $default) { if (((bool) $model->$mapping) !== $default) {
static::applyOption($option, $model->$mapping, $definition); static::applyOption($option, $model->$mapping, $definition);

View File

@@ -71,16 +71,10 @@ class ImageIconMapper extends AbstractIconMapper
Request $request = null, Request $request = null,
$elementId = null $elementId = null
) { ) {
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId); $arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
$repository = $this->repositoryManager->getRepository(FilesModel::class);
if ($model->iconImage) { $file = $repository->findByUuid($model->iconImage);
$repository = $this->repositoryManager->getRepository(FilesModel::class); $arguments[] = $file ? $file->path : '';
$file = $repository->findByUuid($model->iconImage);
if ($file) {
$arguments[] = $file->path;
}
}
return $arguments; return $arguments;
} }
@@ -117,8 +111,6 @@ class ImageIconMapper extends AbstractIconMapper
$file = $repository->findByUuid($model->iconImage); $file = $repository->findByUuid($model->iconImage);
if ($file) { if ($file) {
$definition->setIconUrl($file->path);
$file = new File($file->path); $file = new File($file->path);
$definition->setIconSize([$file->width, $file->height]); $definition->setIconSize([$file->width, $file->height]);

View File

@@ -41,6 +41,7 @@ SELECT l.*, c.mode as controlMode
FROM tl_leaflet_layer l FROM tl_leaflet_layer l
LEFT JOIN tl_leaflet_control_layer c ON l.id = c.lid LEFT JOIN tl_leaflet_control_layer c ON l.id = c.lid
WHERE c.cid=? WHERE c.cid=?
ORDER BY c.sorting
SQL; SQL;
$result = Database::getInstance() $result = Database::getInstance()
@@ -67,6 +68,7 @@ FROM tl_leaflet_layer l
LEFT JOIN tl_leaflet_control_layer LEFT JOIN tl_leaflet_control_layer
c ON l.id = c.lid c ON l.id = c.lid
WHERE c.cid=? AND l.active=1 WHERE c.cid=? AND l.active=1
ORDER BY c.sorting
SQL; SQL;
$result = Database::getInstance() $result = Database::getInstance()

View File

@@ -17,7 +17,6 @@ use Netzmacht\Contao\Leaflet\Filter\BboxFilter;
use Netzmacht\Contao\Leaflet\Filter\DistanceFilter; use Netzmacht\Contao\Leaflet\Filter\DistanceFilter;
use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Filter\Filter;
use Netzmacht\LeafletPHP\Value\LatLngBounds; use Netzmacht\LeafletPHP\Value\LatLngBounds;
use function var_dump;
/** /**
* Class MarkerModel for the tl_leaflet_marker table. * Class MarkerModel for the tl_leaflet_marker table.
@@ -50,8 +49,8 @@ class MarkerModel extends AbstractActiveModel
[ [
$table . '.active=1', $table . '.active=1',
$table . '.pid=?', $table . '.pid=?',
$table . '.latitude>0', $table . '.latitude IS NOT NULL',
$table . '.longitude>0', $table . '.longitude IS NOT NULL',
], ],
[$pid], [$pid],
['order' => 'sorting'] ['order' => 'sorting']