forked from Snck3rs/contao-leaflet-maps
Compare commits
5 Commits
3.1.4
...
feature/pe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdca0adb56 | ||
|
|
20efff72d9 | ||
|
|
fa1ceb9402 | ||
|
|
f2959b2df0 | ||
|
|
d7fbc361d7 |
20
.travis.yml
20
.travis.yml
@@ -1,18 +1,8 @@
|
|||||||
dist: xenial
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- ant-optional
|
|
||||||
|
|
||||||
language: php
|
language: php
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- "7.3"
|
|
||||||
- "7.2"
|
|
||||||
- "7.1"
|
- "7.1"
|
||||||
- "7.4snapshot"
|
- "7.2"
|
||||||
- "nightly"
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- CONTAO_VERSION=contao/core-bundle ~4.4.0
|
- CONTAO_VERSION=contao/core-bundle ~4.4.0
|
||||||
@@ -21,12 +11,10 @@ env:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
exclude:
|
exclude:
|
||||||
allow_failures:
|
|
||||||
- php: "nightly"
|
|
||||||
- php: "7.4snapshot"
|
|
||||||
|
|
||||||
before_script:
|
sudo: false
|
||||||
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
|
||||||
|
install:
|
||||||
- travis_retry composer self-update && composer --version
|
- travis_retry composer self-update && composer --version
|
||||||
- travis_retry composer require $CONTAO_VERSION --no-update
|
- travis_retry composer require $CONTAO_VERSION --no-update
|
||||||
- travis_retry composer update --prefer-dist --no-interaction
|
- travis_retry composer update --prefer-dist --no-interaction
|
||||||
|
|||||||
80
CHANGELOG.md
80
CHANGELOG.md
@@ -6,46 +6,9 @@ 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.4] - 2019-02-13
|
## 3.1.1 - 2018-12-07
|
||||||
|
|
||||||
### Fixed
|
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...3.1.1)
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- Fix broken api routes in Contao 4.6/Symfony 4 (#69)
|
|
||||||
- Fix broken about.html.twig template. Error block was missing
|
|
||||||
|
|
||||||
## 3.1.2 - 2018-12-18
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.1...3.1.2)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix broken MapBox integration: Access token is now required
|
|
||||||
- Fix broken OpenWeatherMap integration: Api key is now required
|
|
||||||
- Fix broken Thunderforest integration: Api key is now required
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Add missing OpenPtMap of leaflet-providers
|
|
||||||
- Add missing OpenRailwayMap of leaflet-providers
|
|
||||||
- Add missing OpenFireMap of leaflet-providers
|
|
||||||
- Add missing SafeCast of leaflet-providers
|
|
||||||
- Add missing map types `normalNightTransit`, `normalNightTransitMobile`, `reducedDay`, `reducedNight`,
|
|
||||||
`hybridDayTransit` and `hybridDayGrey` of HERE provider
|
|
||||||
- Add missing map types `Voyager`, `VoyagerNoLabels`, `VoyagerOnlyLabels` and `VoyagerLabelsUnder` of CartoDB provider
|
|
||||||
- Add missing Wikimedia of leaflet-providers
|
|
||||||
- Add missing GeoportailFrance of leaflet-providers
|
|
||||||
- Add missing OneMapSG of leaflet-providers
|
|
||||||
|
|
||||||
## [3.1.1] - 2018-12-07
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
@@ -79,31 +42,43 @@ 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
|
||||||
|
|
||||||
@@ -114,7 +89,9 @@ Bugfixes
|
|||||||
- Broken service definitions
|
- Broken service definitions
|
||||||
- Broken file layer id
|
- Broken file layer id
|
||||||
|
|
||||||
## [3.0.0-alpha2] - 2017-10-19
|
## 3.0.0-alpha1 - 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
|
||||||
|
|
||||||
@@ -123,14 +100,3 @@ 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
|
||||||
|
|
||||||
[3.1.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.2...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
|
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -2,9 +2,9 @@ Leaflet integration into Contao CMS
|
|||||||
===================================
|
===================================
|
||||||
|
|
||||||
[](https://travis-ci.org/netzmacht/contao-leaflet-maps)
|
[](https://travis-ci.org/netzmacht/contao-leaflet-maps)
|
||||||
[](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
|
[](http://packagist.com/packages/netzmacht/contao-leaflet-maps)
|
||||||
[](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
|
[](http://packagist.com/packages/netzmacht/contao-leaflet-maps)
|
||||||
[](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
|
[](http://packagist.com/packages/netzmacht/contao-leaflet-maps)
|
||||||
[](https://github.com/contao-community-alliance/coding-standard)
|
[](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,12 +38,6 @@ 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
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "netzmacht/contao-leaflet-maps",
|
"name": "netzmacht/contao-leaflet-maps",
|
||||||
"type": "contao-bundle",
|
|
||||||
"description": "Contao Leaflet maps integration",
|
"description": "Contao Leaflet maps integration",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"contao",
|
"contao",
|
||||||
"maps",
|
"maps",
|
||||||
"leaflet"
|
"leaflet"
|
||||||
],
|
],
|
||||||
|
"type": "contao-bundle",
|
||||||
"license": "LGPL-3.0-or-later",
|
"license": "LGPL-3.0-or-later",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
@@ -16,48 +16,39 @@
|
|||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"email": "mail@netzmacht.de",
|
||||||
|
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
|
||||||
|
"source": "https://github.com/netzmacht/contao-leaflet-maps"
|
||||||
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.1",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"contao-community-alliance/meta-palettes": "^2.0 || ^1.11",
|
|
||||||
"contao/core-bundle": "~4.4",
|
"contao/core-bundle": "~4.4",
|
||||||
"doctrine/cache": "^1.0",
|
|
||||||
"doctrine/dbal": "^2.5",
|
"doctrine/dbal": "^2.5",
|
||||||
"menatwork/contao-multicolumnwizard": "^3.3",
|
|
||||||
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
|
|
||||||
"netzmacht/contao-leaflet-libraries": "^1.3.4",
|
|
||||||
"netzmacht/contao-page-context": "~1.0",
|
|
||||||
"netzmacht/contao-toolkit": "~3.0",
|
|
||||||
"netzmacht/php-javascript-builder": "^1.0",
|
|
||||||
"netzmacht/php-leaflet": "^1.1.0",
|
|
||||||
"symfony/config": "~3.3 || ~4.0",
|
"symfony/config": "~3.3 || ~4.0",
|
||||||
"symfony/dependency-injection": "~3.3 || ~4.0",
|
|
||||||
"symfony/event-dispatcher": "~3.3 || ~4.0",
|
"symfony/event-dispatcher": "~3.3 || ~4.0",
|
||||||
|
"symfony/dependency-injection": "~3.3 || ~4.0",
|
||||||
"symfony/filesystem": "~3.3 || ~4.0",
|
"symfony/filesystem": "~3.3 || ~4.0",
|
||||||
"symfony/http-kernel": "~3.3 || ~4.0",
|
"symfony/http-kernel": "~3.3 || ~4.0",
|
||||||
|
"symfony/translation": "~3.3 || ~4.0",
|
||||||
"symfony/templating": "~3.3 || ~4.0",
|
"symfony/templating": "~3.3 || ~4.0",
|
||||||
"symfony/translation": "~3.3 || ~4.0"
|
"netzmacht/contao-leaflet-libraries": "^1.0",
|
||||||
|
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
|
||||||
|
"netzmacht/php-javascript-builder": "^1.0",
|
||||||
|
"netzmacht/php-leaflet": "^1.0.2",
|
||||||
|
"netzmacht/contao-toolkit": "~3.0",
|
||||||
|
"netzmacht/contao-page-context": "~1.0",
|
||||||
|
"contao-community-alliance/meta-palettes": "^2.0 || ^1.5",
|
||||||
|
"menatwork/contao-multicolumnwizard": "^3.2",
|
||||||
|
"doctrine/cache": "^1.0",
|
||||||
|
"codefog/contao-widget_tree_picker": "^2.4"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
"phpcq/all-tasks": "^1.2",
|
||||||
"contao/manager-plugin": "^2.1",
|
"contao/manager-plugin": "^2.1",
|
||||||
"phpcq/all-tasks": "^1.2"
|
"phpstan/phpstan": "^0.10.3"
|
||||||
},
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "3.1.x-dev",
|
|
||||||
"dev-develop": "3.2.x-dev",
|
|
||||||
"dev-support/2.x": "2.0.x-dev"
|
|
||||||
},
|
|
||||||
"contao": {
|
|
||||||
"transifex": {
|
|
||||||
"project": "contao-leaflet-maps",
|
|
||||||
"prefix": "core-",
|
|
||||||
"languages_cto": "src/Bundle/Resources/contao/languages",
|
|
||||||
"languages_tx": ".tx"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\Bundle\\ContaoManager\\Plugin"
|
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -69,10 +60,20 @@
|
|||||||
"vendor/phpcq/autoload-validation/hacks/contao-hack.php"
|
"vendor/phpcq/autoload-validation/hacks/contao-hack.php"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"support": {
|
"extra": {
|
||||||
"email": "mail@netzmacht.de",
|
"branch-alias": {
|
||||||
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
|
"dev-master": "3.1.x-dev",
|
||||||
"source": "https://github.com/netzmacht/contao-leaflet-maps",
|
"dev-develop": "3.2.x-dev",
|
||||||
"docs": "http://leaflet-maps-for-contao.readthedocs.org/"
|
"dev-support/2.x": "2.0.x-dev"
|
||||||
|
},
|
||||||
|
"contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\Bundle\\ContaoManager\\Plugin",
|
||||||
|
"contao": {
|
||||||
|
"transifex": {
|
||||||
|
"project": "contao-leaflet-maps",
|
||||||
|
"prefix": "core-",
|
||||||
|
"languages_cto": "src/Bundle/Resources/contao/languages",
|
||||||
|
"languages_tx": ".tx"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ services:
|
|||||||
- '@netzmacht.contao_toolkit.repository_manager'
|
- '@netzmacht.contao_toolkit.repository_manager'
|
||||||
- '@translator'
|
- '@translator'
|
||||||
- '@netzmacht.contao_leaflet.layer_label_renderer'
|
- '@netzmacht.contao_leaflet.layer_label_renderer'
|
||||||
|
- '@netzmacht.contao_toolkit.contao.backend_user'
|
||||||
|
- '@netzmacht.contao_toolkit.dca.listeners.state_button_callback'
|
||||||
- '@netzmacht.contao_toolkit.contao.backend_adapter'
|
- '@netzmacht.contao_toolkit.contao.backend_adapter'
|
||||||
- '%netzmacht.contao_leaflet.layers%'
|
- '%netzmacht.contao_leaflet.layers%'
|
||||||
- '%netzmacht.contao_leaflet.providers%'
|
- '%netzmacht.contao_leaflet.providers%'
|
||||||
@@ -63,6 +65,7 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
- '@database_connection'
|
- '@database_connection'
|
||||||
- '@netzmacht.contao_toolkit.repository_manager'
|
- '@netzmacht.contao_toolkit.repository_manager'
|
||||||
|
- '@netzmacht.contao_toolkit.contao.backend_user'
|
||||||
|
|
||||||
netzmacht.contao_leaflet.listeners.dca.vector:
|
netzmacht.contao_leaflet.listeners.dca.vector:
|
||||||
class: Netzmacht\Contao\Leaflet\Listener\Dca\VectorDcaListener
|
class: Netzmacht\Contao\Leaflet\Listener\Dca\VectorDcaListener
|
||||||
@@ -70,20 +73,52 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
- '@netzmacht.contao_toolkit.dca.manager'
|
- '@netzmacht.contao_toolkit.dca.manager'
|
||||||
- '@netzmacht.contao_toolkit.repository_manager'
|
- '@netzmacht.contao_toolkit.repository_manager'
|
||||||
|
- '@netzmacht.contao_toolkit.contao.backend_user'
|
||||||
- '%netzmacht.contao_leaflet.vectors%'
|
- '%netzmacht.contao_leaflet.vectors%'
|
||||||
|
|
||||||
netzmacht.contao_leaflet.listeners.dca.icon:
|
netzmacht.contao_leaflet.listeners.dca.icon:
|
||||||
class: Netzmacht\Contao\Leaflet\Listener\Dca\IconDcaListener
|
class: Netzmacht\Contao\Leaflet\Listener\Dca\IconDcaListener
|
||||||
public: true
|
public: true
|
||||||
arguments:
|
arguments:
|
||||||
|
- '@netzmacht.contao_toolkit.contao.backend_user'
|
||||||
- '%netzmacht.contao_leaflet.icons%'
|
- '%netzmacht.contao_leaflet.icons%'
|
||||||
|
|
||||||
netzmacht.contao_leaflet.listeners.dca.style:
|
netzmacht.contao_leaflet.listeners.dca.style:
|
||||||
class: Netzmacht\Contao\Leaflet\Listener\Dca\StyleDcaListener
|
class: Netzmacht\Contao\Leaflet\Listener\Dca\StyleDcaListener
|
||||||
public: true
|
public: true
|
||||||
arguments:
|
arguments:
|
||||||
|
- '@netzmacht.contao_toolkit.contao.backend_user'
|
||||||
- '%netzmacht.contao_leaflet.styles%'
|
- '%netzmacht.contao_leaflet.styles%'
|
||||||
|
|
||||||
|
netzmacht.contao_leaflet.listeners.dca.popup:
|
||||||
|
class: Netzmacht\Contao\Leaflet\Listener\Dca\PopupDcaListener
|
||||||
|
public: true
|
||||||
|
arguments:
|
||||||
|
- '@netzmacht.contao_toolkit.contao.backend_user'
|
||||||
|
|
||||||
|
netzmacht.contao_leaflet.listeners.dca.user:
|
||||||
|
class: Netzmacht\Contao\Leaflet\Listener\Dca\UserDcaListener
|
||||||
|
public: true
|
||||||
|
arguments:
|
||||||
|
- '@netzmacht.contao_toolkit.dca.manager'
|
||||||
|
- '@netzmacht.contao_leaflet.layer_label_renderer'
|
||||||
|
- '@translator'
|
||||||
|
- '%netzmacht.contao_leaflet.layers%'
|
||||||
|
-
|
||||||
|
netzmacht.contao_leaflet.listeners.dca.user_group:
|
||||||
|
class: Netzmacht\Contao\Leaflet\Listener\Dca\UserGroupDcaListener
|
||||||
|
public: true
|
||||||
|
arguments:
|
||||||
|
- '@netzmacht.contao_toolkit.dca.manager'
|
||||||
|
- '@netzmacht.contao_leaflet.layer_label_renderer'
|
||||||
|
- '@translator'
|
||||||
|
- '%netzmacht.contao_leaflet.layers%'
|
||||||
|
|
||||||
|
Netzmacht\Contao\Leaflet\Listener\Dca\OperationsListener:
|
||||||
|
public: true
|
||||||
|
arguments:
|
||||||
|
- '@netzmacht.contao_toolkit.contao.backend_user'
|
||||||
|
|
||||||
netzmacht.contao_leaflet.listeners.geo_json_listener:
|
netzmacht.contao_leaflet.listeners.geo_json_listener:
|
||||||
class: Netzmacht\Contao\Leaflet\Listener\GeoJsonListener
|
class: Netzmacht\Contao\Leaflet\Listener\GeoJsonListener
|
||||||
arguments:
|
arguments:
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
parameters:
|
parameters:
|
||||||
netzmacht.contao_leaflet.providers:
|
netzmacht.contao_leaflet.providers:
|
||||||
OpenStreetMap:
|
OpenStreetMap:
|
||||||
variants: ['Mapnik', 'BlackAndWhite', 'DE', 'CH', 'France', 'HOT', 'BZH']
|
variants: ['Mapnik', 'BlackAndWhite', 'DE', 'France', 'HOT', 'BZH']
|
||||||
|
|
||||||
OpenSeaMap: []
|
OpenSeaMap: []
|
||||||
|
|
||||||
OpenTopoMap: []
|
OpenTopoMap: []
|
||||||
|
|
||||||
OpenPtMap: []
|
|
||||||
|
|
||||||
OpenRailwayMap: []
|
|
||||||
|
|
||||||
OpenFireMap: []
|
|
||||||
|
|
||||||
SafeCast: []
|
|
||||||
|
|
||||||
Thunderforest:
|
Thunderforest:
|
||||||
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\ThunderforestProvider'
|
|
||||||
variants:
|
variants:
|
||||||
- 'OpenCycleMap'
|
- 'OpenCycleMap'
|
||||||
- 'Transport'
|
- 'Transport'
|
||||||
@@ -25,9 +16,6 @@ parameters:
|
|||||||
- 'Landscape'
|
- 'Landscape'
|
||||||
- 'Outdoors'
|
- 'Outdoors'
|
||||||
- 'Pioneer'
|
- 'Pioneer'
|
||||||
options:
|
|
||||||
apiKey: 'tile_provider_key'
|
|
||||||
fields: ['tile_provider_key']
|
|
||||||
|
|
||||||
OpenMapSurfer:
|
OpenMapSurfer:
|
||||||
variants: ['Roads', 'AdminBounds', 'Grayscale']
|
variants: ['Roads', 'AdminBounds', 'Grayscale']
|
||||||
@@ -38,8 +26,7 @@ parameters:
|
|||||||
MapBox:
|
MapBox:
|
||||||
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\MapBoxProvider'
|
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\MapBoxProvider'
|
||||||
options:
|
options:
|
||||||
accessToken: 'tile_provider_key'
|
key: 'tile_provider_key'
|
||||||
fields: ['tile_provider_key']
|
|
||||||
|
|
||||||
Stamen:
|
Stamen:
|
||||||
variants:
|
variants:
|
||||||
@@ -69,7 +56,6 @@ parameters:
|
|||||||
- 'WorldGrayCanvas'
|
- 'WorldGrayCanvas'
|
||||||
|
|
||||||
OpenWeatherMap:
|
OpenWeatherMap:
|
||||||
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\OpenWeatherMapProvider'
|
|
||||||
variants:
|
variants:
|
||||||
- 'Clouds'
|
- 'Clouds'
|
||||||
- 'CloudsClassic'
|
- 'CloudsClassic'
|
||||||
@@ -82,9 +68,6 @@ parameters:
|
|||||||
- 'Wind'
|
- 'Wind'
|
||||||
- 'Temperature'
|
- 'Temperature'
|
||||||
- 'Snow'
|
- 'Snow'
|
||||||
options:
|
|
||||||
apiKey: 'tile_provider_key'
|
|
||||||
fields: ['tile_provider_key']
|
|
||||||
|
|
||||||
HERE:
|
HERE:
|
||||||
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\HereProvider'
|
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\HereProvider'
|
||||||
@@ -100,18 +83,12 @@ parameters:
|
|||||||
- 'normalNightMobile'
|
- 'normalNightMobile'
|
||||||
- 'normalNightGrey'
|
- 'normalNightGrey'
|
||||||
- 'normalNightGreyMobile'
|
- 'normalNightGreyMobile'
|
||||||
- 'normalNightTransit'
|
|
||||||
- 'normalNightTransitMobile'
|
|
||||||
- 'reducedDay'
|
|
||||||
- 'reducedNight'
|
|
||||||
- 'basicMap'
|
- 'basicMap'
|
||||||
- 'mapLabels'
|
- 'mapLabels'
|
||||||
- 'trafficFlow'
|
- 'trafficFlow'
|
||||||
- 'carnavDayGrey'
|
- 'carnavDayGrey'
|
||||||
- 'hybridDay'
|
- 'hybridDay'
|
||||||
- 'hybridDayMobile'
|
- 'hybridDayMobile'
|
||||||
- 'hybridDayTransit'
|
|
||||||
- 'hybridDayGrey'
|
|
||||||
- 'pedestrianDay'
|
- 'pedestrianDay'
|
||||||
- 'pedestrianNight'
|
- 'pedestrianNight'
|
||||||
- 'satelliteDay'
|
- 'satelliteDay'
|
||||||
@@ -146,10 +123,6 @@ parameters:
|
|||||||
- 'DarkMatter'
|
- 'DarkMatter'
|
||||||
- 'DarkMatterNoLabels'
|
- 'DarkMatterNoLabels'
|
||||||
- 'DarkMatterOnlyLabels'
|
- 'DarkMatterOnlyLabels'
|
||||||
- 'Voyager'
|
|
||||||
- 'VoyagerNoLabels'
|
|
||||||
- 'VoyagerOnlyLabels'
|
|
||||||
- 'VoyagerLabelsUnder'
|
|
||||||
|
|
||||||
HikeBike:
|
HikeBike:
|
||||||
variants:
|
variants:
|
||||||
@@ -182,20 +155,3 @@ parameters:
|
|||||||
- 'ModisTerraChlorophyll'
|
- 'ModisTerraChlorophyll'
|
||||||
|
|
||||||
NLS: []
|
NLS: []
|
||||||
|
|
||||||
Wikimedia: []
|
|
||||||
|
|
||||||
GeoportailFrance:
|
|
||||||
variants:
|
|
||||||
- 'parcels'
|
|
||||||
- 'ignMaps'
|
|
||||||
- 'maps'
|
|
||||||
- 'orthos'
|
|
||||||
|
|
||||||
OneMapSG:
|
|
||||||
variants:
|
|
||||||
- 'Default'
|
|
||||||
- 'Night'
|
|
||||||
- 'Original'
|
|
||||||
- 'Grey'
|
|
||||||
- 'LandLot'
|
|
||||||
|
|||||||
@@ -128,13 +128,11 @@ services:
|
|||||||
- { name: Netzmacht\Contao\PageContext\Request\PageIdDeterminator }
|
- { name: Netzmacht\Contao\PageContext\Request\PageIdDeterminator }
|
||||||
|
|
||||||
Netzmacht\Contao\Leaflet\Frontend\Action\LayerDataAction:
|
Netzmacht\Contao\Leaflet\Frontend\Action\LayerDataAction:
|
||||||
public: true
|
|
||||||
arguments:
|
arguments:
|
||||||
- '@netzmacht.contao_leaflet.map.provider'
|
- '@netzmacht.contao_leaflet.map.provider'
|
||||||
- '@netzmacht.contao_leaflet.filter_factory'
|
- '@netzmacht.contao_leaflet.filter_factory'
|
||||||
|
|
||||||
Netzmacht\Contao\Leaflet\Backend\Action\AboutAction:
|
Netzmacht\Contao\Leaflet\Backend\Action\AboutAction:
|
||||||
public: true
|
|
||||||
arguments:
|
arguments:
|
||||||
- '@templating'
|
- '@templating'
|
||||||
- '%kernel.project_dir%'
|
- '%kernel.project_dir%'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Backend module.
|
* Backend modules
|
||||||
*/
|
*/
|
||||||
|
|
||||||
array_insert(
|
array_insert(
|
||||||
@@ -44,12 +44,13 @@ array_insert(
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (defined('TL_MODE') && TL_MODE === 'BE') {
|
if (TL_MODE === 'BE') {
|
||||||
$GLOBALS['TL_CSS'][] = 'bundles/netzmachtcontaoleaflet/css/backend_global.css';
|
$GLOBALS['TL_CSS'][] = 'bundles/netzmachtcontaoleaflet/css/backend_global.css';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Models.
|
* Models
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$GLOBALS['TL_MODELS']['tl_leaflet_control'] = \Netzmacht\Contao\Leaflet\Model\ControlModel::class;
|
$GLOBALS['TL_MODELS']['tl_leaflet_control'] = \Netzmacht\Contao\Leaflet\Model\ControlModel::class;
|
||||||
@@ -60,3 +61,12 @@ $GLOBALS['TL_MODELS']['tl_leaflet_marker'] = \Netzmacht\Contao\Leaflet\Model\Ma
|
|||||||
$GLOBALS['TL_MODELS']['tl_leaflet_popup'] = \Netzmacht\Contao\Leaflet\Model\PopupModel::class;
|
$GLOBALS['TL_MODELS']['tl_leaflet_popup'] = \Netzmacht\Contao\Leaflet\Model\PopupModel::class;
|
||||||
$GLOBALS['TL_MODELS']['tl_leaflet_style'] = \Netzmacht\Contao\Leaflet\Model\StyleModel::class;
|
$GLOBALS['TL_MODELS']['tl_leaflet_style'] = \Netzmacht\Contao\Leaflet\Model\StyleModel::class;
|
||||||
$GLOBALS['TL_MODELS']['tl_leaflet_vector'] = \Netzmacht\Contao\Leaflet\Model\VectorModel::class;
|
$GLOBALS['TL_MODELS']['tl_leaflet_vector'] = \Netzmacht\Contao\Leaflet\Model\VectorModel::class;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Permissions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$GLOBALS['TL_PERMISSIONS'][] = 'leaflet_layers';
|
||||||
|
$GLOBALS['TL_PERMISSIONS'][] = 'leaflet_layer_permissions';
|
||||||
|
$GLOBALS['TL_PERMISSIONS'][] = 'leaflet_tables';
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ $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' => [
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
* @filesource
|
* @filesource
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Netzmacht\Contao\Leaflet\Listener\Dca\OperationsListener;
|
||||||
|
|
||||||
$GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
|
$GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
|
||||||
'config' => [
|
'config' => [
|
||||||
'dataContainer' => 'Table',
|
'dataContainer' => 'Table',
|
||||||
@@ -20,6 +22,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
|
|||||||
'alias' => 'unique',
|
'alias' => 'unique',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'onload_callback' => [
|
||||||
|
['netzmacht.contao_leaflet.listeners.dca.icon', 'checkPermission'],
|
||||||
|
],
|
||||||
'onsubmit_callback' => [
|
'onsubmit_callback' => [
|
||||||
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
||||||
],
|
],
|
||||||
@@ -45,16 +50,19 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
|
|||||||
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
||||||
],
|
],
|
||||||
'styles' => [
|
'styles' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['styles'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['styles'],
|
||||||
'href' => 'table=tl_leaflet_style',
|
'href' => 'table=tl_leaflet_style',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'styleOperation'],
|
||||||
|
|
||||||
],
|
],
|
||||||
'popups' => [
|
'popups' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['popups'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['popups'],
|
||||||
'href' => 'table=tl_leaflet_popup',
|
'href' => 'table=tl_leaflet_popup',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'popupOperation'],
|
||||||
],
|
],
|
||||||
'all' => [
|
'all' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
||||||
@@ -179,14 +187,7 @@ $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' => [
|
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||||
'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',
|
||||||
|
|||||||
@@ -10,14 +10,13 @@
|
|||||||
* @filesource
|
* @filesource
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Netzmacht\Contao\Leaflet\Listener\Dca\OperationsListener;
|
||||||
|
|
||||||
$GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
$GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
||||||
'config' => [
|
'config' => [
|
||||||
'dataContainer' => 'Table',
|
'dataContainer' => 'Table',
|
||||||
'enableVersioning' => true,
|
'enableVersioning' => true,
|
||||||
'ctable' => ['tl_leaflet_vector', 'tl_leaflet_marker'],
|
'ctable' => ['tl_leaflet_vector', 'tl_leaflet_marker'],
|
||||||
'ondelete_callback' => [
|
|
||||||
['netzmacht.contao_leaflet.listeners.dca.layer', 'deleteRelations'],
|
|
||||||
],
|
|
||||||
'sql' => [
|
'sql' => [
|
||||||
'keys' => [
|
'keys' => [
|
||||||
'id' => 'primary',
|
'id' => 'primary',
|
||||||
@@ -26,8 +25,12 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'onload_callback' => [
|
'onload_callback' => [
|
||||||
|
['netzmacht.contao_leaflet.listeners.dca.layer', 'checkPermissions'],
|
||||||
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
|
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
|
||||||
],
|
],
|
||||||
|
'ondelete_callback' => [
|
||||||
|
['netzmacht.contao_leaflet.listeners.dca.layer', 'deleteRelations'],
|
||||||
|
],
|
||||||
'onsubmit_callback' => [
|
'onsubmit_callback' => [
|
||||||
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
||||||
],
|
],
|
||||||
@@ -48,22 +51,25 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
|||||||
],
|
],
|
||||||
'global_operations' => [
|
'global_operations' => [
|
||||||
'styles' => [
|
'styles' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'],
|
||||||
'href' => 'table=tl_leaflet_style',
|
'href' => 'table=tl_leaflet_style',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'styleOperation'],
|
||||||
],
|
],
|
||||||
'icons' => [
|
'icons' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'],
|
||||||
'href' => 'table=tl_leaflet_icon',
|
'href' => 'table=tl_leaflet_icon',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'iconOperation'],
|
||||||
],
|
],
|
||||||
'popups' => [
|
'popups' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'],
|
||||||
'href' => 'table=tl_leaflet_popup',
|
'href' => 'table=tl_leaflet_popup',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'popupOperation'],
|
||||||
],
|
],
|
||||||
'all' => [
|
'all' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
||||||
@@ -86,27 +92,31 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
|||||||
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateVectorsButton'],
|
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateVectorsButton'],
|
||||||
],
|
],
|
||||||
'edit' => [
|
'edit' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['edit'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['edit'],
|
||||||
'href' => 'act=edit',
|
'href' => 'act=edit',
|
||||||
'icon' => 'header.gif',
|
'icon' => 'header.gif',
|
||||||
|
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateEditButton'],
|
||||||
],
|
],
|
||||||
'copy' => [
|
'copy' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['copy'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['copy'],
|
||||||
'href' => 'act=copy',
|
'href' => 'act=copy',
|
||||||
'icon' => 'copy.gif',
|
'icon' => 'copy.gif',
|
||||||
|
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateCopyButton'],
|
||||||
],
|
],
|
||||||
'cut' => [
|
'cut' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cut'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cut'],
|
||||||
'href' => 'act=paste&mode=cut',
|
'href' => 'act=paste&mode=cut',
|
||||||
'icon' => 'cut.gif',
|
'icon' => 'cut.gif',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset()"',
|
'attributes' => 'onclick="Backend.getScrollOffset()"',
|
||||||
|
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateEditButton'],
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['delete'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['delete'],
|
||||||
'href' => 'act=delete',
|
'href' => 'act=delete',
|
||||||
'icon' => 'delete.gif',
|
'icon' => 'delete.gif',
|
||||||
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
|
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
|
||||||
. '\'))return false;Backend.getScrollOffset()"',
|
. '\'))return false;Backend.getScrollOffset()"',
|
||||||
|
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateDeleteButton'],
|
||||||
],
|
],
|
||||||
'toggle' => [
|
'toggle' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['toggle'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['toggle'],
|
||||||
@@ -114,8 +124,8 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
|||||||
'attributes' => 'onclick="Backend.getScrollOffset();
|
'attributes' => 'onclick="Backend.getScrollOffset();
|
||||||
return ContaoLeafletAjaxRequest.toggleVisibility(this,%s)"',
|
return ContaoLeafletAjaxRequest.toggleVisibility(this,%s)"',
|
||||||
'button_callback' => [
|
'button_callback' => [
|
||||||
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
|
'netzmacht.contao_leaflet.listeners.dca.layer',
|
||||||
'handleButtonCallback',
|
'generateToggleButton',
|
||||||
],
|
],
|
||||||
'toolkit' => [
|
'toolkit' => [
|
||||||
'state_button' => [
|
'state_button' => [
|
||||||
@@ -232,10 +242,8 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
|
|||||||
'provider' => ['tile_provider', 'tile_provider_variant'],
|
'provider' => ['tile_provider', 'tile_provider_variant'],
|
||||||
],
|
],
|
||||||
'tile_provider' => [
|
'tile_provider' => [
|
||||||
'MapBox' => ['tile_provider_key'],
|
'MapBox' => ['tile_provider_key'],
|
||||||
'HERE' => ['tile_provider_key', 'tile_provider_code'],
|
'HERE' => ['tile_provider_key', 'tile_provider_code'],
|
||||||
'OpenWeatherMap' => ['tile_provider_key'],
|
|
||||||
'Thunderforest' => ['tile_provider_key'],
|
|
||||||
],
|
],
|
||||||
'fileFormat' => [
|
'fileFormat' => [
|
||||||
'!' => ['file'],
|
'!' => ['file'],
|
||||||
@@ -278,14 +286,7 @@ $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' => [
|
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||||
'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',
|
||||||
|
|||||||
@@ -157,14 +157,7 @@ $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' => [
|
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||||
'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',
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
* @filesource
|
* @filesource
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Netzmacht\Contao\Leaflet\Listener\Dca\OperationsListener;
|
||||||
|
|
||||||
$GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
|
$GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
|
||||||
'config' => [
|
'config' => [
|
||||||
'dataContainer' => 'Table',
|
'dataContainer' => 'Table',
|
||||||
@@ -23,6 +25,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'onload_callback' => [
|
'onload_callback' => [
|
||||||
|
['netzmacht.contao_leaflet.listeners.dca.marker', 'checkPermissions'],
|
||||||
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
|
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
|
||||||
],
|
],
|
||||||
'onsubmit_callback' => [
|
'onsubmit_callback' => [
|
||||||
@@ -45,16 +48,18 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
|
|||||||
],
|
],
|
||||||
'global_operations' => [
|
'global_operations' => [
|
||||||
'icons' => [
|
'icons' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icons'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icons'],
|
||||||
'href' => 'table=tl_leaflet_icon&id=',
|
'href' => 'table=tl_leaflet_icon&id=',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'iconOperation'],
|
||||||
],
|
],
|
||||||
'popups' => [
|
'popups' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popups'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popups'],
|
||||||
'href' => 'table=tl_leaflet_popup',
|
'href' => 'table=tl_leaflet_popup',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'popupOperation'],
|
||||||
],
|
],
|
||||||
'all' => [
|
'all' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
||||||
@@ -160,14 +165,7 @@ $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' => [
|
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||||
'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',
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
* @filesource
|
* @filesource
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Netzmacht\Contao\Leaflet\Listener\Dca\OperationsListener;
|
||||||
|
|
||||||
$GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
|
$GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
|
||||||
'config' => [
|
'config' => [
|
||||||
'dataContainer' => 'Table',
|
'dataContainer' => 'Table',
|
||||||
@@ -20,6 +22,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
|
|||||||
'alias' => 'unique',
|
'alias' => 'unique',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'onload_callback' => [
|
||||||
|
['netzmacht.contao_leaflet.listeners.dca.popup', 'checkPermission'],
|
||||||
|
],
|
||||||
'onsubmit_callback' => [
|
'onsubmit_callback' => [
|
||||||
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
||||||
],
|
],
|
||||||
@@ -45,16 +50,18 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
|
|||||||
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
||||||
],
|
],
|
||||||
'styles' => [
|
'styles' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'],
|
||||||
'href' => 'table=tl_leaflet_style',
|
'href' => 'table=tl_leaflet_style',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'styleOperation'],
|
||||||
],
|
],
|
||||||
'icons' => [
|
'icons' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'],
|
||||||
'href' => 'table=tl_leaflet_icon',
|
'href' => 'table=tl_leaflet_icon',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'iconOperation'],
|
||||||
],
|
],
|
||||||
'all' => [
|
'all' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
||||||
@@ -151,14 +158,7 @@ $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' => [
|
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||||
'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',
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
* @filesource
|
* @filesource
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Netzmacht\Contao\Leaflet\Listener\Dca\OperationsListener;
|
||||||
|
|
||||||
$GLOBALS['TL_DCA']['tl_leaflet_style'] = [
|
$GLOBALS['TL_DCA']['tl_leaflet_style'] = [
|
||||||
'config' => [
|
'config' => [
|
||||||
'dataContainer' => 'Table',
|
'dataContainer' => 'Table',
|
||||||
@@ -20,6 +22,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = [
|
|||||||
'alias' => 'unique',
|
'alias' => 'unique',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'onload_callback' => [
|
||||||
|
['netzmacht.contao_leaflet.listeners.dca.style', 'checkPermission'],
|
||||||
|
],
|
||||||
'onsubmit_callback' => [
|
'onsubmit_callback' => [
|
||||||
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
|
||||||
],
|
],
|
||||||
@@ -45,16 +50,18 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = [
|
|||||||
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
|
||||||
],
|
],
|
||||||
'icons' => [
|
'icons' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'],
|
||||||
'href' => 'table=tl_leaflet_icon',
|
'href' => 'table=tl_leaflet_icon',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'iconOperation'],
|
||||||
],
|
],
|
||||||
'popups' => [
|
'popups' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'],
|
||||||
'href' => 'table=tl_leaflet_popup',
|
'href' => 'table=tl_leaflet_popup',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'popupOperation'],
|
||||||
],
|
],
|
||||||
'all' => [
|
'all' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
||||||
@@ -145,14 +152,7 @@ $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' => [
|
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||||
'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',
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
* @filesource
|
* @filesource
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Netzmacht\Contao\Leaflet\Listener\Dca\OperationsListener;
|
||||||
|
|
||||||
$GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
|
$GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
|
||||||
'config' => [
|
'config' => [
|
||||||
'dataContainer' => 'Table',
|
'dataContainer' => 'Table',
|
||||||
@@ -45,16 +47,18 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
|
|||||||
],
|
],
|
||||||
'global_operations' => [
|
'global_operations' => [
|
||||||
'styles' => [
|
'styles' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['styles'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['styles'],
|
||||||
'href' => 'table=tl_leaflet_style',
|
'href' => 'table=tl_leaflet_style',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'styleOperation'],
|
||||||
],
|
],
|
||||||
'popups' => [
|
'popups' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popups'],
|
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popups'],
|
||||||
'href' => 'table=tl_leaflet_popup',
|
'href' => 'table=tl_leaflet_popup',
|
||||||
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
|
||||||
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
'attributes' => 'onclick="Backend.getScrollOffset();"',
|
||||||
|
'button_callback' => [OperationsListener::class, 'popupOperation'],
|
||||||
],
|
],
|
||||||
'all' => [
|
'all' => [
|
||||||
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
|
||||||
@@ -185,14 +189,7 @@ $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' => [
|
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||||
'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',
|
||||||
|
|||||||
68
src/Bundle/Resources/contao/dca/tl_user.php
Normal file
68
src/Bundle/Resources/contao/dca/tl_user.php
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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);
|
||||||
|
|
||||||
|
use Contao\CoreBundle\DataContainer\PaletteManipulator;
|
||||||
|
|
||||||
|
PaletteManipulator::create()
|
||||||
|
->addLegend('leaflet_legend', 'amg_legend', PaletteManipulator::POSITION_BEFORE)
|
||||||
|
->addField(
|
||||||
|
['leaflet_layers', 'leaflet_layer_permissions', 'leaflet_tables'],
|
||||||
|
'leaflet_legend',
|
||||||
|
PaletteManipulator::POSITION_APPEND
|
||||||
|
)
|
||||||
|
->applyToPalette('extend', 'tl_user')
|
||||||
|
->applyToPalette('custom', 'tl_user');
|
||||||
|
|
||||||
|
|
||||||
|
$GLOBALS['TL_DCA']['tl_user']['fields']['leaflet_layers'] = [
|
||||||
|
'label' => &$GLOBALS['TL_LANG']['tl_user']['leaflet_layers'],
|
||||||
|
'exclude' => true,
|
||||||
|
'inputType' => 'treePicker',
|
||||||
|
'eval' => [
|
||||||
|
'foreignTable' => 'tl_leaflet_layer',
|
||||||
|
'titleField' => 'title',
|
||||||
|
'searchField' => 'title',
|
||||||
|
'managerHref' => 'do=leaflet_layer',
|
||||||
|
'fieldType' => 'checkbox',
|
||||||
|
'selectParents' => true,
|
||||||
|
'multiple' => true,
|
||||||
|
'pickerCallback' => ['netzmacht.contao_leaflet.listeners.dca.user', 'generateLayersRowLabel']
|
||||||
|
],
|
||||||
|
'sql' => 'blob NULL',
|
||||||
|
];
|
||||||
|
|
||||||
|
$GLOBALS['TL_DCA']['tl_user']['fields']['leaflet_tables'] = [
|
||||||
|
'label' => &$GLOBALS['TL_LANG']['tl_user']['leaflet_tables'],
|
||||||
|
'exclude' => true,
|
||||||
|
'inputType' => 'checkbox',
|
||||||
|
'options' => ['tl_leaflet_style', 'tl_leaflet_icon', 'tl_leaflet_popup'],
|
||||||
|
'reference' => &$GLOBALS['TL_LANG']['MOD'],
|
||||||
|
'eval' => [
|
||||||
|
'multiple' => true,
|
||||||
|
],
|
||||||
|
'sql' => 'mediumblob NULL',
|
||||||
|
];
|
||||||
|
|
||||||
|
$GLOBALS['TL_DCA']['tl_user']['fields']['leaflet_layer_permissions'] = [
|
||||||
|
'label' => &$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions'],
|
||||||
|
'exclude' => true,
|
||||||
|
'inputType' => 'checkbox',
|
||||||
|
'options' => ['create', 'edit', 'delete', 'data'],
|
||||||
|
'reference' => &$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options'],
|
||||||
|
'eval' => [
|
||||||
|
'helpwizard' => true,
|
||||||
|
'multiple' => true,
|
||||||
|
],
|
||||||
|
'sql' => 'mediumblob NULL',
|
||||||
|
];
|
||||||
67
src/Bundle/Resources/contao/dca/tl_user_group.php
Normal file
67
src/Bundle/Resources/contao/dca/tl_user_group.php
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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);
|
||||||
|
|
||||||
|
use Contao\CoreBundle\DataContainer\PaletteManipulator;
|
||||||
|
|
||||||
|
PaletteManipulator::create()
|
||||||
|
->addLegend('leaflet_legend', 'amg_legend', PaletteManipulator::POSITION_BEFORE)
|
||||||
|
->addField(
|
||||||
|
['leaflet_layers', 'leaflet_layer_permissions', 'leaflet_tables'],
|
||||||
|
'leaflet_legend',
|
||||||
|
PaletteManipulator::POSITION_APPEND
|
||||||
|
)
|
||||||
|
->applyToPalette('default', 'tl_user_group');
|
||||||
|
|
||||||
|
|
||||||
|
$GLOBALS['TL_DCA']['tl_user_group']['fields']['leaflet_layers'] = [
|
||||||
|
'label' => &$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layers'],
|
||||||
|
'exclude' => true,
|
||||||
|
'inputType' => 'treePicker',
|
||||||
|
'eval' => [
|
||||||
|
'foreignTable' => 'tl_leaflet_layer',
|
||||||
|
'titleField' => 'title',
|
||||||
|
'searchField' => 'title',
|
||||||
|
'managerHref' => 'do=leaflet_layer',
|
||||||
|
'fieldType' => 'checkbox',
|
||||||
|
'selectParents' => true,
|
||||||
|
'multiple' => true,
|
||||||
|
'pickerCallback' => ['netzmacht.contao_leaflet.listeners.dca.user_group', 'generateLayersRowLabel']
|
||||||
|
],
|
||||||
|
'sql' => 'blob NULL',
|
||||||
|
];
|
||||||
|
|
||||||
|
$GLOBALS['TL_DCA']['tl_user_group']['fields']['leaflet_tables'] = [
|
||||||
|
'label' => &$GLOBALS['TL_LANG']['tl_user_group']['leaflet_tables'],
|
||||||
|
'exclude' => true,
|
||||||
|
'inputType' => 'checkbox',
|
||||||
|
'options' => ['tl_leaflet_style', 'tl_leaflet_icon', 'tl_leaflet_popup'],
|
||||||
|
'reference' => &$GLOBALS['TL_LANG']['MOD'],
|
||||||
|
'eval' => [
|
||||||
|
'multiple' => true,
|
||||||
|
],
|
||||||
|
'sql' => 'mediumblob NULL',
|
||||||
|
];
|
||||||
|
|
||||||
|
$GLOBALS['TL_DCA']['tl_user_group']['fields']['leaflet_layer_permissions'] = [
|
||||||
|
'label' => &$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions'],
|
||||||
|
'exclude' => true,
|
||||||
|
'inputType' => 'checkbox',
|
||||||
|
'options' => ['create', 'edit', 'delete', 'data'],
|
||||||
|
'reference' => &$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options'],
|
||||||
|
'eval' => [
|
||||||
|
'helpwizard' => true,
|
||||||
|
'multiple' => true,
|
||||||
|
],
|
||||||
|
'sql' => 'mediumblob NULL',
|
||||||
|
];
|
||||||
@@ -22,6 +22,8 @@ $GLOBALS['TL_LANG']['MOD']['leaflet_about'][1] = 'About the Leaflet integration
|
|||||||
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_map'] = 'Maps';
|
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_map'] = 'Maps';
|
||||||
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_layer'] = 'Layers';
|
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_layer'] = 'Layers';
|
||||||
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_icon'] = 'Icons';
|
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_icon'] = 'Icons';
|
||||||
|
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_style'] = 'Styles';
|
||||||
|
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_popup'] = 'Popup';
|
||||||
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_marker'] = 'Markers';
|
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_marker'] = 'Markers';
|
||||||
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_control'] = 'Controls';
|
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_control'] = 'Controls';
|
||||||
|
|
||||||
|
|||||||
@@ -149,10 +149,6 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['fileFormat'][0] = 'File
|
|||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['fileFormat'][1] = 'Choose which file format is used.';
|
$GLOBALS['TL_LANG']['tl_leaflet_layer']['fileFormat'][1] = 'Choose which file format is used.';
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['file'][0] = 'File';
|
$GLOBALS['TL_LANG']['tl_leaflet_layer']['file'][0] = 'File';
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['file'][1] = 'Choose a file containing geodata. Supported formats are: %s.';
|
$GLOBALS['TL_LANG']['tl_leaflet_layer']['file'][1] = 'Choose a file containing geodata. Supported formats are: %s.';
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_key'][0] = 'API key / Access token';
|
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_key'][1] = 'Please define the API key / access token which is required for this tile provider.';
|
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_code'][0] = 'App code';
|
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_code'][1] = 'Please define the required app code for this tile provider.';
|
|
||||||
|
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes']['layer'][0] = 'Layer group';
|
$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes']['layer'][0] = 'Layer group';
|
||||||
$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes']['layer'][1] = 'Basic layer group. <br> See <a href="http://leafletjs.com/reference.html#layergroup" target="_blank">http://leafletjs.com/reference.html#layergroup</a>';
|
$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes']['layer'][1] = 'Basic layer group. <br> See <a href="http://leafletjs.com/reference.html#layergroup" target="_blank">http://leafletjs.com/reference.html#layergroup</a>';
|
||||||
|
|||||||
31
src/Bundle/Resources/contao/languages/en/tl_user.php
Normal file
31
src/Bundle/Resources/contao/languages/en/tl_user.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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);
|
||||||
|
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_legend'] = 'Leaflet Maps Permissions';
|
||||||
|
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layers'][0] = 'Allowed map layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layers'][1] = 'Please choose the allowed map layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions'][0] = 'Layer permissions';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions'][1] = 'Please choose which permissions are allowed for the map layer.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_tables'][0] = 'Allows map tables';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_tables'][1] = 'Please choose which tables are allowed.';
|
||||||
|
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['create'][0] = 'Create layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['create'][1] = 'Grant permission to create new layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['edit'][0] = 'Edit layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['edit'][1] = 'Grant permission to edit layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['delete'][0] = 'Delete layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['delete'][1] = 'Grant permission to delete layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['data'][0] = 'Edit data';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user']['leaflet_layer_permissions_options']['data'][1] = 'Grant permission to edit data of a layer.';
|
||||||
31
src/Bundle/Resources/contao/languages/en/tl_user_group.php
Normal file
31
src/Bundle/Resources/contao/languages/en/tl_user_group.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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);
|
||||||
|
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_legend'] = 'Leaflet Maps Permissions';
|
||||||
|
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layers'][0] = 'Allowed map layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layers'][1] = 'Please choose the allowed map layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions'][0] = 'Layer permissions';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions'][1] = 'Please choose which permissions are allowed for the map layer.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_tables'][0] = 'Allows map tables';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_tables'][1] = 'Please choose which tables are allowed.';
|
||||||
|
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['create'][0] = 'Create layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['create'][1] = 'Grant permission to create new layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['edit'][0] = 'Edit layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['edit'][1] = 'Grant permission to edit layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['delete'][0] = 'Delete layers';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['delete'][1] = 'Grant permission to delete layers.';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['data'][0] = 'Edit data';
|
||||||
|
$GLOBALS['TL_LANG']['tl_user_group']['leaflet_layer_permissions_options']['data'][1] = 'Grant permission to edit data of a layer.';
|
||||||
7
src/Bundle/Resources/contao/public/.htaccess
Normal file
7
src/Bundle/Resources/contao/public/.htaccess
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<IfModule !mod_authz_core.c>
|
||||||
|
Order allow,deny
|
||||||
|
Allow from all
|
||||||
|
</IfModule>
|
||||||
|
<IfModule mod_authz_core.c>
|
||||||
|
Require all granted
|
||||||
|
</IfModule>
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
{% block headline %}{{ "MOD.leaflet_about.1"|trans({}, 'contao_modules') }}{% endblock %}
|
{% block headline %}{{ "MOD.leaflet_about.1"|trans({}, 'contao_modules') }}{% endblock %}
|
||||||
|
|
||||||
{% block error %}{% endblock %}
|
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<div class="netzmacht-leaflet-credits">
|
<div class="netzmacht-leaflet-credits">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
|
|||||||
109
src/Listener/Dca/AbstractUserDcaListener.php
Normal file
109
src/Listener/Dca/AbstractUserDcaListener.php
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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\Listener\Dca;
|
||||||
|
|
||||||
|
use Contao\Image;
|
||||||
|
use Contao\StringUtil;
|
||||||
|
use Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\LayerLabelRenderer;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\LayerModel;
|
||||||
|
use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener;
|
||||||
|
use Netzmacht\Contao\Toolkit\Dca\Manager;
|
||||||
|
use Symfony\Component\Translation\TranslatorInterface as Translator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AbstractUserDcaListener
|
||||||
|
*/
|
||||||
|
abstract class AbstractUserDcaListener extends AbstractListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Layer label renderer.
|
||||||
|
*
|
||||||
|
* @var LayerLabelRenderer
|
||||||
|
*/
|
||||||
|
private $labelRenderer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translator.
|
||||||
|
*
|
||||||
|
* @var Translator
|
||||||
|
*/
|
||||||
|
private $translator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Layers definitions.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $layers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Manager $dcaManager Dca manager.
|
||||||
|
* @param LayerLabelRenderer $labelRenderer Layer label renderer.
|
||||||
|
* @param Translator $translator Translator.
|
||||||
|
* @param array $layers Layers definition.
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
Manager $dcaManager,
|
||||||
|
LayerLabelRenderer $labelRenderer,
|
||||||
|
Translator $translator,
|
||||||
|
array $layers
|
||||||
|
) {
|
||||||
|
parent::__construct($dcaManager);
|
||||||
|
|
||||||
|
$this->labelRenderer = $labelRenderer;
|
||||||
|
$this->translator = $translator;
|
||||||
|
$this->layers = $layers;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the layers row label.
|
||||||
|
*
|
||||||
|
* @param array $row Layer data row.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function generateLayersRowLabel(array $row): string
|
||||||
|
{
|
||||||
|
if (!empty($this->layers[$row['type']]['icon'])) {
|
||||||
|
$src = $this->layers[$row['type']]['icon'];
|
||||||
|
} else {
|
||||||
|
$src = 'iconPLAIN.gif';
|
||||||
|
}
|
||||||
|
|
||||||
|
$activeIcon = $src;
|
||||||
|
$disabledIcon = preg_replace('/(\.[^\.]+)$/', '_1$1', $src);
|
||||||
|
|
||||||
|
if (!$row['active']) {
|
||||||
|
$src = $disabledIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
$alt = $this->getFormatter(LayerModel::getTable())->formatValue('type', $row['type']);
|
||||||
|
$attributes = sprintf(
|
||||||
|
'class="list-icon" title="%s" data-icon="%s" data-icon-disabled="%s"',
|
||||||
|
StringUtil::specialchars(strip_tags($alt)),
|
||||||
|
$activeIcon,
|
||||||
|
$disabledIcon
|
||||||
|
);
|
||||||
|
|
||||||
|
$label = $this->getFormatter(LayerModel::getTable())->formatValue('title', $row['title']);
|
||||||
|
$label .= sprintf(' <span class="tl_gray">[ID %s]</span>', $row['id']);
|
||||||
|
$icon = Image::getHtml($src, $alt, $attributes);
|
||||||
|
$label = $this->labelRenderer->render($row, $label, $this->translator);
|
||||||
|
|
||||||
|
return $icon . ' ' . $label;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
||||||
|
|
||||||
|
use Contao\BackendUser;
|
||||||
|
use Contao\CoreBundle\Exception\AccessDeniedException;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\IconModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IconDcaListener.
|
* Class IconDcaListener.
|
||||||
*
|
*
|
||||||
@@ -21,6 +25,13 @@ namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
|||||||
*/
|
*/
|
||||||
class IconDcaListener
|
class IconDcaListener
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Contao backend user.
|
||||||
|
*
|
||||||
|
* @var BackendUser
|
||||||
|
*/
|
||||||
|
private $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Icon type options.
|
* Icon type options.
|
||||||
*
|
*
|
||||||
@@ -31,13 +42,33 @@ class IconDcaListener
|
|||||||
/**
|
/**
|
||||||
* IconDcaListener constructor.
|
* IconDcaListener constructor.
|
||||||
*
|
*
|
||||||
* @param array $icons Icon type options.
|
* @param BackendUser $user Backend user.
|
||||||
|
* @param array $icons Icon type options.
|
||||||
*/
|
*/
|
||||||
public function __construct(array $icons)
|
public function __construct(BackendUser $user, array $icons)
|
||||||
{
|
{
|
||||||
|
$this->user = $user;
|
||||||
$this->icons = $icons;
|
$this->icons = $icons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the permission.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException If user has not the permission.
|
||||||
|
*/
|
||||||
|
public function checkPermission(): void
|
||||||
|
{
|
||||||
|
if ($this->user->hasAccess(IconModel::getTable(), 'leaflet_tables')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('Access denied to "%s" for user "%s"', IconModel::getTable(), $this->user->id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get icon options.
|
* Get icon options.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -13,9 +13,12 @@
|
|||||||
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
||||||
|
|
||||||
use Contao\Backend;
|
use Contao\Backend;
|
||||||
|
use Contao\BackendUser;
|
||||||
|
use Contao\CoreBundle\Exception\AccessDeniedException;
|
||||||
use Contao\CoreBundle\Framework\Adapter;
|
use Contao\CoreBundle\Framework\Adapter;
|
||||||
use Contao\DataContainer;
|
use Contao\DataContainer;
|
||||||
use Contao\Image;
|
use Contao\Image;
|
||||||
|
use Contao\Input;
|
||||||
use Contao\StringUtil;
|
use Contao\StringUtil;
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
use Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\LayerLabelRenderer;
|
use Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\LayerLabelRenderer;
|
||||||
@@ -23,6 +26,7 @@ use Netzmacht\Contao\Leaflet\Model\IconModel;
|
|||||||
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\Dca\Listener\AbstractListener;
|
use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener;
|
||||||
|
use Netzmacht\Contao\Toolkit\Dca\Listener\Button\StateButtonCallbackListener;
|
||||||
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\Component\Translation\TranslatorInterface as Translator;
|
||||||
@@ -30,7 +34,7 @@ use Symfony\Component\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.
|
||||||
*
|
*
|
||||||
* @package Netzmacht\Contao\Leaflet\Dca
|
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||||
*/
|
*/
|
||||||
class LayerDcaListener extends AbstractListener
|
class LayerDcaListener extends AbstractListener
|
||||||
{
|
{
|
||||||
@@ -76,6 +80,13 @@ class LayerDcaListener extends AbstractListener
|
|||||||
*/
|
*/
|
||||||
private $translator;
|
private $translator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backend user.
|
||||||
|
*
|
||||||
|
* @var BackendUser
|
||||||
|
*/
|
||||||
|
private $backendUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OSM amenities.
|
* OSM amenities.
|
||||||
*
|
*
|
||||||
@@ -104,19 +115,28 @@ class LayerDcaListener extends AbstractListener
|
|||||||
*/
|
*/
|
||||||
private $backendAdapter;
|
private $backendAdapter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* State button callback listener.
|
||||||
|
*
|
||||||
|
* @var StateButtonCallbackListener
|
||||||
|
*/
|
||||||
|
private $stateButtonCallbackListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct.
|
* Construct.
|
||||||
*
|
*
|
||||||
* @param Manager $manager Data container manager.
|
* @param Manager $manager Data container manager.
|
||||||
* @param Connection $connection Database connection.
|
* @param Connection $connection Database connection.
|
||||||
* @param RepositoryManager $repositoryManager Repository manager.
|
* @param RepositoryManager $repositoryManager Repository manager.
|
||||||
* @param Translator $translator Translator.
|
* @param Translator $translator Translator.
|
||||||
* @param LayerLabelRenderer $labelRenderer Layer label renderer.
|
* @param LayerLabelRenderer $labelRenderer Layer label renderer.
|
||||||
* @param Adapter|Backend $backendAdapter Backend adapter.
|
* @param BackendUser $backendUser Backend user.
|
||||||
* @param array $layers Leaflet layer configuration.
|
* @param StateButtonCallbackListener $stateButtonCallbackListener State button callback listener.
|
||||||
* @param array $tileProviders Tile providers.
|
* @param Adapter|Backend $backendAdapter Backend adapter.
|
||||||
* @param array $amenities OSM amenities.
|
* @param array $layers Leaflet layer configuration.
|
||||||
* @param array $fileFormats File formats.
|
* @param array $tileProviders Tile providers.
|
||||||
|
* @param array $amenities OSM amenities.
|
||||||
|
* @param array $fileFormats File formats.
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
|
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
|
||||||
*/
|
*/
|
||||||
@@ -126,6 +146,8 @@ class LayerDcaListener extends AbstractListener
|
|||||||
RepositoryManager $repositoryManager,
|
RepositoryManager $repositoryManager,
|
||||||
Translator $translator,
|
Translator $translator,
|
||||||
LayerLabelRenderer $labelRenderer,
|
LayerLabelRenderer $labelRenderer,
|
||||||
|
BackendUser $backendUser,
|
||||||
|
StateButtonCallbackListener $stateButtonCallbackListener,
|
||||||
$backendAdapter,
|
$backendAdapter,
|
||||||
array $layers,
|
array $layers,
|
||||||
array $tileProviders,
|
array $tileProviders,
|
||||||
@@ -134,15 +156,55 @@ class LayerDcaListener extends AbstractListener
|
|||||||
) {
|
) {
|
||||||
parent::__construct($manager);
|
parent::__construct($manager);
|
||||||
|
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
$this->layers = $layers;
|
$this->layers = $layers;
|
||||||
$this->tileProviders = $tileProviders;
|
$this->tileProviders = $tileProviders;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->amenities = $amenities;
|
$this->amenities = $amenities;
|
||||||
$this->labelRenderer = $labelRenderer;
|
$this->labelRenderer = $labelRenderer;
|
||||||
$this->fileFormats = $fileFormats;
|
$this->fileFormats = $fileFormats;
|
||||||
$this->repositoryManager = $repositoryManager;
|
$this->repositoryManager = $repositoryManager;
|
||||||
$this->backendAdapter = $backendAdapter;
|
$this->backendAdapter = $backendAdapter;
|
||||||
|
$this->backendUser = $backendUser;
|
||||||
|
$this->stateButtonCallbackListener = $stateButtonCallbackListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the permissions.
|
||||||
|
*
|
||||||
|
* @param DataContainer $dataContainer Data container.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException If permissions are not granted.
|
||||||
|
*/
|
||||||
|
public function checkPermissions(DataContainer $dataContainer): void
|
||||||
|
{
|
||||||
|
if ($this->backendUser->isAdmin) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$action = Input::get('act');
|
||||||
|
$permission = $this->determinePermission($action);
|
||||||
|
|
||||||
|
if ($permission && !$this->backendUser->hasAccess($permission, 'leaflet_layer_permissions')) {
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('Permission "%s" not granted to access layer "%s"', $permission, $dataContainer->id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->getDefinition()->set(['list', 'sorting', 'root'], $this->backendUser->leaflet_layers);
|
||||||
|
|
||||||
|
$layerId = $this->determineLayerId();
|
||||||
|
if ($layerId && !$this->backendUser->hasAccess($layerId, 'leaflet_layers')) {
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('User "%s" not allowed to access layer "%s"', $this->backendUser->id, $layerId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$this->backendUser->hasAccess(LayerModel::PERMISSION_CREATE, 'leaflet_layer_permissions')) {
|
||||||
|
$this->getDefinition()->set(['config', 'closed'], true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -306,6 +368,148 @@ class LayerDcaListener extends AbstractListener
|
|||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the edit button.
|
||||||
|
*
|
||||||
|
* @param array $row Current row.
|
||||||
|
* @param string $href The button href.
|
||||||
|
* @param string $label The button label.
|
||||||
|
* @param string $title The button title.
|
||||||
|
* @param string $icon The button icon.
|
||||||
|
* @param string $attributes Optional attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function generateEditButton($row, $href, $label, $title, $icon, $attributes): string
|
||||||
|
{
|
||||||
|
if ($this->backendUser->hasAccess('edit', 'leaflet_layer_permissions')) {
|
||||||
|
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the cut button.
|
||||||
|
*
|
||||||
|
* @param array $row Current row.
|
||||||
|
* @param string $href The button href.
|
||||||
|
* @param string $label The button label.
|
||||||
|
* @param string $title The button title.
|
||||||
|
* @param string $icon The button icon.
|
||||||
|
* @param string $attributes Optional attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function generateCutButton($row, $href, $label, $title, $icon, $attributes): string
|
||||||
|
{
|
||||||
|
if ($this->backendUser->hasAccess('edit', 'leaflet_layer_permissions')) {
|
||||||
|
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the copy button.
|
||||||
|
*
|
||||||
|
* @param array $row Current row.
|
||||||
|
* @param string $href The button href.
|
||||||
|
* @param string $label The button label.
|
||||||
|
* @param string $title The button title.
|
||||||
|
* @param string $icon The button icon.
|
||||||
|
* @param string $attributes Optional attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function generateCopyButton($row, $href, $label, $title, $icon, $attributes): string
|
||||||
|
{
|
||||||
|
if ($this->backendUser->hasAccess('create', 'leaflet_layer_permissions')) {
|
||||||
|
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the toggle button.
|
||||||
|
*
|
||||||
|
* @param array $row Current data row.
|
||||||
|
* @param string|null $href Button link.
|
||||||
|
* @param string|null $label Button label.
|
||||||
|
* @param string|null $title Button title.
|
||||||
|
* @param string|null $icon Enabled button icon.
|
||||||
|
* @param string|null $attributes Html attributes as string.
|
||||||
|
* @param string $tableName Table name.
|
||||||
|
* @param array|null $rootIds Root ids.
|
||||||
|
* @param array|null $childRecordIds Child record ids.
|
||||||
|
* @param bool $circularReference Circular reference flag.
|
||||||
|
* @param string|null $previous Previous button name.
|
||||||
|
* @param string|null $next Next button name.
|
||||||
|
* @param DataContainer $dataContainer Data container driver.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
|
||||||
|
*/
|
||||||
|
public function generateToggleButton(
|
||||||
|
array $row,
|
||||||
|
$href,
|
||||||
|
$label,
|
||||||
|
$title,
|
||||||
|
$icon,
|
||||||
|
$attributes,
|
||||||
|
string $tableName,
|
||||||
|
$rootIds,
|
||||||
|
$childRecordIds,
|
||||||
|
bool $circularReference,
|
||||||
|
$previous,
|
||||||
|
$next,
|
||||||
|
$dataContainer
|
||||||
|
): string {
|
||||||
|
if ($this->backendUser->hasAccess('edit', 'leaflet_layer_permissions')) {
|
||||||
|
return $this->stateButtonCallbackListener->handleButtonCallback(
|
||||||
|
$row,
|
||||||
|
$href,
|
||||||
|
$label,
|
||||||
|
$title,
|
||||||
|
$icon,
|
||||||
|
$attributes,
|
||||||
|
$tableName,
|
||||||
|
$rootIds,
|
||||||
|
$childRecordIds,
|
||||||
|
$circularReference,
|
||||||
|
$previous,
|
||||||
|
$next,
|
||||||
|
$dataContainer
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the edit button.
|
||||||
|
*
|
||||||
|
* @param array $row Current row.
|
||||||
|
* @param string $href The button href.
|
||||||
|
* @param string $label The button label.
|
||||||
|
* @param string $title The button title.
|
||||||
|
* @param string $icon The button icon.
|
||||||
|
* @param string $attributes Optional attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function generateDeleteButton($row, $href, $label, $title, $icon, $attributes): string
|
||||||
|
{
|
||||||
|
if ($this->backendUser->hasAccess('delete', 'leaflet_layer_permissions')) {
|
||||||
|
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the markers button.
|
* Generate the markers button.
|
||||||
*
|
*
|
||||||
@@ -324,6 +528,10 @@ class LayerDcaListener extends AbstractListener
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->backendUser->hasAccess('data', 'leaflet_layer_permissions')) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,6 +553,10 @@ class LayerDcaListener extends AbstractListener
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->backendUser->hasAccess('data', 'leaflet_layer_permissions')) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
return $this->generateButton($row, $href, $label, $title, $icon, $attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,4 +734,82 @@ class LayerDcaListener extends AbstractListener
|
|||||||
Image::getHtml($icon, $label, $attributes)
|
Image::getHtml($icon, $label, $attributes)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine permission for current action.
|
||||||
|
*
|
||||||
|
* @param string|null $action Given action.
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||||
|
*/
|
||||||
|
private function determinePermission(?string $action): ?string
|
||||||
|
{
|
||||||
|
$permission = null;
|
||||||
|
|
||||||
|
switch ($action) {
|
||||||
|
case 'edit':
|
||||||
|
case 'toggle':
|
||||||
|
case 'editAll':
|
||||||
|
case 'overrideAll':
|
||||||
|
case 'cutAll':
|
||||||
|
return LayerModel::PERMISSION_EDIT;
|
||||||
|
|
||||||
|
case 'delete':
|
||||||
|
case 'deleteAll':
|
||||||
|
return LayerModel::PERMISSION_DELETE;
|
||||||
|
|
||||||
|
case 'copyAll':
|
||||||
|
return LayerModel::PERMISSION_CREATE;
|
||||||
|
|
||||||
|
case 'paste':
|
||||||
|
$mode = Input::get('mode');
|
||||||
|
|
||||||
|
switch ($mode) {
|
||||||
|
case 'create':
|
||||||
|
return LayerModel::PERMISSION_CREATE;
|
||||||
|
|
||||||
|
case 'cut':
|
||||||
|
return LayerModel::PERMISSION_EDIT;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return $permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Comment just to please phpcs
|
||||||
|
default:
|
||||||
|
return $permission;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the layer id.
|
||||||
|
*
|
||||||
|
* @return int|null
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||||
|
*/
|
||||||
|
private function determineLayerId(): ?int
|
||||||
|
{
|
||||||
|
// Check the current action
|
||||||
|
switch (Input::get('act')) {
|
||||||
|
case 'edit':
|
||||||
|
case 'delete':
|
||||||
|
case 'paste':
|
||||||
|
case 'show':
|
||||||
|
return (int) Input::get('id');
|
||||||
|
|
||||||
|
case 'editAll':
|
||||||
|
case 'deleteAll':
|
||||||
|
case 'overrideAll':
|
||||||
|
case 'cutAll':
|
||||||
|
case 'copyAll':
|
||||||
|
return (int) CURRENT_ID;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ 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 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\Component\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.
|
||||||
|
|||||||
@@ -12,10 +12,13 @@
|
|||||||
|
|
||||||
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
||||||
|
|
||||||
use Contao\Controller;
|
use Contao\BackendUser;
|
||||||
|
use Contao\CoreBundle\Exception\AccessDeniedException;
|
||||||
|
use Contao\Input;
|
||||||
use Contao\StringUtil;
|
use Contao\StringUtil;
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
use Netzmacht\Contao\Leaflet\Model\IconModel;
|
use Netzmacht\Contao\Leaflet\Model\IconModel;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\LayerModel;
|
||||||
use Netzmacht\Contao\Leaflet\Model\PopupModel;
|
use Netzmacht\Contao\Leaflet\Model\PopupModel;
|
||||||
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;
|
||||||
@@ -41,16 +44,48 @@ class MarkerDcaListener
|
|||||||
*/
|
*/
|
||||||
private $repositoryManager;
|
private $repositoryManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backend user.
|
||||||
|
*
|
||||||
|
* @var BackendUser
|
||||||
|
*/
|
||||||
|
private $backendUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MarkerDcaListener constructor.
|
* MarkerDcaListener constructor.
|
||||||
*
|
*
|
||||||
* @param Connection $connection Database connection.
|
* @param Connection $connection Database connection.
|
||||||
* @param RepositoryManager $repositoryManager Repository manager.
|
* @param RepositoryManager $repositoryManager Repository manager.
|
||||||
|
* @param BackendUser $backendUser Backend user.
|
||||||
*/
|
*/
|
||||||
public function __construct(Connection $connection, RepositoryManager $repositoryManager)
|
public function __construct(Connection $connection, RepositoryManager $repositoryManager, BackendUser $backendUser)
|
||||||
{
|
{
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
$this->repositoryManager = $repositoryManager;
|
$this->repositoryManager = $repositoryManager;
|
||||||
|
$this->backendUser = $backendUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check permissions.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException When permission is not granted.
|
||||||
|
*/
|
||||||
|
public function checkPermissions(): void
|
||||||
|
{
|
||||||
|
if (!$this->backendUser->hasAccess(LayerModel::PERMISSION_DATA, 'leaflet_layer_permissions')) {
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('User "%s" not allowed to access layer data.', $this->backendUser->id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$layerId = $this->determineLayerId();
|
||||||
|
if ($layerId && !$this->backendUser->hasAccess($layerId, 'leaflet_layers')) {
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('User "%s" not allowed to access layer "%s"', $this->backendUser->id, $layerId)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,4 +200,25 @@ class MarkerDcaListener
|
|||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the layer id.
|
||||||
|
*
|
||||||
|
* @return int|null
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||||
|
*/
|
||||||
|
private function determineLayerId(): ?int
|
||||||
|
{
|
||||||
|
// Check the current action
|
||||||
|
switch (Input::get('act')) {
|
||||||
|
case '':
|
||||||
|
case 'create':
|
||||||
|
case 'select':
|
||||||
|
return (int) Input::get('id');
|
||||||
|
|
||||||
|
default:
|
||||||
|
return (int) CURRENT_ID;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
169
src/Listener/Dca/OperationsListener.php
Normal file
169
src/Listener/Dca/OperationsListener.php
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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\Listener\Dca;
|
||||||
|
|
||||||
|
use Contao\Backend;
|
||||||
|
use Contao\BackendUser;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\IconModel;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\PopupModel;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\StyleModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class OperationsListener
|
||||||
|
*/
|
||||||
|
final class OperationsListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Backend user.
|
||||||
|
*
|
||||||
|
* @var BackendUser
|
||||||
|
*/
|
||||||
|
private $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OperationsListener constructor.
|
||||||
|
*
|
||||||
|
* @param BackendUser $user Backend user.
|
||||||
|
*/
|
||||||
|
public function __construct(BackendUser $user)
|
||||||
|
{
|
||||||
|
$this->user = $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the style operation.
|
||||||
|
*
|
||||||
|
* @param string $href Button link.
|
||||||
|
* @param string $label Button label.
|
||||||
|
* @param string $title Button title.
|
||||||
|
* @param string $class Button icon class.
|
||||||
|
* @param string $attributes Html attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function styleOperation(
|
||||||
|
string $href,
|
||||||
|
string $label,
|
||||||
|
string $title,
|
||||||
|
string $class,
|
||||||
|
string $attributes
|
||||||
|
): string {
|
||||||
|
return $this->renderIfPermissionIsGranted(StyleModel::getTable(), $href, $label, $title, $class, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the icon operation.
|
||||||
|
*
|
||||||
|
* @param string $href Button link.
|
||||||
|
* @param string $label Button label.
|
||||||
|
* @param string $title Button title.
|
||||||
|
* @param string $class Button icon class.
|
||||||
|
* @param string $attributes Html attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function iconOperation(
|
||||||
|
string $href,
|
||||||
|
string $label,
|
||||||
|
string $title,
|
||||||
|
string $class,
|
||||||
|
string $attributes
|
||||||
|
): string {
|
||||||
|
return $this->renderIfPermissionIsGranted(IconModel::getTable(), $href, $label, $title, $class, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the popup operation.
|
||||||
|
*
|
||||||
|
* @param string $href Button link.
|
||||||
|
* @param string $label Button label.
|
||||||
|
* @param string $title Button title.
|
||||||
|
* @param string $class Button icon class.
|
||||||
|
* @param string $attributes Html attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function popupOperation(
|
||||||
|
string $href,
|
||||||
|
string $label,
|
||||||
|
string $title,
|
||||||
|
string $class,
|
||||||
|
string $attributes
|
||||||
|
): string {
|
||||||
|
return $this->renderIfPermissionIsGranted(PopupModel::getTable(), $href, $label, $title, $class, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if user has permission to access the leaflet table.
|
||||||
|
*
|
||||||
|
* @param string $permission The table permission.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function hasPermission(string $permission): bool
|
||||||
|
{
|
||||||
|
return (bool) $this->user->hasAccess($permission, 'leaflet_tables');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the style operation.
|
||||||
|
*
|
||||||
|
* @param string $permission Table permission to check.
|
||||||
|
* @param string $href Button link.
|
||||||
|
* @param string $label Button label.
|
||||||
|
* @param string $title Button title.
|
||||||
|
* @param string $class Button icon class.
|
||||||
|
* @param string $attributes Html attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function renderIfPermissionIsGranted(
|
||||||
|
string $permission,
|
||||||
|
string $href,
|
||||||
|
string $label,
|
||||||
|
string $title,
|
||||||
|
string $class,
|
||||||
|
string $attributes
|
||||||
|
): string {
|
||||||
|
if ($this->hasPermission($permission)) {
|
||||||
|
return $this->render($href, $label, $title, $class, $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render a button.
|
||||||
|
*
|
||||||
|
* @param string $href Button link.
|
||||||
|
* @param string $label Button label.
|
||||||
|
* @param string $title Button title.
|
||||||
|
* @param string $class Button icon class.
|
||||||
|
* @param string $attributes Html attributes.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function render(string $href, string $label, string $title, string $class, string $attributes): string
|
||||||
|
{
|
||||||
|
return sprintf(
|
||||||
|
' <a href="%s" title="%s" class="%s" %s>%s</a>',
|
||||||
|
Backend::addToUrl($href),
|
||||||
|
$title,
|
||||||
|
$class,
|
||||||
|
$attributes,
|
||||||
|
$label
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
60
src/Listener/Dca/PopupDcaListener.php
Normal file
60
src/Listener/Dca/PopupDcaListener.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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\Listener\Dca;
|
||||||
|
|
||||||
|
use Contao\BackendUser;
|
||||||
|
use Contao\CoreBundle\Exception\AccessDeniedException;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\PopupModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PopupDcaListener
|
||||||
|
*/
|
||||||
|
final class PopupDcaListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Backend user.
|
||||||
|
*
|
||||||
|
* @var BackendUser
|
||||||
|
*/
|
||||||
|
private $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PopupDcaListener constructor.
|
||||||
|
*
|
||||||
|
* @param BackendUser $user Backend user.
|
||||||
|
*/
|
||||||
|
public function __construct(BackendUser $user)
|
||||||
|
{
|
||||||
|
$this->user = $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the permission.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException If user has not the permission.
|
||||||
|
*/
|
||||||
|
public function checkPermission(): void
|
||||||
|
{
|
||||||
|
if ($this->user->hasAccess(PopupModel::getTable(), 'leaflet_tables')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('Access denied to "%s" for user "%s"', PopupModel::getTable(), $this->user->id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
||||||
|
|
||||||
|
use Contao\BackendUser;
|
||||||
|
use Contao\CoreBundle\Exception\AccessDeniedException;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\StyleModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class StyleDcaListener.
|
* Class StyleDcaListener.
|
||||||
*
|
*
|
||||||
@@ -21,6 +25,13 @@ namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
|||||||
*/
|
*/
|
||||||
class StyleDcaListener
|
class StyleDcaListener
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Backend user.
|
||||||
|
*
|
||||||
|
* @var BackendUser
|
||||||
|
*/
|
||||||
|
private $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style type options.
|
* Style type options.
|
||||||
*
|
*
|
||||||
@@ -31,11 +42,31 @@ class StyleDcaListener
|
|||||||
/**
|
/**
|
||||||
* StyleDcaListener constructor.
|
* StyleDcaListener constructor.
|
||||||
*
|
*
|
||||||
* @param array $styles Styles options.
|
* @param BackendUser $user Backend user.
|
||||||
|
* @param array $styles Styles options.
|
||||||
*/
|
*/
|
||||||
public function __construct(array $styles)
|
public function __construct(BackendUser $user, array $styles)
|
||||||
{
|
{
|
||||||
$this->icons = $styles;
|
$this->icons = $styles;
|
||||||
|
$this->user = $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the permission.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException If user has not the permission.
|
||||||
|
*/
|
||||||
|
public function checkPermission(): void
|
||||||
|
{
|
||||||
|
if ($this->user->hasAccess(StyleModel::getTable(), 'leaflet_tables')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('Access denied to "%s" for user "%s"', StyleModel::getTable(), $this->user->id)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
28
src/Listener/Dca/UserDcaListener.php
Normal file
28
src/Listener/Dca/UserDcaListener.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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\Listener\Dca;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class UserDcaListener
|
||||||
|
*/
|
||||||
|
final class UserDcaListener extends AbstractUserDcaListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Data container name.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected static $name = 'tl_user';
|
||||||
|
}
|
||||||
28
src/Listener/Dca/UserGroupDcaListener.php
Normal file
28
src/Listener/Dca/UserGroupDcaListener.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leaflet maps for Contao CMS.
|
||||||
|
*
|
||||||
|
* @package contao-leaflet-maps
|
||||||
|
* @author David Molineus <david.molineus@netzmacht.de>
|
||||||
|
* @copyright 2014-2018 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\Listener\Dca;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class UserGroupDcaListener
|
||||||
|
*/
|
||||||
|
final class UserGroupDcaListener extends AbstractUserDcaListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Data container name.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected static $name = 'tl_user_group';
|
||||||
|
}
|
||||||
@@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
namespace Netzmacht\Contao\Leaflet\Listener\Dca;
|
||||||
|
|
||||||
|
use Contao\BackendUser;
|
||||||
|
use Contao\CoreBundle\Exception\AccessDeniedException;
|
||||||
|
use Contao\Input;
|
||||||
|
use Netzmacht\Contao\Leaflet\Model\LayerModel;
|
||||||
use Netzmacht\Contao\Leaflet\Model\PopupModel;
|
use Netzmacht\Contao\Leaflet\Model\PopupModel;
|
||||||
use Netzmacht\Contao\Leaflet\Model\StyleModel;
|
use Netzmacht\Contao\Leaflet\Model\StyleModel;
|
||||||
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
|
use Netzmacht\Contao\Toolkit\Data\Model\RepositoryManager;
|
||||||
@@ -47,19 +51,55 @@ class VectorDcaListener extends AbstractListener
|
|||||||
*/
|
*/
|
||||||
private $repositoryManager;
|
private $repositoryManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backend user.
|
||||||
|
*
|
||||||
|
* @var BackendUser
|
||||||
|
*/
|
||||||
|
private $backendUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct.
|
* Construct.
|
||||||
*
|
*
|
||||||
* @param Manager $dcaManager Data container manager.
|
* @param Manager $dcaManager Data container manager.
|
||||||
* @param RepositoryManager $repositoryManager Repository manager.
|
* @param RepositoryManager $repositoryManager Repository manager.
|
||||||
|
* @param BackendUser $backendUser Backend user.
|
||||||
* @param array $vectors Vectors.
|
* @param array $vectors Vectors.
|
||||||
*/
|
*/
|
||||||
public function __construct(Manager $dcaManager, RepositoryManager $repositoryManager, array $vectors)
|
public function __construct(
|
||||||
{
|
Manager $dcaManager,
|
||||||
|
RepositoryManager $repositoryManager,
|
||||||
|
BackendUser $backendUser,
|
||||||
|
array $vectors
|
||||||
|
) {
|
||||||
parent::__construct($dcaManager);
|
parent::__construct($dcaManager);
|
||||||
|
|
||||||
$this->vectors = $vectors;
|
$this->vectors = $vectors;
|
||||||
$this->repositoryManager = $repositoryManager;
|
$this->repositoryManager = $repositoryManager;
|
||||||
|
$this->backendUser = $backendUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check permissions.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException When permission is not granted.
|
||||||
|
*/
|
||||||
|
public function checkPermissions(): void
|
||||||
|
{
|
||||||
|
if (!$this->backendUser->hasAccess(LayerModel::PERMISSION_DATA, 'leaflet_layer_permissions')) {
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('User "%s" not allowed to access layer data.', $this->backendUser->id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$layerId = $this->determineLayerId();
|
||||||
|
if ($layerId && !$this->backendUser->hasAccess($layerId, 'leaflet_layers')) {
|
||||||
|
throw new AccessDeniedException(
|
||||||
|
sprintf('User "%s" not allowed to access layer "%s"', $this->backendUser->id, $layerId)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,4 +154,25 @@ class VectorDcaListener extends AbstractListener
|
|||||||
|
|
||||||
return $builder->getOptions();
|
return $builder->getOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the layer id.
|
||||||
|
*
|
||||||
|
* @return int|null
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||||
|
*/
|
||||||
|
private function determineLayerId(): ?int
|
||||||
|
{
|
||||||
|
// Check the current action
|
||||||
|
switch (Input::get('act')) {
|
||||||
|
case '':
|
||||||
|
case 'create':
|
||||||
|
case 'select':
|
||||||
|
return (int) Input::get('id');
|
||||||
|
|
||||||
|
default:
|
||||||
|
return (int) CURRENT_ID;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,10 +71,16 @@ 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);
|
|
||||||
$file = $repository->findByUuid($model->iconImage);
|
if ($model->iconImage) {
|
||||||
$arguments[] = $file ? $file->path : '';
|
$repository = $this->repositoryManager->getRepository(FilesModel::class);
|
||||||
|
$file = $repository->findByUuid($model->iconImage);
|
||||||
|
|
||||||
|
if ($file) {
|
||||||
|
$arguments[] = $file->path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $arguments;
|
return $arguments;
|
||||||
}
|
}
|
||||||
@@ -111,6 +117,8 @@ 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]);
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ 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()
|
||||||
@@ -68,7 +67,6 @@ 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()
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ use Contao\Model\Collection;
|
|||||||
*/
|
*/
|
||||||
class LayerModel extends AbstractActiveModel
|
class LayerModel extends AbstractActiveModel
|
||||||
{
|
{
|
||||||
|
public const PERMISSION_EDIT = 'edit';
|
||||||
|
|
||||||
|
public const PERMISSION_CREATE = 'create';
|
||||||
|
|
||||||
|
public const PERMISSION_DELETE = 'delete';
|
||||||
|
|
||||||
|
public const PERMISSION_DATA = 'data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model table.
|
* Model table.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ 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.
|
||||||
@@ -49,8 +50,8 @@ class MarkerModel extends AbstractActiveModel
|
|||||||
[
|
[
|
||||||
$table . '.active=1',
|
$table . '.active=1',
|
||||||
$table . '.pid=?',
|
$table . '.pid=?',
|
||||||
$table . '.latitude IS NOT NULL',
|
$table . '.latitude>0',
|
||||||
$table . '.longitude IS NOT NULL',
|
$table . '.longitude>0',
|
||||||
],
|
],
|
||||||
[$pid],
|
[$pid],
|
||||||
['order' => 'sorting']
|
['order' => 'sorting']
|
||||||
|
|||||||
Reference in New Issue
Block a user