Compare commits

..

109 Commits

Author SHA1 Message Date
David Molineus
c2fd00e6a0 Add styles for the mcw (Fix #51). 2017-10-16 16:58:17 +02:00
David Molineus
e6689d4d45 Improve styling. 2017-10-12 12:08:30 +02:00
David Molineus
cda48b9567 Open for Contao 4.4. Toolkit workarounds the issue. 2017-10-12 12:07:16 +02:00
David Molineus
03896940ac Fix the icon toggling. 2017-10-12 12:06:51 +02:00
David Molineus
d952e6fc48 Move map template to template section. 2017-10-12 10:59:17 +02:00
David Molineus
505dc45dd6 Fix category. 2017-10-12 10:57:04 +02:00
David Molineus
35227cef82 Fix delete sql statement. 2017-10-12 10:55:14 +02:00
David Molineus
a8491bdc4b Use the framework. 2017-10-11 17:57:48 +02:00
David Molineus
56a68175fe Make the data controller a service. 2017-10-11 15:42:49 +02:00
David Molineus
6bfaf63d4f Require Contao 4.4.7. 2017-10-11 15:24:45 +02:00
David Molineus
c374a2ce5d Drop Events mixin by extending L.Evented so that deprecated warning is not visible anymore in browser console. 2017-10-11 15:24:20 +02:00
David Molineus
df541fe433 Fix copyright year. 2017-10-11 15:00:48 +02:00
David Molineus
da8613ca0b Move assets class to encoder namespace. 2017-10-11 14:53:04 +02:00
David Molineus
f09929fae7 Use PHP's ::class constant. 2017-10-11 14:50:14 +02:00
David Molineus
8c6f4c4291 Add request token to the paste into button. 2017-10-11 14:43:25 +02:00
David Molineus
5ce9d517bc Rework filter handling (Fixes #50). 2017-10-11 14:40:01 +02:00
David Molineus
e1685f65c5 Ignore node modules. 2017-10-11 14:28:05 +02:00
David Molineus
bf0fb35b21 Rework filter handling to overcome static map identifier setting. 2017-10-11 14:27:37 +02:00
David Molineus
abaf24821f Apply service names changes. 2017-10-11 14:27:11 +02:00
David Molineus
58a7ccc815 Use input adapter. 2017-10-11 12:08:31 +02:00
David Molineus
13eec4ba2e Code style. 2017-10-11 11:53:32 +02:00
David Molineus
86bcae2f71 Use contao_leaflet as reference for services and tags instead of contao_leaflet_maps. 2017-10-11 11:47:21 +02:00
David Molineus
1dce4bc1c6 Move bundle files to Bundle namespace. 2017-10-11 11:46:19 +02:00
David Molineus
1df16407ef Support PHP 7.0. 2017-10-11 11:39:23 +02:00
David Molineus
d36d613e37 Also add autoZIndex option. 2017-10-11 11:35:58 +02:00
David Molineus
3c660b5bbd Fix: Support collapsed setting. 2017-10-11 11:32:25 +02:00
David Molineus
f5b984407e Fix arguments order of doGenerate() call. 2017-10-11 11:21:16 +02:00
David Molineus
572d2e74a0 Rewrite the insert tag replacer using the new toolkit 3.0 features. 2017-10-11 11:11:30 +02:00
David Molineus
5a1ea75623 Fix state column value. 2017-10-10 16:07:16 +02:00
David Molineus
6408796b56 Add bundle namespace. 2017-10-10 15:25:59 +02:00
David Molineus
8f45bf925a Rework components to support latest toolkit changes. 2017-10-10 15:25:35 +02:00
David Molineus
5167318c43 Add request token to the paste button. 2017-10-09 17:09:52 +02:00
David Molineus
6004138e4e Fix paths. 2017-10-09 17:06:04 +02:00
David Molineus
6b646243e1 Detect if empty values are supported. 2017-10-09 17:02:25 +02:00
David Molineus
95046b65e0 Switch to short array syntax. 2017-10-09 16:54:32 +02:00
David Molineus
cd88c2992b Fix type options. 2017-10-09 16:53:22 +02:00
David Molineus
a2a6d31259 Update packages.json and run gulp command. 2017-10-09 16:09:39 +02:00
David Molineus
b898aafe51 Rearrange assets. 2017-10-09 16:05:34 +02:00
David Molineus
249b12cb61 Code style issues. 2017-10-09 15:49:38 +02:00
David Molineus
fab9b5a0ba Fix save callback. 2017-10-09 15:42:37 +02:00
David Molineus
51fc784800 Fix controls selection. 2017-10-09 15:39:50 +02:00
David Molineus
edf212b850 Rework libraries handling so that libraries don't have to be ported to contao 4.4 only yet. 2017-10-09 15:36:11 +02:00
David Molineus
e6ed2c456d Define event name. 2017-10-09 14:47:38 +02:00
David Molineus
1e315d9bc5 Do not use insert tag replacer to remove circular reference to map provider. 2017-10-09 14:46:24 +02:00
David Molineus
3c9a54c7e1 Fix tag name. 2017-10-09 14:43:35 +02:00
David Molineus
6af1b3fa22 Register the hash subscriber and drop old event_subscribers.php. 2017-10-09 14:41:53 +02:00
David Molineus
7cee2fe631 Loose type hints to support the adapters. 2017-10-09 14:40:20 +02:00
David Molineus
d1c6424699 Fix service definition. 2017-10-09 14:28:02 +02:00
David Molineus
06fc40295c Fix default layer. 2017-10-09 14:20:18 +02:00
David Molineus
5289518d6a Allow empty standard layers. 2017-10-09 14:19:47 +02:00
David Molineus
a5fbba740b Fix invalid default value. 2017-10-09 14:18:24 +02:00
David Molineus
756c28cdc6 Fetch mode. 2017-10-09 14:11:39 +02:00
David Molineus
ac87bcf947 Use options callback to get supported layers and providers. 2017-10-09 14:01:22 +02:00
David Molineus
96c78d4306 Fix class name. 2017-10-09 12:00:09 +02:00
David Molineus
1932937648 Code style. 2017-10-06 15:53:26 +02:00
David Molineus
8eb9a22ae0 Remove boot class. 2017-10-06 15:52:07 +02:00
David Molineus
b5ae094320 Drop not required boot subscriber. 2017-10-06 15:51:20 +02:00
David Molineus
524678f56e Implement assets loading. 2017-10-06 15:50:54 +02:00
David Molineus
31cd1c3ae4 Rename events and remove old ones. 2017-10-06 15:50:34 +02:00
David Molineus
e8edeb8021 Register libraries. 2017-10-06 15:36:04 +02:00
David Molineus
a43b740ba0 Register definition encoders. 2017-10-06 15:35:02 +02:00
David Molineus
1b035901c1 Register definition mappers. 2017-10-06 15:16:02 +02:00
David Molineus
25b90f4c13 Register insert tag replacer. 2017-10-06 15:10:01 +02:00
David Molineus
8a240ab0ff Adjust assets path. 2017-10-06 15:06:35 +02:00
David Molineus
0a76a5450f Clean config.php. 2017-10-06 15:04:04 +02:00
David Molineus
e513edcd3b Use Contao vendor namespace. 2017-10-06 15:00:56 +02:00
David Molineus
aa524478e6 Drop old services.php. 2017-10-06 14:58:56 +02:00
David Molineus
25e3e0d5fb Register geo json subscriber. 2017-10-06 14:58:31 +02:00
David Molineus
2c88d7aec5 Add module factories. 2017-10-06 14:54:58 +02:00
David Molineus
bc425ea772 Code style. 2017-10-06 14:40:44 +02:00
David Molineus
b82b010937 Load language file in the onload callback. 2017-10-06 14:38:43 +02:00
David Molineus
47713e8a38 Replace the template options callback with toolkit 3.0 listener. 2017-10-06 14:35:42 +02:00
David Molineus
3828c9ce13 Use toolkit 3.0 color picker. 2017-10-06 14:27:04 +02:00
David Molineus
594b10b0cf Rework leaflet state button callbacks to be compatible with toolkit 3.0. 2017-10-06 14:24:55 +02:00
David Molineus
ad6a4e9384 Replace old alias generator callback definition with toolkit 3.0 compatible ones. 2017-10-06 14:14:39 +02:00
David Molineus
ad5e30fd09 Rework frontend integration callback class to a listener service. 2017-10-06 14:06:20 +02:00
David Molineus
f03ed713f3 Rework validator callbacks to a listener service. 2017-10-06 14:02:31 +02:00
David Molineus
6c7b136c0e Rework leaflet dca callbacks to a listener service. 2017-10-06 13:56:46 +02:00
David Molineus
5a4fd9b434 Fix reference to vector. 2017-10-06 13:47:57 +02:00
David Molineus
ad6482c28c Rework vector dca callbacks to a service listener. 2017-10-06 13:47:13 +02:00
David Molineus
6111fc3594 Rework marker dca callbacks to a service listener. 2017-10-06 13:44:11 +02:00
David Molineus
32d47531f7 Add getIcons callback to the layer dca listener. 2017-10-06 13:39:40 +02:00
David Molineus
598adb54b1 Rework layer callbacks to an listener service. 2017-10-06 13:33:19 +02:00
David Molineus
e67b152225 Replace old callback notation. 2017-10-06 13:21:06 +02:00
David Molineus
1fc47f705d Rename listener namespace. 2017-10-06 13:19:46 +02:00
David Molineus
fde6c2b4c7 Rework control callbacks as a listener service. 2017-10-06 13:17:49 +02:00
David Molineus
307381ddb6 Rework map callbacks as a listener. 2017-10-06 12:04:39 +02:00
David Molineus
f172c42426 Work on service definitions. 2017-10-06 11:47:54 +02:00
David Molineus
b96e955504 Implement encoder factory as class. 2017-10-06 11:41:12 +02:00
David Molineus
7727263f29 Move assets to public folder. 2017-10-06 10:11:51 +02:00
David Molineus
25f89f91b6 Add compiler pass for layer label renderer. 2017-10-06 10:09:56 +02:00
David Molineus
f5badd14c5 Move layers configuration. 2017-10-06 10:07:19 +02:00
David Molineus
320359d2f0 Add docs. 2017-10-06 09:56:19 +02:00
David Molineus
8300531de3 Restructure config files, add extension and complete mappers services. 2017-10-06 09:28:33 +02:00
David Molineus
ceb05bb08f Work on moving configuration to yml files. 2017-10-05 17:35:46 +02:00
David Molineus
909288d4fc Move providers to yml file. 2017-10-05 17:02:15 +02:00
David Molineus
6ad637d4fa Move amanities config to parameters.yml. 2017-10-05 16:45:16 +02:00
David Molineus
04c693ac7f Use symfony translator. 2017-10-05 16:40:13 +02:00
David Molineus
bce7e31cb3 Drop autoload files. 2017-10-05 16:31:58 +02:00
David Molineus
a3ac7262f0 Add plugin and bundle. 2017-10-05 16:31:15 +02:00
David Molineus
20b9144b89 Apply coding standards. 2017-10-05 16:14:46 +02:00
David Molineus
84294686a5 Update file headers. 2017-10-05 15:45:43 +02:00
David Molineus
dfc1fa49d9 Restore compatibility with contao-toolkit 3.0. 2017-10-05 15:34:19 +02:00
David Molineus
f8aac5747c Update interface. 2017-10-05 15:27:49 +02:00
David Molineus
540680f7f6 Use phpcq all tasks. 2017-10-05 15:25:58 +02:00
David Molineus
3e40da22ba Drop bin dir. 2017-10-05 15:24:34 +02:00
David Molineus
eea70e3a51 Move contao files. 2017-10-05 14:17:52 +02:00
David Molineus
827c746b0d Switch to PSR-4. 2017-10-05 14:16:56 +02:00
David Molineus
e3344ffd4f Update build and dot files. 2017-10-05 14:06:00 +02:00
234 changed files with 8343 additions and 7382 deletions

11
.gitattributes vendored Normal file
View File

@@ -0,0 +1,11 @@
.check-author.yml export-ignore
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
.travis.yml export-ignore
build.default.properties export-ignore
build.xml export-ignore
phpunit.xml.dist export-ignore
/tests export-ignore
/specs export-ignore
/js export-ignore

35
.gitignore vendored
View File

@@ -1,11 +1,28 @@
/vendor/
/bin/
/demo/
/assets/js/*.js
/node_modules/
/.tx/
/.idea/
# OS
.DS_Store
Thumbs.db
.directory
coverage.xml
# IDEs
.buildpath
.project
.settings/
.build/
.external*/
.idea/
nbproject/
# composer related
vendor/
composer.lock
npm-debug.log
# build
build/
build.properties
# Translations
.tx
# NPM
node_modules
package-lock.json

View File

@@ -1,29 +1,27 @@
language: php
php:
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "nightly"
- "7.1"
env:
- CONTAO_VERSION=~3.5.1
- CONTAO_VERSION=contao/core-bundle ~4.4.0
matrix:
exclude:
sudo: false
install:
- travis_retry composer self-update && composer --version
- travis_retry composer require contao/core $CONTAO_VERSION --no-update
- travis_retry composer require $CONTAO_VERSION --no-update
- travis_retry composer update --prefer-dist --no-interaction
script: ant -keep-going
matrix:
allow_failures:
- php: "7.0"
- php: "nightly"
# Hack to make things work again - we can not use a shallow repository.
git:
depth: 2147483647
cache:
directories:
- vendor

View File

File diff suppressed because one or more lines are too long

4
build.default.properties Normal file
View File

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

View File

@@ -1,2 +0,0 @@
phpcq.bin.dir = ${basedir}/bin

View File

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

View File

@@ -1,66 +1,65 @@
{
"name":"netzmacht/contao-leaflet-maps",
"description":"Contao Leaflet maps integration",
"keywords":["contao", "maps", "leaflet"],
"type":"contao-module",
"license":"LGPL-3.0+",
"authors":[
{
"name":"David Molineus",
"email":"mail@netzmacht.de",
"homepage":"http://www.netzmacht.de",
"role":"Project leader"
}
],
"support":{
"email":"mail@netzmacht.de",
"issues":"https://github.com/netzmacht/contao-leaflet-maps/issues",
"source":"https://github.com/netzmacht/contao-leaflet-maps"
},
"require":{
"php":">=5.4",
"contao/core":"^3.5",
"contao-community-alliance/dependency-container":"^1.0",
"contao-community-alliance/event-dispatcher":"^1.0",
"netzmacht/contao-leaflet-libraries": "^1.0",
"netzmacht/php-javascript-builder": "^1.0",
"netzmacht/php-leaflet": "^1.0",
"netzmacht/contao-toolkit":"^2.0",
"contao-community-alliance/meta-palettes": "^1.5",
"menatwork/contao-multicolumnwizard": "^3.2",
"doctrine/cache": "^1.0"
},
"require-dev":{
"netzmacht/contao-build-tools": "^1.1"
},
"autoload": {
"psr-0": {
"Netzmacht\\Contao\\Leaflet\\": "src/"
}
},
"config": {
"bin-dir": "bin"
},
"prefer-stable": true,
"minimum-stability": "dev",
"extra":{
"branch-alias": {
"dev-master": "2.0.x-dev",
"dev-develop": "2.1.x-dev",
"dev-support/0.7.x": "0.7.x-dev"
},
"contao": {
"sources":{
"module": "system/modules/leaflet",
"assets/maps": "assets/leaflet/maps",
"assets/js": "assets/leaflet/js"
},
"transifex": {
"project": "contao-leaflet-maps",
"prefix": "core-",
"languages_cto": "module/languages",
"languages_tx": ".tx"
}
}
"name": "netzmacht/contao-leaflet-maps",
"description": "Contao Leaflet maps integration",
"keywords": [
"contao",
"maps",
"leaflet"
],
"type": "contao-bundle",
"license": "LGPL-3.0+",
"authors": [
{
"name": "David Molineus",
"email": "mail@netzmacht.de",
"homepage": "https://netzmacht.de",
"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": {
"php": ">=7.0",
"contao/core-bundle": "~4.4",
"netzmacht/contao-leaflet-libraries": "^1.0",
"netzmacht/php-javascript-builder": "^1.0",
"netzmacht/php-leaflet": "^1.0.1",
"netzmacht/contao-toolkit": "^3.0@dev",
"contao-community-alliance/meta-palettes": "^1.5",
"menatwork/contao-multicolumnwizard": "^3.2",
"doctrine/cache": "^1.0"
},
"require-dev": {
"phpcq/all-tasks": "^1.2",
"contao/manager-plugin": "^2.1"
},
"autoload": {
"psr-4": {
"Netzmacht\\Contao\\Leaflet\\": "src/"
}
},
"autoload-dev": {
"files": [
"vendor/phpcq/autoload-validation/hacks/contao-hack.php"
]
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev",
"dev-develop": "2.1.x-dev",
"dev-release/3.0.0": "3.0.x-dev"
},
"contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\Bundle\\ContaoManager\\Plugin",
"contao": {
"transifex": {
"project": "contao-leaflet-maps",
"prefix": "core-",
"languages_cto": "module/languages",
"languages_tx": ".tx"
}
}
}
}

View File

@@ -5,8 +5,8 @@ var concat = require('gulp-concat');
var paths = {
minified: 'contao-leaflet.js',
scripts: ['assets/maps/src/*.js'],
dest: 'assets/maps'
scripts: ['js/*.js'],
dest: 'src/Bundle/Resources/public/js'
};
gulp.task('clear', function() {

View File

@@ -3,9 +3,7 @@
*
* This class provides some helpers for loading layer data manages maps and map objects.
*/
L.Contao = L.Class.extend({
includes: L.Mixin.Events,
L.Contao = L.Evented.extend({
statics: {
/**
* Contao extension attribution.

View File

@@ -1 +0,0 @@
requires[] = 'toolkit'

View File

@@ -1,21 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
TemplateLoader::addFiles(
array(
'ce_leaflet_map' => 'system/modules/leaflet/templates',
'leaflet_map_js' => 'system/modules/leaflet/templates',
'leaflet_map_html' => 'system/modules/leaflet/templates',
'mod_leaflet_map' => 'system/modules/leaflet/templates',
'be_leaflet_geocode' => 'system/modules/leaflet/templates',
'be_leaflet_about' => 'system/modules/leaflet/templates',
)
);

View File

@@ -1,382 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
/*
* Backend module.
*/
array_insert(
$GLOBALS['BE_MOD'],
1,
array(
'leaflet' => array
(
'leaflet_map' => array
(
'tables' => array
(
'tl_leaflet_map',
'tl_leaflet_control',
),
'icon' => 'system/modules/leaflet/assets/img/map.png',
'stylesheet' => 'system/modules/leaflet/assets/css/backend.css',
),
'leaflet_layer' => array
(
'tables' => array
(
'tl_leaflet_layer',
'tl_leaflet_marker',
'tl_leaflet_vector',
'tl_leaflet_icon',
'tl_leaflet_style',
'tl_leaflet_popup',
),
'icon' => 'system/modules/leaflet/assets/img/layers.png',
'stylesheet' => 'system/modules/leaflet/assets/css/backend.css',
),
'leaflet_about' => array
(
'callback' => 'Netzmacht\Contao\Leaflet\Backend\About',
'icon' => 'system/modules/leaflet/assets/img/about.png',
'stylesheet' => 'system/modules/leaflet/assets/css/about.css',
)
)
)
);
/*
* Content elements.
*/
$GLOBALS['TL_CTE']['includes']['leaflet'] = 'Netzmacht\Contao\Toolkit\Component\ContentElement\ContentElementDecorator';
/*
* Frontend modules
*/
$GLOBALS['FE_MOD']['includes']['leaflet'] = 'Netzmacht\Contao\Toolkit\Component\Module\ModuleDecorator';
/*
* Models.
*/
$GLOBALS['TL_MODELS']['tl_leaflet_control'] = 'Netzmacht\Contao\Leaflet\Model\ControlModel';
$GLOBALS['TL_MODELS']['tl_leaflet_icon'] = 'Netzmacht\Contao\Leaflet\Model\IconModel';
$GLOBALS['TL_MODELS']['tl_leaflet_layer'] = 'Netzmacht\Contao\Leaflet\Model\LayerModel';
$GLOBALS['TL_MODELS']['tl_leaflet_map'] = 'Netzmacht\Contao\Leaflet\Model\MapModel';
$GLOBALS['TL_MODELS']['tl_leaflet_marker'] = 'Netzmacht\Contao\Leaflet\Model\MarkerModel';
$GLOBALS['TL_MODELS']['tl_leaflet_popup'] = 'Netzmacht\Contao\Leaflet\Model\PopupModel';
$GLOBALS['TL_MODELS']['tl_leaflet_style'] = 'Netzmacht\Contao\Leaflet\Model\StyleModel';
$GLOBALS['TL_MODELS']['tl_leaflet_vector'] = 'Netzmacht\Contao\Leaflet\Model\VectorModel';
/*
* Leaflet mappers.
*
* Mappers do the translations between the database models and the leaflet definition.
*/
$GLOBALS['LEAFLET_MAPPERS'] = array();
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\MapMapper';
// Layer mappers.
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\TileLayerMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new \Netzmacht\Contao\Leaflet\Mapper\Layer\ProviderLayerMapper(
$GLOBALS['LEAFLET_TILE_PROVIDERS']
);
};
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\MarkersLayerMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\GroupLayerMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\VectorsLayerMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\ReferenceLayerMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\OverpassLayerMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new \Netzmacht\Contao\Leaflet\Mapper\Layer\MarkerClusterLayerMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::MAP_ASSETS]
);
};
// Control mappers.
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ZoomControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ScaleControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\LayersControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\AttributionControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\LoadingControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\FullscreenControlMapper';
// Vector mappers.
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new Netzmacht\Contao\Leaflet\Mapper\Vector\PolylineMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new Netzmacht\Contao\Leaflet\Mapper\Vector\MultiPolylineMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new Netzmacht\Contao\Leaflet\Mapper\Vector\PolygonMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new Netzmacht\Contao\Leaflet\Mapper\Vector\MultiPolygonMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new Netzmacht\Contao\Leaflet\Mapper\Vector\CircleMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new Netzmacht\Contao\Leaflet\Mapper\Vector\CircleMarkerMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new Netzmacht\Contao\Leaflet\Mapper\Vector\RectangleMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
// Miscellaneous mappers.
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\UI\PopupMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Type\ImageIconMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Type\DivIconMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Type\ExtraMarkersIconMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Style\FixedStyleMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = function () {
return new \Netzmacht\Contao\Leaflet\Mapper\UI\MarkerMapper(
$GLOBALS['container'][\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::FRONTEND_VALUE_FILTER]
);
};
/*
* Leaflet encoders.
*
* The encoders transforms the definitions into javascript. The encoders has to be an implementation of the
* EventDispatcherInterface of the event dispatcher.
*
* You can define the encoders using the syntax of the cca event dispatcher implementation.
*
* @see https://github.com/contao-community-alliance/event-dispatcher#event-subscriber-per-configuration
*/
$GLOBALS['LEAFLET_ENCODERS'] = array();
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\MapEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\ControlEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\GroupEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\RasterEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\VectorEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\UIEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\TypeEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\Contao\Leaflet\Subscriber\EncoderSubscriber';
/*
* Leaflet layer types.
*
* The type is used for the database driven definitions.
*/
$GLOBALS['LEAFLET_LAYERS'] = array
(
'provider' => array
(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/provider.png',
'label' => function ($row, $label) {
if (!empty($GLOBALS['TL_LANG']['leaflet_provider'][$row['tile_provider']][0])) {
$provider = $GLOBALS['TL_LANG']['leaflet_provider'][$row['tile_provider']][0];
} else {
$provider = $row['tile_provider'];
}
$label .= sprintf('<span class="tl_gray"> (%s)</span>', $provider);
return $label;
}
),
'group' => array
(
'children' => true,
'icon' => 'system/modules/leaflet/assets/img/group.png',
),
'markers' => array
(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/markers.png',
'markers' => true,
'boundsMode' => array(
'extend' => true,
'fit' => 'deferred'
),
'label' => function ($row, $label) {
$count = \Netzmacht\Contao\Leaflet\Model\MarkerModel::countBy('pid', $row['id']);
$label .= sprintf(
'<span class="tl_gray"> (%s %s)</span>',
$count,
$GLOBALS['TL_LANG']['tl_leaflet_layer']['countEntries']
);
return $label;
}
),
'vectors' => array
(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/vectors.png',
'vectors' => true,
'boundsMode' => array(
'extend' => true,
),
'label' => function ($row, $label) {
$count = \Netzmacht\Contao\Leaflet\Model\VectorModel::countBy('pid', $row['id']);
$label .= sprintf(
'<span class="tl_gray"> (%s %s)</span>',
$count,
$GLOBALS['TL_LANG']['tl_leaflet_layer']['countEntries']
);
return $label;
}
),
'reference' => array
(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/reference.png',
'label' => function ($row, $label) {
$reference = \Netzmacht\Contao\Leaflet\Model\LayerModel::findByPk($row['reference']);
if ($reference) {
$label .= '<span class="tl_gray"> (' . $reference->title . ')</span>';
}
return $label;
}
),
'markercluster' => array
(
'children' => true,
'icon' => 'system/modules/leaflet/assets/img/cluster.png',
),
'tile' => array(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/tile.png',
),
'overpass' => array(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/overpass.png',
'label' => function ($row, $label) {
if ($row['overpassQuery']) {
$label .= '<span class="tl_gray"> ' . \StringUtil::substr($row['overpassQuery'], 50) . '</span>';
}
return $label;
},
'boundsMode' => array(
'extend' => true,
'fit' => true,
),
),
);
/*
* leaflet controls.
*
* Supported leaflet control types. Register your type for the database driven definition here.
*/
$GLOBALS['LEAFLET_CONTROLS'] = array('zoom', 'layers', 'scale', 'attribution', 'loading', 'fullscreen');
/*
* Leaflet icons.
*
* Supported leaflet icon types. Register you type for the database driven definition here.
*/
$GLOBALS['LEAFLET_ICONS'] = array('image', 'div', 'extra');
/*
* The style concept is not part of the LeafletJS library. Styles are extracted from the Path options. Instead
* of defining the style for every vector again, manage them at one place.
*
* The goal is to provide different style strategies. For instance a random style chooser, one which uses a color
* range and so one.
*/
$GLOBALS['LEAFLET_STYLES'] = array('fixed');
/*
* Leaflet vectors.
*
* Supported leaflet vector types. Register you type for the database driven definition here.
*/
$GLOBALS['LEAFLET_VECTORS'] = array
(
'polyline',
'polygon',
'multiPolyline',
'multiPolygon',
'rectangle',
'circle',
'circleMarker'
);
/*
* Leaflet tile layer providers.
*/
require_once TL_ROOT . '/system/modules/leaflet/config/leaflet_providers.php';
/*
* Leaflet assets.
*
* The leaflet definition are aware of the required javascript libraries. Register the assets so that they are
* loaded automatically.
*
* Each entry is an array of 2 values. The first is the resource. The second is a type. Supported types are:
* - url: An valid url.
* - file: An file path relative to the Contao Root.
* - source: Inline css/javascript.
*
* You don't have to define it as array if you simply add a file. Do not add |static and or media type flag to it.
* It's getting added by default if not being in debug mode.
*/
if (!isset($GLOBALS['LEAFLET_LIBRARIES'])) {
$GLOBALS['LEAFLET_LIBRARIES'] = array();
}
/*
* When creating a GeoJSON feature of a map object a feature.properties.model object is passed.
* Define the properties you always want to set.
*
* For more control you can subscribe the ConvertToGeoJsonEvent.
*
* The entry can be a string or an array. If an array is passed, the 2nd value is the type. Following types
* are supported.
* - array: Use deserialize before adding the value
* - file: Thread value a uuid and find the path.
* - files: Thread values as a list of file uuids and get an array of paths.
*/
$GLOBALS['LEAFLET_FEATURE_MODEL_PROPERTIES']['tl_leaflet_marker'][] = 'id';
$GLOBALS['LEAFLET_FEATURE_MODEL_PROPERTIES']['tl_leaflet_marker'][] = 'title';
$GLOBALS['LEAFLET_FEATURE_MODEL_PROPERTIES']['tl_leaflet_marker'][] = 'alias';
$GLOBALS['LEAFLET_FEATURE_MODEL_PROPERTIES']['tl_leaflet_vector'][] = 'id';
$GLOBALS['LEAFLET_FEATURE_MODEL_PROPERTIES']['tl_leaflet_vector'][] = 'title';
$GLOBALS['LEAFLET_FEATURE_MODEL_PROPERTIES']['tl_leaflet_vector'][] = 'alias';
/*
* Filters can be passed to a data request to get only specific data from a layer.
*/
$GLOBALS['LEAFLET_FILTERS']['bbox'] = 'Netzmacht\Contao\Leaflet\Filter\BboxFilter';
$GLOBALS['LEAFLET_FILTERS']['distance'] = 'Netzmacht\Contao\Leaflet\Filter\DistanceFilter';

View File

@@ -1,15 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
return array(
$GLOBALS['container']['leaflet.boot.subscriber'],
'Netzmacht\Contao\Leaflet\Subscriber\HashSubscriber',
$GLOBALS['container']['leaflet.subscriber.geo-json'],
);

View File

@@ -1,213 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
return [
'administration',
'advertising',
'alm',
'animal_boarding',
'animal_breeding',
'animal_shelter',
'architect_office',
'arts_centre',
'artwork',
'atm',
'audiologist',
'baby_hatch',
'bank',
'bar',
'bbq',
'bench',
'bicycle_parking',
'bicycle_rental',
'bicycle_repair_station',
'bicycle_trailer_sharing',
'biergarten',
'bikeshed',
'boat_rental',
'boat_sharing',
'boat_storage',
'brothel',
'bts',
'bureau_de_change',
'bus_station',
'cafe',
'canoe_hire',
'car_rental',
'car_repair',
'car_sharing',
'car_wash',
'casino',
'charging_station',
'childcare',
'cinema',
'citymap_post',
'clinic',
'clock',
'club',
'coast_guard',
'coast_radar_station',
'college',
'community_center',
'community_centre',
'compressed_air',
'concert_hall',
'conference_centre',
'courthouse',
'coworking_space',
'crematorium',
'crucifix',
'crypt',
'customs',
'dancing_school',
'dead_pub',
'dentist',
'disused',
'dive_centre',
'doctors',
'dog_bin',
'dog_waste_bin',
'dojo',
'drinking_water',
'_driving_school',
'education',
'embassy',
'emergency_phone',
'emergency_service',
'events_venue',
'ev_charging',
'exhibition_centre',
'fast_food',
'ferry_terminal',
'festival_grounds',
'financial_advice',
'fire_hydrant',
'fire_station',
'first_aid',
'fish_spa',
'food_court',
'fountain',
'fuel',
'gambling',
'game_feeding',
'garages',
'grave_yard',
'grit_bin',
'harbourmaster',
'hospice',
'hospital',
'hotel',
'hunting_stand',
'ice_cream',
'internet_cafe',
'jobcentre',
'kindergarten',
'kiosk',
'kitchen',
'Kneippbecken',
'kneipp_water_cure',
'language_school',
'lavoir',
'library',
'lifeboat_station',
'life_ring',
'loading_dock',
'love_hotel',
'marae',
'marketplace',
'milk_dispenser',
'mobile_library',
'monastery',
'money_transfer',
'mortuary',
'motorcycle_parking',
'motorcycle_rental',
'music_school',
'music_venue',
'nameplate',
'nightclub',
'nursery',
'nursing_home',
'park',
'parking',
'parking_entrance',
'parking_space',
'pharmacy',
'photo_booth',
'place_of_worship',
'planetarium',
'police',
'post_box',
'post_office',
'preschool',
'printer',
'prison',
'prison_camp',
'proposed',
'pub',
'public_bath',
'public_bookcase',
'public_building',
'public_hall',
'ranger_station',
'recycling',
'refugee_housing',
'register_office',
'rescue_box',
'rescue_station',
'research_institute',
'restaurant',
'retirement_home',
'sanatorium',
'sanitary_dump_station',
'sauna',
'school',
'scout_hut',
'shelter',
'shop',
'shower',
'ski_school',
'smoking_area',
'social_centre',
'social_facility',
'spa',
'stables',
'stripclub',
'studio',
'swimming_pool',
'swingerclub',
'table',
'taxi',
'telephone',
'theatre',
'ticket_booth',
'ticket_validator',
'toilets',
'townhall',
'trolley_bay',
'university',
'vacuum_cleaner',
'vehicle_inspection',
'vending_machine',
'veterinary',
'vivarium',
'wash_center',
'waste_basket',
'waste_disposal',
'waste_transfer_station',
'water',
'watering_place',
'water_point',
'weighbridge',
'winery',
'yacht_club',
'youth_centre',
];

View File

@@ -1,181 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
/*
* Support all providers and variants which are supported by leaflet-providers.
* See https://github.com/leaflet-extras/leaflet-providers/blob/master/leaflet-providers.js
*/
$GLOBALS['LEAFLET_TILE_PROVIDERS'] = array
(
'OpenStreetMap' => array
(
'variants' => array('Mapnik', 'BlackAndWhite', 'DE', 'France', 'HOT', 'BZH'),
),
'OpenSeaMap' => array(),
'OpenTopoMap' => array(),
'Thunderforest' => array
(
'variants' => array(
'OpenCycleMap',
'Transport',
'TransportDark',
'SpinalMap',
'Landscape',
'Outdoors',
'Pioneer'
)
),
'OpenMapSurfer' => array
(
'variants' => array('Roads', 'AdminBounds', 'Grayscale')
),
'Hydda' => array(
'variants' => array('Full', 'Base', 'RoadsAndLabels')
),
'MapBox' => array(
'class' => 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\MapBoxProvider',
'options' => array(
'key' => 'tile_provider_key'
),
),
'Stamen' => array(
'variants' => array(
'Toner',
'TonerBackground',
'TonerHybrid',
'TonerLines',
'TonerLabels',
'TonerLite',
'Terrain',
'TerrainBackground',
'TopOSMRelief',
'TopOSMFeatures',
'Watercolor'
)
),
'Esri' => array(
'variants' => array(
'WorldStreetMap',
'DeLorme',
'WorldTopoMap',
'WorldImagery',
'WorldTerrain',
'WorldShadedRelief',
'WorldPhysical',
'OceanBasemap',
'NatGeoWorldMap',
'WorldGrayCanvas'
)
),
'OpenWeatherMap' => array(
'variants' => array(
'Clouds',
'CloudsClassic',
'Precipitation',
'PrecipitationClassic',
'Rain',
'RainClassic',
'Pressure',
'PressureContour',
'Wind',
'Temperature',
'Snow'
)
),
'HERE' => array(
'variants' => array(
'normalDay',
'normalDayCustom',
'normalDayGrey',
'normalDayMobile',
'normalDayGreyMobile',
'normalDayTransit',
'normalDayTransitMobile',
'normalNight',
'normalNightMobile',
'normalNightGrey',
'normalNightGreyMobile',
'basicMap',
'mapLabels',
'trafficFlow',
'carnavDayGrey',
'hybridDay',
'hybridDayMobile',
'pedestrianDay',
'pedestrianNight',
'satelliteDay',
'terrainDay',
'terrainDayMobile',
),
'options' => array(
'appId' => 'tile_provider_key',
'appCode' => 'tile_provider_code',
),
'fields' => array('tile_provider_key', 'tile_provider_code'),
'class' => 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\HereProvider',
),
'JusticeMap' => array(
'variants' => array(
'income',
'americanIndian',
'asian',
'black',
'hispanic',
'multi',
'nonWhite',
'white',
'plurality'
)
),
'FreeMapSK' => array(),
'MtbMap' => array(),
'CartoDB' => array(
'variants' => array(
'Positron',
'PositronNoLabels',
'PositronOnlyLabels',
'DarkMatter',
'DarkMatterNoLabels',
'DarkMatterOnlyLabels',
)
),
'HikeBike' => array(
'variants' => array(
'HikeBike',
'HillShading',
)
),
'BasemapAT' => array(
'variants' => array(
'basemap',
'grau',
'overlay',
'highdpi',
'orthofoto',
)
),
'nlmaps' => array(
'variants' => array('standaard', 'pastel', 'grijs', 'luchtfoto')
),
'NASAGIBS' => array(
'variants' => array(
'ModisTerraTrueColorCR',
'ModisTerraBands367CR',
'ViirsEarthAtNight2012',
'ModisTerraLSTDay',
'ModisTerraSnowCover',
'ModisTerraAOD',
'ModisTerraChlorophyll',
)
),
'NLS' => array()
);

View File

@@ -1,361 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\FilesystemCache;
use Interop\Container\ContainerInterface;
use Netzmacht\Contao\Leaflet\Alias\DefaultAliasFilter;
use Netzmacht\Contao\Leaflet\Boot;
use Netzmacht\Contao\Leaflet\ContaoAssets;
use Netzmacht\Contao\Leaflet\Dca\ControlCallbacks;
use Netzmacht\Contao\Leaflet\Dca\FrontendIntegration;
use Netzmacht\Contao\Leaflet\Dca\LayerCallbacks;
use Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks;
use Netzmacht\Contao\Leaflet\Dca\MapCallbacks;
use Netzmacht\Contao\Leaflet\Dca\Validator;
use Netzmacht\Contao\Leaflet\Dca\VectorCallbacks;
use Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices;
use Netzmacht\Contao\Leaflet\Frontend\MapElement;
use Netzmacht\Contao\Leaflet\Frontend\MapModule;
use Netzmacht\Contao\Leaflet\Frontend\ValueFilter;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\MapProvider;
use Netzmacht\Contao\Leaflet\Subscriber\BootSubscriber;
use Netzmacht\Contao\Leaflet\Subscriber\GeoJsonSubscriber;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\ExistingAliasFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\SlugifyFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\SuffixFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\FilterBasedAliasGenerator;
use Netzmacht\Contao\Toolkit\Data\Alias\Validator\UniqueDatabaseValueValidator;
use Netzmacht\Contao\Toolkit\DependencyInjection\Services;
use Netzmacht\JavascriptBuilder\Builder;
use Netzmacht\JavascriptBuilder\Encoder\ChainEncoder;
use Netzmacht\JavascriptBuilder\Encoder\JavascriptEncoder;
use Netzmacht\JavascriptBuilder\Encoder\MultipleObjectsEncoder;
use Netzmacht\JavascriptBuilder\Flags;
use Netzmacht\JavascriptBuilder\Output;
use Netzmacht\JavascriptBuilder\Symfony\EventDispatchingEncoder;
use Netzmacht\LeafletPHP\Leaflet;
use Symfony\Component\EventDispatcher\EventDispatcher;
/** @var \Pimple $container */
global $container;
/*
* Leaflet map provider is a simply api entry to to get the leaflet map from the database.
*/
$container[LeafletServices::MAP_PROVIDER] = $container->share(function ($container) {
return new MapProvider(
$container[LeafletServices::DEFINITION_MAPPER],
$container[LeafletServices::DEFINITION_BUILDER],
$container[Services::EVENT_DISPATCHER],
$container[Services::INPUT],
$container[LeafletServices::MAP_ASSETS],
$container[LeafletServices::CACHE],
$GLOBALS['LEAFLET_FILTERS'],
\Config::get('debugMode') || \Config::get('displayErrors')
);
});
/*
* Contao assets handler. Loads Leaflet assets as contao (static) assets.
*/
$container[LeafletServices::MAP_ASSETS] = $container->share(function ($container) {
return new ContaoAssets($container[Services::ASSETS_MANAGER]);
});
/*
* The leaflet boot.
*/
$container[LeafletServices::BOOT] = $container->share(function ($container) {
return new Boot($container[Services::EVENT_DISPATCHER]);
});
$container['leaflet.boot.subscriber'] = $container->share(function ($container) {
return new BootSubscriber(
$container[LeafletServices::MAP_ASSETS],
$GLOBALS['LEAFLET_MAPPERS'],
$GLOBALS['LEAFLET_ENCODERS'],
$GLOBALS['LEAFLET_LIBRARIES']
);
});
/*
* The definition mapper.
*/
$container[LeafletServices::DEFINITION_MAPPER] = $container->share(function ($container) {
/** @var Boot $boot */
$boot = $container[LeafletServices::BOOT];
$mapper = new DefinitionMapper($container[Services::EVENT_DISPATCHER]);
return $boot->initializeDefinitionMapper($mapper);
});
/*
* The local event dispatcher is used for the leaflet javascript encoding system.
*/
$container[LeafletServices::DEFINITION_BUILDER_EVENT_DISPATCHER] = $container->share(function ($container) {
/** @var Boot $boot */
$boot = $container[LeafletServices::BOOT];
$dispatcher = new EventDispatcher();
return $boot->initializeEventDispatcher($dispatcher);
});
/*
* The javascript encoder factory being used for building the map javascript.
*/
$container[LeafletServices::DEFINITION_ENCODER_FACTORY] = function ($container) {
$dispatcher = $container[LeafletServices::DEFINITION_BUILDER_EVENT_DISPATCHER];
return function (Output $output) use ($dispatcher) {
$encoder = new ChainEncoder();
$encoder
->register(new MultipleObjectsEncoder())
->register(new EventDispatchingEncoder($dispatcher))
->register(new JavascriptEncoder($output, JSON_UNESCAPED_SLASHES));
return $encoder;
};
};
/*
* The leaflet builder transforms the definition to javascript.
*/
$container[LeafletServices::DEFINITION_BUILDER] = $container->share(function($container) {
/** @var Boot $boot */
$boot = $container[LeafletServices::BOOT];
$dispatcher = $container[LeafletServices::DEFINITION_BUILDER_EVENT_DISPATCHER];
$factory = $container[LeafletServices::DEFINITION_ENCODER_FACTORY];
$builder = new Builder($factory);
$leaflet = new Leaflet($builder, $dispatcher, array(), JSON_UNESCAPED_SLASHES ^ Flags::BUILD_STACK);
return $boot->initializeLeafletBuilder($leaflet);
});
$container[LeafletServices::FRONTEND_VALUE_FILTER] = $container->share(function($container) {
return new ValueFilter($container[Services::INSERT_TAG_REPLACER]);
});
/**
* Internal used leaflet cache.
*
* @var Cache
*/
$container[LeafletServices::CACHE] = $container->share(
function ($container) {
if ($container[Services::PRODUCTION_MODE]) {
return new FilesystemCache(TL_ROOT . '/system/cache/leaflet');
} else {
return new ArrayCache();
}
}
);
/**
* Leaflet alias generator.
*
* @return \Netzmacht\Contao\Toolkit\Data\Alias\AliasGenerator
*/
$container[LeafletServices::ALIAS_GENERATOR] = $container->share(
function ($container) {
return function ($dataContainerName, $aliasField, $fields) use ($container) {
$filters = [
new ExistingAliasFilter(),
new SlugifyFilter($fields),
new DefaultAliasFilter($dataContainerName),
new SuffixFilter(),
];
$validator = new UniqueDatabaseValueValidator(
$container[Services::DATABASE_CONNECTION],
$dataContainerName,
$aliasField
);
return new FilterBasedAliasGenerator($filters, $validator, $dataContainerName, $aliasField, '_');
};
}
);
/**
* Leaflet alias generator.
*
* @return \Netzmacht\Contao\Toolkit\Data\Alias\AliasGenerator
*/
$container[LeafletServices::PARENT_ALIAS_GENERATOR] = $container->share(
function ($container) {
return function ($dataContainerName, $aliasField, $fields) use ($container) {
$filters = [
new ExistingAliasFilter(),
new SlugifyFilter($fields),
new DefaultAliasFilter($dataContainerName),
new SuffixFilter(),
];
$validator = new UniqueDatabaseValueValidator(
$container[Services::DATABASE_CONNECTION],
$dataContainerName,
$aliasField,
['pid']
);
return new FilterBasedAliasGenerator($filters, $validator, $dataContainerName, $aliasField, '_');
};
}
);
/**
* Callback helper class for tl_leaflet_map.
*
* @return MapCallbacks
*/
$container['leaflet.dca.map-callbacks'] = $container->share(
function ($container) {
return new MapCallbacks(
$container[Services::DCA_MANAGER],
$container[Services::DATABASE_CONNECTION]
);
}
);
/**
* Callback helper class for tl_leaflet_layer.
*
* @return LayerCallbacks
*/
$container['leaflet.dca.layer-callbacks'] = $container->share(
function ($container) {
return new LayerCallbacks(
$container[Services::DCA_MANAGER],
$container[Services::DATABASE_CONNECTION],
$container[Services::TRANSLATOR],
$GLOBALS['LEAFLET_LAYERS'],
$GLOBALS['LEAFLET_TILE_PROVIDERS'],
require TL_ROOT . '/system/modules/leaflet/config/leaflet_amenities.php'
);
}
);
/**
* Callback helper class for tl_leaflet_control.
*
* @return ControlCallbacks
*/
$container['leaflet.dca.control-callbacks'] = $container->share(
function ($container) {
return new ControlCallbacks(
$container[Services::DCA_MANAGER],
$container[Services::DATABASE_CONNECTION]
);
}
);
/**
* Callback helper class for tl_leaflet_control.
*
* @return ControlCallbacks
*/
$container['leaflet.dca.vector-callbacks'] = $container->share(
function ($container) {
return new VectorCallbacks($container[Services::DCA_MANAGER]);
}
);
/**
* Callback helper class for frontend integration.
*
* @return FrontendIntegration
*/
$container['leaflet.dca.frontend-integration'] = $container->share(
function ($container) {
return new FrontendIntegration(
$container[Services::TRANSLATOR]
);
}
);
/**
* Common callback helpers.
*
* @return LeafletCallbacks
*/
$container['leaflet.dca.common'] = $container->share(
function ($container) {
return new LeafletCallbacks(
$container[Services::FILE_SYSTEM]
);
}
);
/**
* Validator helper class.
*
* @return Validator
*/
$container['leaflet.dca.validator'] = $container->share(
function ($container) {
return new Validator(
$container[Services::TRANSLATOR]
);
}
);
/**
* Component factory for content element.
*
* @param ContentModel $model Content model.
* @param string $column Template section.
* @param ContainerInterface $container Container.
*
* @return MapElement
*/
$container[Services::CONTENT_ELEMENTS_MAP]['leaflet'] = function ($model, $column, ContainerInterface $container) {
return new MapElement(
$model,
$container->get(Services::TEMPLATE_FACTORY),
$container->get(Services::TRANSLATOR),
$container->get(LeafletServices::MAP_PROVIDER),
$container->get(Services::INPUT),
$container->get(Services::CONFIG),
$column
);
};
/**
* Component factory for frontend module.
*
* @param ModuleModel $model Module model.
* @param string $column Template section.
* @param ContainerInterface $container Container.
*
* @return MapModule
*/
$container[Services::MODULES_MAP]['leaflet'] = function ($model, $column, ContainerInterface $container) {
return new MapModule(
$model,
$container->get(Services::TEMPLATE_FACTORY),
$container->get(Services::TRANSLATOR),
$container->get(LeafletServices::MAP_PROVIDER),
$container->get(Services::INPUT),
$container->get(Services::CONFIG),
$column
);
};
$container['leaflet.subscriber.geo-json'] = $container->share(function () {
return new GeoJsonSubscriber(
$GLOBALS['LEAFLET_FEATURE_MODEL_PROPERTIES']
);
});

View File

@@ -1,79 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = array(
'type' => array('type', 'headline'),
'leaflet' => array('leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'),
'templates' => array(':hide', 'customTpl'),
'protected' => array(':hide', 'protected'),
'expert' => array(':hide', 'guests', 'cssID', 'space'),
'invisible' => array(':hide', 'invisible', 'start', 'start')
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_map'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_map'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\FrontendIntegration::callback('getMaps'),
'wizard' => array(
\Netzmacht\Contao\Leaflet\Dca\FrontendIntegration::callback('getEditMapLink'),
),
'eval' => array(
'tl_class' => 'w50 wizard',
'chosen' => true,
),
'sql' => "int(10) unsigned NOT NULL default '0'"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_mapId'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_mapId'],
'inputType' => 'text',
'exclude' => true,
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
'maxlength' => 16,
),
'sql' => "varchar(16) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_width'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_width'],
'inputType' => 'inputUnit',
'options' => array('px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'),
'search' => false,
'exclude' => true,
'eval' => array('rgxp' => 'digit', 'tl_class' => 'clr w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_height'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_height'],
'inputType' => 'inputUnit',
'options' => array('px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'),
'search' => false,
'exclude' => true,
'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_template'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_template'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::getTemplates('leaflet_map_js'),
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
),
'sql' => "varchar(64) NOT NULL default ''"
);

View File

@@ -1,439 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
\Controller::loadLanguageFile('leaflet');
$GLOBALS['TL_DCA']['tl_leaflet_control'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'ptable' => 'tl_leaflet_map',
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'pid' => 'index',
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
// List
'list' => array
(
'sorting' => array
(
'mode' => 4,
'fields' => array('sorting'),
'headerFields' => array('title'),
'flag' => 1,
'sorting' => 2,
'panelLayout' => 'filter,sort;search,limit',
'child_record_callback' => \Netzmacht\Contao\Leaflet\Dca\ControlCallbacks::callback('generateRow'),
),
'label' => array
(
'fields' => array('title'),
'format' => '%s',
),
'global_operations' => array
(
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['edit'],
'href' => 'act=edit',
'icon' => 'header.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton('tl_leaflet_control', 'active')
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'palettes' => array(
'__selector__' => array('type')
),
'metapalettes' => array(
'default' => array(
'name' => array('title', 'alias', 'type', 'position'),
'config' => array(),
'active' => array('active'),
),
'zoom extends default' => array(
'config' => array('zoomInText', 'zoomOutText', 'zoomInTitle', 'zoomOutTitle'),
),
'layers extends default' => array(
'config' => array('layers', 'collapsed', 'autoZIndex')
),
'scale extends default' => array(
'config' => array('maxWidth', 'metric', 'imperial', 'updateWhenIdle')
),
'attribution extends default' => array(
'config' => array('attributions', 'prefix', 'disableDefault')
),
'loading extends default' => array(
'config' => array('separate', 'zoomControl', 'spinjs')
),
'fullscreen extends default' => array(
'config' => array('buttonTitle', 'separate', 'simulateFullScreen')
),
),
'metasubpalettes' => array(
'spinjs' => array('spin')
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'pid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'sorting' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'",
'sorting' => true,
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['title'],
'exclude' => true,
'inputType' => 'text',
'sorting' => true,
'search' => true,
'flag' => 1,
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_control',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::PARENT_ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias'),
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "varchar(255) NULL"
),
'type' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['type'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
'helpwizard' => true,
),
'options' => $GLOBALS['LEAFLET_CONTROLS'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_control'],
'sql' => "varchar(32) NOT NULL default ''"
),
'position' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['position'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'options' => array('topleft', 'topright', 'bottomleft', 'bottomright'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'],
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50', 'helpwizard' => true),
'sql' => "varchar(255) NOT NULL default ''"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'zoomInText' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'zoomOutText' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'zoomInTitle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInTitle'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'zoomOutTitle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutTitle'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'collapsed' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['collapsed'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'autoZIndex' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['autoZIndex'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'layers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layers'],
'exclude' => true,
'inputType' => 'multiColumnWizard',
'load_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\ControlCallbacks::callback('loadLayerRelations'),
),
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\ControlCallbacks::callback('saveLayerRelations'),
),
'eval' => array
(
'tl_class' => 'clr',
'columnFields' => array
(
'layer' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\ControlCallbacks::callback('getLayers'),
'eval' => array(
'style' => 'width: 300px',
'chosen' => true,
'includeBlankOption' => true
),
),
'mode' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'],
'exclude' => true,
'inputType' => 'select',
'options' => array('base', 'overlay'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'],
'eval' => array(
'style' => 'width: 200px',
'helpwizard' => true,
),
),
)
),
'sql' => "mediumblob NULL"
),
'maxWidth' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['maxWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => 100,
'eval' => array('tl_class' => 'w50', 'rgxp' => 'digit'),
'sql' => "int(5) NOT NULL default '100'"
),
'metric' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['metric'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => array('tl_class' => 'w50 clr'),
'sql' => "char(1) NOT NULL default '1'"
),
'imperial' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['imperial'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default '1'"
),
'updateWhenIdle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['updateWhenIdle'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'prefix' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['prefix'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'attributions' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['attributions'],
'exclude' => true,
'inputType' => 'listWizard',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'clr', 'allowHtml' => true),
'sql' => "mediumblob NULL"
),
'separate' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['separate'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
),
'zoomControl' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomControl'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\ControlCallbacks::callback('getZoomControls'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'],
'eval' => array(
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true
),
'sql' => "varchar(255) NOT NULL default ''"
),
'spinjs' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['spinjs'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'spin' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['spin'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'style' => 'height:60px',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|json',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'simulateFullScreen' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['simulateFullScreen'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
),
'buttonTitle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['buttonTitle'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'disableDefault' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['disableDefault'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
),
),
);

View File

@@ -1,52 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_control_layer'] = array
(
'config' => array(
'dataContainer' => 'Table',
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'cid,lid' => 'unique',
)
)
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'sorting' => array(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'cid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'lid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'mode' => array
(
'sql' => "varchar(16) NOT NULL default ''"
)
)
);

View File

@@ -1,449 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_icon'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'alias' => 'unique',
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'list' => array
(
'sorting' => array
(
'mode' => 1,
'fields' => array('title'),
'flag' => 1,
'panelLayout' => 'limit',
'headerFields' => array('title', 'type'),
),
'label' => array
(
'fields' => array('title', 'type'),
'format' => '%s <span class="tl_gray">[%s]</span>',
),
'global_operations' => array
(
'layers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['layersBtn'],
'href' => 'table=tl_leaflet_layer',
'icon' => 'system/modules/leaflet/assets/img/layers.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
'styles' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'system/modules/leaflet/assets/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'popups' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'system/modules/leaflet/assets/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_icon',
'active'
)
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'palettes' => array(
'__selector__' => array('type')
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias', 'type'),
),
'image extends default' => array(
'config' => array(
'iconImage',
'iconRetinaImage',
'iconAnchor',
'popupAnchor',
'className',
),
'shadow' => array(
'shadowImage',
'shadowRetinaImage',
'shadowAnchor',
),
'active' => array(
'active'
)
),
'div extends default' => array(
'config' => array(
'html',
'iconSize',
'iconAnchor',
'popupAnchor',
'className',
),
'active' => array(
'active'
)
),
'extra extends default' => array(
'config' => array(
'icon',
'prefix',
'shape',
'markerColor',
'number',
'iconColor',
),
'active' => array(
'active'
)
),
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['title'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['alias'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_icon',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias'),
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
'sql' => "varchar(255) NULL"
),
'type' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['type'],
'exclude' => true,
'inputType' => 'select',
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
),
'options' => &$GLOBALS['LEAFLET_ICONS'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_icon'],
'sql' => "varchar(32) NOT NULL default ''"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'iconImage' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array(
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => true,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg'
),
'sql' => "binary(16) NULL",
),
'iconRetinaImage' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconRetinaImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array(
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => false,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg'
),
'sql' => "binary(16) NULL",
),
'shadowImage' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shadowImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array(
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => false,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg'
),
'sql' => "binary(16) NULL",
),
'shadowRetinaImage' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shadowRetinaImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array(
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => false,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg'
),
'sql' => "binary(16) NULL",
),
'iconAnchor' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconAnchor'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
'shadowAnchor' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shadowAnchor'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
'popupAnchor' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['popupAnchor'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
'className' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['className'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'iconSize' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconSize'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'maxlength' => 64,
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(64) NULL"
),
'html' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['html'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'style' => 'height:60px',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|html',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'icon' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['icon'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'maxlength' => 64,
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(64) NULL"
),
'prefix' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['prefix'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'maxlength' => 64,
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(64) NULL"
),
'shape' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shape'],
'exclude' => true,
'inputType' => 'select',
'default' => 'circle',
'options' => ['circle', 'square', 'star', 'penta'],
'eval' => array(
'tl_class' => 'w50',
),
'sql' => "varchar(64) NULL"
),
'iconColor' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconColor'],
'exclude' => true,
'inputType' => 'text',
'wizard' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::colorPicker()
),
'eval' => array(
'maxlength' => 64,
'tl_class' => 'w50 wizard',
'nullIfEmpty' => true,
),
'sql' => "varchar(16) NULL"
),
'markerColor' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['markerColor'],
'exclude' => true,
'inputType' => 'select',
'default' => 'circle',
'options' => [
'blue',
'red',
'orange-dark',
'orange',
'yellow',
'blue-dark',
'cyan',
'purple',
'violet',
'pink',
'green-dark',
'green',
'green-light',
'black',
'white'
],
'eval' => array(
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(16) NULL"
),
),
);

View File

@@ -1,930 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'ctable' => array('tl_leaflet_vector', 'tl_leaflet_marker'),
'ondelete_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('deleteRelations'),
),
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'pid' => 'index',
'alias' => 'unique',
)
),
'onload_callback' => array(
function() {
\Controller::loadLanguageFile('leaflet');
}
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'list' => array
(
'sorting' => array
(
'mode' => 5,
'fields' => array('title'),
'flag' => 1,
'icon' => 'system/modules/leaflet/assets/img/layers.png',
'panelLayout' => 'filter;search,limit',
'paste_button_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('getPasteButtons'),
),
'label' => array
(
'fields' => array('title'),
'format' => '%s',
'label_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('generateRow')
),
'global_operations' => array
(
'styles' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'system/modules/leaflet/assets/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'icons' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'],
'href' => 'table=tl_leaflet_icon',
'icon' => 'system/modules/leaflet/assets/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'popups' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'system/modules/leaflet/assets/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();"'
)
),
'operations' => array
(
'markers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['markers'],
'href' => 'table=tl_leaflet_marker',
'icon' => 'edit.gif',
'button_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('generateMarkersButton')
),
'vectors' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['vectors'],
'href' => 'table=tl_leaflet_vector',
'icon' => 'edit.gif',
'button_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('generateVectorsButton'),
),
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['edit'],
'href' => 'act=edit',
'icon' => 'header.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'cut' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cut'],
'href' => 'act=paste&amp;mode=cut',
'icon' => 'cut.gif',
'attributes' => 'onclick="Backend.getScrollOffset()"',
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_layer',
'active'
),
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'palettes' => array(
'__selector__' => array('type'),
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias', 'type'),
'config' => array(),
'style' => array(),
'expert' => array(':hide'),
'active' => array('active'),
),
'markers extends default' => array(
'+expert' => array('pointToLayer'),
'+config' => array('boundsMode', 'deferred')
),
'group extends default' => array(
'+title' => array('groupType'),
'+active' => array('boundsMode')
),
'vectors extends default' => array(
'+expert' => array('onEachFeature', 'pointToLayer'),
'+config' => array('boundsMode', 'deferred'),
),
'reference extends default' => array(
'+title' => array('reference', 'standalone')
),
'markercluster extends default' => array(
'config' => array(
'showCoverageOnHover',
'zoomToBoundsOnClick',
'removeOutsideVisibleBounds',
'animateAddingMarkers',
'spiderfyOnMaxZoom',
'disableClusteringAtZoom',
'maxClusterRadius',
'singleMarkerMode',
),
'+expert' => array(
'polygonOptions',
'iconCreateFunction',
'disableDefaultStyle'
)
),
'tile extends default' => array(
'config' => array(
'tileUrl',
'subdomains',
'attribution',
'minZoom',
'maxZoom',
),
'+expert' => array(
'errorTileUrl',
'tileSize',
'tms',
'continuousWorld',
'noWrap',
'zoomReverse',
'zoomOffset',
'maxNativeZoom',
'opacity',
'zIndex',
'unloadvisibleTiles',
'updateWhenIdle',
'detectRetina',
'reuseTiles',
'bounds'
)
),
'overpass extends default' => array(
'config' => array(
'overpassQuery',
'boundsMode',
'minZoom',
'overpassEndpoint',
'overpassPopup'
),
'style' => array(
'amenityIcons'
),
'+expert' => array(
'onEachFeature',
'pointToLayer',
),
),
),
'metasubselectpalettes' => array(
'type' => array(
'provider' => array('tile_provider', 'tile_provider_variant')
),
'tile_provider' => array(
'MapBox' => array('tile_provider_key'),
'HERE' => array('tile_provider_key', 'tile_provider_code'),
),
),
'metasubpalettes' => array(
'spiderfyOnMaxZoom' => array('spiderfyDistanceMultiplier'),
'deferred' => array('cache'),
'cache' => array('cacheLifeTime')
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'pid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'sorting' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['title'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_layer',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias'),
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
'sql' => "varchar(255) NULL"
),
'type' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['type'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
'helpwizard' => true,
),
'options' => array_keys($GLOBALS['LEAFLET_LAYERS']),
'reference' => &$GLOBALS['TL_LANG']['leaflet_layer'],
'sql' => "varchar(32) NOT NULL default ''"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'tile_provider' => array(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider'],
'exclude' => true,
'inputType' => 'select',
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50 clr',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
),
'options' => array_keys($GLOBALS['LEAFLET_TILE_PROVIDERS']),
'sql' => "varchar(32) NOT NULL default ''"
),
'tile_provider_variant' => array(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_variant'],
'exclude' => true,
'inputType' => 'select',
'eval' => array(
'mandatory' => false,
'tl_class' => 'w50',
'submitOnChange' => true,
'chosen' => false,
),
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('getVariants'),
'sql' => "varchar(32) NOT NULL default ''"
),
'tile_provider_key' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_key'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'tile_provider_code' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_code'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'deferred' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['deferred'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'groupType' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupType'],
'exclude' => true,
'inputType' => 'select',
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'submitOnChange' => true,
'helpwizard' => true,
),
'default' => 'layer',
'options' => array('layer', 'feature'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes'],
'sql' => "varchar(32) NOT NULL default ''"
),
'reference' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('getLayers'),
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
),
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'standalone' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['standalone'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default ''"
),
'onEachFeature' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['onEachFeature'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'pointToLayer' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['pointToLayer'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'showCoverageOnHover' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['showCoverageOnHover'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'zoomToBoundsOnClick' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zoomToBoundsOnClick'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'spiderfyOnMaxZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['spiderfyOnMaxZoom'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'removeOutsideVisibleBounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['removeOutsideVisibleBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'animateAddingMarkers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['animateAddingMarkers'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default ''"
),
'disableClusteringAtZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['disableClusteringAtZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'default' => '',
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'maxClusterRadius' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxClusterRadius'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
),
'singleMarkerMode' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['singleMarkerMode'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default ''"
),
'polygonOptions' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['polygonOptions'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|json',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'spiderfyDistanceMultiplier' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['spiderfyDistanceMultiplier'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
),
'iconCreateFunction' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'disableDefaultStyle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['disableDefaultStyle'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default ''"
),
'boundsMode' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['boundsMode'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('getBoundsModes'),
'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true),
'sql' => "varchar(6) NOT NULL default ''"
),
'tileUrl' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tileUrl'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50', 'mandatory' => true),
'sql' => "varchar(255) NOT NULL default ''"
),
'minZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'maxZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'maxNativeZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxNativeZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'tileSize' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tileSize'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
),
'subdomains' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['subdomains'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('maxlength' => 16, 'tl_class' => 'w50'),
'sql' => "varchar(16) NOT NULL default ''"
),
'errorTileUrl' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['errorTileUrl'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'attribution' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['attribution'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('maxlength' => 255, 'tl_class' => 'long', 'allowHtml' => true),
'sql' => "varchar(255) NOT NULL default ''"
),
'tms' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tms'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'continuousWorld' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['continuousWorld'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'noWrap' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['noWrap'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'zoomOffset' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zoomOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
),
'zoomReverse' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zoomReverse'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'opacity' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['opacity'],
'exclude' => true,
'inputType' => 'text',
'default' => '1.0',
'eval' => array('mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50 clr'),
'sql' => "varchar(4) NOT NULL default ''"
),
'zIndex' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zIndex'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
),
'unloadvisibleTiles' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['unloadvisibleTiles'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'updateWhenIdle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['updateWhenIdle'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'detectRetina' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['detectRetina'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'reuseTiles' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['reuseTiles'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'bounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['bounds'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
),
'eval' => array(
'maxlength' => 255,
'multiple'=>true,
'size'=>2,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
),
'sql' => "mediumblob NULL"
),
'cache' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cache'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'cacheLifeTime' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cacheLifeTime'],
'exclude' => true,
'inputType' => 'text',
'default' => 0,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'overpassQuery' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassQuery'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'overpassEndpoint' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassEndpoint'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'overpassCallback' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassCallback'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
'minZoomIndicatorPosition' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorPosition'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'options' => array('topleft', 'topright', 'bottomleft', 'bottomright'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_layer'],
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50', 'helpwizard' => true),
'sql' => "varchar(255) NOT NULL default ''"
),
'minZoomIndicatorMessage' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorMessage'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('tl_class' => 'clr w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'minZoomIndicatorMessageNoLayer' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorMessageNoLayer'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'debug' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['debug'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
),
'amenityIcons' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenityIcons'],
'exclude' => true,
'inputType' => 'multiColumnWizard',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'getIcons'),
'eval' => array(
'columnFields' => array(
'amenity' => array(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenity'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\LayerCallbacks::callback('getAmenities'),
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'style' => 'width: 200px',
'chosen' => true,
),
),
'icon' => array(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenityIcon'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'getIcons'),
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'style' => 'width: 200px',
'chosen' => true,
),
),
),
),
'sql' => "blob NULL",
),
'overpassPopup' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassPopup'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
)
);

View File

@@ -1,585 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_map'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'ctable' => array('tl_leaflet_control'),
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'alias' => 'unique',
)
),
'onload_callback' => array(
function() {
\Controller::loadLanguageFile('leaflet');
}
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'list' => array
(
'sorting' => array
(
'mode' => 1,
'fields' => array('title'),
'panelLayout' => 'search,limit',
'flag' => 1,
),
'label' => array
(
'fields' => array('title', 'alias'),
'format' => '%s <span class="tl_gray">[%s]</span>'
),
'global_operations' => array
(
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['edit'],
'href' => 'act=edit',
'icon' => 'header.gif'
),
'controls' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['controls'],
'href' => 'table=tl_leaflet_control',
'icon' => 'system/modules/leaflet/assets/img/control.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias'),
'zoom' => array('center', 'zoom', 'adjustZoomExtra', 'adjustBounds', 'dynamicLoad', 'boundsPadding'),
'locate' => array('locate'),
'layers' => array('layers'),
'interaction' => array(
'dragging',
'touchZoom',
'scrollWheelZoom',
'doubleClickZoom',
'boxZoom',
'tap',
'keyboard'
),
'behaviour' => array(
'zoomControl',
'trackResize',
'closeOnClick',
'bounceAtZoomLimits'
),
'expert' => array(
'options',
'cache',
)
),
),
'metasubpalettes' => array(
'keyboard' => array(
'keyboardPanOffset',
'keyboardZoomOffset'
),
'adjustZoomExtra' => array(
'minZoom',
'maxZoom',
'zoomSnap',
'zoomDelta',
),
'locate' => array(
':hide',
'locateWatch',
'locateSetView',
'locateMaxZoom',
'locateTimeout',
'locateMaximumAge',
'enableHighAccuracy'
),
'cache' => array(
'cacheLifeTime'
)
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['title'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_map',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias')
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
'sql' => "varchar(255) NULL"
),
'center' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['center'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates'),
),
'wizard' => array(
Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getGeocoder')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
'layers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'],
'exclude' => true,
'inputType' => 'multiColumnWizard',
'load_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\MapCallbacks::callback('loadLayerRelations'),
),
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\MapCallbacks::callback('saveLayerRelations'),
),
'eval' => array(
'multiple' => true,
'doNotSaveEmpty' => true,
'columnFields' => array(
'reference' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['reference'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\MapCallbacks::callback('getLayers'),
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
'style' => 'width: 300px'
),
'sql' => "int(10) unsigned NOT NULL default '0'",
),
),
'flatArray' => true
),
'sql' => "mediumblob NULL"
),
'zoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'default' => '',
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'adjustZoomExtra' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustZoomExtra'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'minZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'maxZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'zoomSnap' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "varchar(4) NULL"
),
'zoomDelta' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "varchar(4) NULL"
),
'dragging' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['dragging'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'touchZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['touchZoom'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'scrollWheelZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['scrollWheelZoom'],
'exclude' => true,
'inputType' => 'select',
'options' => array('1', 'center'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'],
'default' => true,
'eval' => array(
'tl_class' => 'w50',
'helpwizard' => true,
'includeBlankOption' => true,
'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'][''][0]
),
'sql' => "char(6) NOT NULL default ''"
),
'doubleClickZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'],
'exclude' => true,
'inputType' => 'select',
'options' => array('1', 'center'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'],
'default' => true,
'eval' => array(
'tl_class' => 'w50',
'helpwizard' => true,
'includeBlankOption' => true,
'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'][''][0]
),
'sql' => "char(6) NOT NULL default ''"
),
'boxZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['boxZoom'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'tap' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['tap'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'trackResize' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['trackResize'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default '1'"
),
'bounceAtZoomLimits' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['bounceAtZoomLimits'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default '1'"
),
'closeOnClick' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['closeOnClick'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default '1'"
),
'keyboard' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboard'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'keyboardPanOffset' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardPanOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => 80,
'eval' => array('mandatory' => true, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'clr w50'),
'sql' => "int(4) NOT NULL default '80'"
),
'keyboardZoomOffset' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardZoomOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => 1,
'eval' => array('mandatory' => true, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "int(4) NOT NULL default '1'"
),
'zoomControl' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default '1'"
),
'options' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['options'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array('tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json'
),
'sql' => "text NULL"
),
'adjustBounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'options' => array('load', 'deferred'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBoundsOptions'],
'eval' => array('tl_class' => 'clr w50', 'multiple' => true, 'helpwizard' => true),
'sql' => "varchar(255) NOT NULL default ''"
),
'dynamicLoad' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['dynamicLoad'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'clr w50', 'submitOnChange' => false),
'sql' => "char(1) NOT NULL default ''"
),
'boundsPadding' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['boundsPadding'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'maxlength' => 32,
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "varchar(32) NULL"
),
'locate' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locate'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'locateWatch' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateWatch'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'locateSetView' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateSetView'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false),
'sql' => "char(1) NOT NULL default ''"
),
'locateTimeout' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateTimeout'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "int(9) NULL"
),
'locateMaximumAge' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaximumAge'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true),
'sql' => "int(9) NULL"
),
'enableHighAccuracy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['enableHighAccuracy'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
),
'locateMaxZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'clr w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
'cache' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['cache'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'cacheLifeTime' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['cacheLifeTime'],
'exclude' => true,
'inputType' => 'text',
'default' => 0,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "int(9) NOT NULL default '0'"
),
),
);

View File

@@ -1,48 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_map_layer'] = array
(
'config' => array(
'dataContainer' => 'Table',
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'mid,lid' => 'unique',
)
)
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'sorting' => array(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'mid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'lid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
)
);

View File

@@ -1,376 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'ptable' => 'tl_leaflet_layer',
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'pid' => 'index',
'alias' => 'unique',
)
),
'onload_callback' => array(
function() {
\Controller::loadLanguageFile('leaflet');
}
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'list' => array
(
'sorting' => array
(
'mode' => 4,
'fields' => array('sorting'),
'flag' => 1,
'panelLayout' => 'sort,filter;search,limit',
'headerFields' => array('title', 'type'),
'child_record_callback' => array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'generateRow'),
),
'label' => array
(
'fields' => array('title'),
'format' => '%s',
),
'global_operations' => array
(
'icons' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icons'],
'href' => 'table=tl_leaflet_icon&id=',
'icon' => 'system/modules/leaflet/assets/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
'popups' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'system/modules/leaflet/assets/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_marker',
'active'
)
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias', 'coordinates'),
'content' => array('tooltip', 'alt', 'addPopup'),
'config' => array(
':hide',
'clickable',
'draggable',
'keyboard',
'zIndexOffset',
'opacity',
'riseOnHover',
'riseOffset',
'customIcon',
),
'expert' => array(':hide', 'featureData'),
'active' => array('active', 'ignoreForBounds')
),
),
'metasubpalettes' => array(
'addPopup' => array('popup', 'popupContent'),
'customIcon' => array('icon')
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'sorting' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'",
'sorting' => true,
),
'pid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['title'],
'exclude' => true,
'search' => true,
'sorting' => true,
'flag' => 1,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_marker',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias'),
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
'sql' => "varchar(255) NULL"
),
'coordinates' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['coordinates'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates'),
array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'saveCoordinates')
),
'load_callback' => array(
array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'loadCoordinates')
),
'wizard' => array(
Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getGeocoder')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
'doNotSaveEmpty' => true,
),
),
'latitude' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['latitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "decimal(10,8) NULL"
),
'longitude' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['longitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "decimal(11,8) NULL"
),
'altitude' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['altitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "float NULL"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['active'],
'exclude' => true,
'filter' => true,
'sorting' => true,
'flag' => 12,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'tooltip' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['tooltip'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alt' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['alt'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'addPopup' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['addPopup'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'popup' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popup'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'getPopups'),
'eval' => array(
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
),
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'popupContent' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popupContent'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'rte' => 'tinyMCE', 'helpwizard' => true, 'tl_class' => 'clr'),
'explanation' => 'insertTags',
'sql' => "mediumtext NULL"
),
'customIcon' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['customIcon'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'clr w50 m12', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'icon' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icon'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'getIcons'),
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'chosen' => true,
),
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'draggable' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['draggable'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'clickable' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['clickable'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'keyboard' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['keyboard'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'zIndexOffset' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['zIndexOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => 0,
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'clr w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
),
'ignoreForBounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['ignoreForBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'featureData' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['featureData'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array('tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json'
),
'sql' => "text NULL"
),
),
);

View File

@@ -1,302 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_popup'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'alias' => 'unique',
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'list' => array
(
'sorting' => array
(
'mode' => 1,
'fields' => array('title'),
'flag' => 1,
'panelLayout' => 'limit',
'headerFields' => array('title', 'type'),
),
'label' => array
(
'fields' => array('title', 'type'),
'format' => '%s <span class="tl_gray">[%s]</span>',
),
'global_operations' => array
(
'layers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'],
'href' => 'table=tl_leaflet_layer',
'icon' => 'system/modules/leaflet/assets/img/layers.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
'styles' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'system/modules/leaflet/assets/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'icons' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'],
'href' => 'table=tl_leaflet_icon',
'icon' => 'system/modules/leaflet/assets/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_popup',
'active'
)
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'palettes' => array(
'__selector__' => array('type')
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias'),
'size' => array('maxWidth', 'minWidth', 'maxHeight'),
'config' => array(
':hide',
'closeButton',
'keepInView',
'closeOnClick',
'zoomAnimation',
'offset',
'className',
'autoPan'
),
'active' => array('active'),
),
),
'metasubpalettes' => array(
'autoPan' => array('autoPanPadding')
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['title'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['alias'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_popup',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias'),
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
'sql' => "varchar(255) NULL"
),
'maxWidth' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['maxWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "int(4) NULL"
),
'minWidth' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['minWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "int(4) NULL"
),
'maxHeight' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['maxHeight'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => array('mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "int(4) NULL"
),
'autoPan' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['autoPan'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'keepInView' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false),
'sql' => "char(1) NOT NULL default ''"
),
'closeButton' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['closeButton'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false),
'sql' => "char(1) NOT NULL default '1'"
),
'offset' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['offset'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
'autoPanPadding' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['autoPanPadding'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
'multiple' => true,
'size' => 2,
),
'sql' => "varchar(255) NULL"
),
'zoomAnimation' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['zoomAnimation'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false),
'sql' => "char(1) NOT NULL default '1'"
),
'closeOnClick' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['closeOnClick'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false),
'sql' => "char(1) NOT NULL default '1'"
),
'className' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['className'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 12,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
),
);

View File

@@ -1,304 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_style'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'alias' => 'unique',
)
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'list' => array
(
'sorting' => array
(
'mode' => 1,
'fields' => array('title'),
'flag' => 1,
'panelLayout' => 'limit',
'headerFields' => array('title', 'type'),
),
'label' => array
(
'fields' => array('title', 'type'),
'format' => '%s <span class="tl_gray">[%s]</span>',
),
'global_operations' => array
(
'layers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['layersBtn'],
'href' => 'table=tl_leaflet_layer',
'icon' => 'system/modules/leaflet/assets/img/layers.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
'icons' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'],
'href' => 'table=tl_leaflet_icon',
'icon' => 'system/modules/leaflet/assets/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'popups' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'system/modules/leaflet/assets/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_style',
'active'
)
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'palettes' => array(
'__selector__' => array('type')
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias', 'type'),
'config' => array(),
'active' => array('active'),
),
'fixed extends default' => array(
'config' => array('stroke', 'fill'),
),
),
'metasubpalettes' => array(
'stroke' => array('color', 'weight', 'opacity', 'dashArray', 'lineCap', 'lineJoin'),
'fill' => array('fillColor', 'fillOpacity',)
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['title'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['alias'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_style',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias'),
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
'sql' => "varchar(255) NULL"
),
'type' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['type'],
'exclude' => true,
'inputType' => 'select',
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
),
'options' => &$GLOBALS['LEAFLET_STYLES'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_style'],
'sql' => "varchar(32) NOT NULL default ''"
),
'stroke' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['stroke'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'color' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['color'],
'exclude' => true,
'inputType' => 'text',
'wizard' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::colorPicker()
),
'eval' => array(
'tl_class' => 'w50 wizard clr',
'maxlength' => 7,
'decodeEntities' => true
),
'sql' => "varchar(8) NOT NULL default ''"
),
'weight' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['weight'],
'exclude' => true,
'inputType' => 'text',
'default' => 5,
'eval' => array('mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "int(4) NOT NULL default '5'"
),
'opacity' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity'],
'exclude' => true,
'inputType' => 'text',
'default' => '0.5',
'eval' => array('mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "varchar(4) NOT NULL default '0.5'"
),
'fill' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['fill'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'clr w50', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'fillColor' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['fillColor'],
'exclude' => true,
'inputType' => 'text',
'wizard' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::colorPicker()
),
'eval' => array(
'tl_class' => 'clr w50 wizard',
'maxlength' => 7,
'decodeEntities' => true
),
'sql' => "varchar(8) NOT NULL default ''"
),
'fillOpacity' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['fillOpacity'],
'exclude' => true,
'inputType' => 'text',
'default' => '0.2',
'eval' => array('mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "varchar(4) NOT NULL default '0.2'"
),
'dashArray' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['dashArray'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 32, 'tl_class' => 'w50'),
'sql' => "varchar(32) NOT NULL default ''"
),
'lineCap' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineCap'],
'exclude' => true,
'inputType' => 'select',
'options' => array('butt', 'round', 'square', 'inherit'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineCaps'],
'eval' => array('mandatory' => false, 'tl_class' => 'w50 clr', 'includeBlankOption' => true, 'helpwizard'),
'sql' => "varchar(8) NOT NULL default ''"
),
'lineJoin' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineJoin'],
'exclude' => true,
'inputType' => 'select',
'options' => array('miter', 'round', 'bevel', 'inherit'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineJoins'],
'eval' => array('mandatory' => false, 'tl_class' => 'w50', 'includeBlankOption' => true, 'helpwizard'),
'sql' => "varchar(8) NOT NULL default ''"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 12,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
),
);

View File

@@ -1,415 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'ptable' => 'tl_leaflet_layer',
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'pid' => 'index',
'alias' => 'unique',
)
),
'onload_callback' => array(
function() {
\Controller::loadLanguageFile('leaflet');
}
),
'onsubmit_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'list' => array
(
'sorting' => array
(
'mode' => 4,
'fields' => array('sorting'),
'flag' => 1,
'panelLayout' => 'sort,filter;search,limit',
'headerFields' => array('title', 'type'),
'child_record_callback' => Netzmacht\Contao\Leaflet\Dca\VectorCallbacks::callback('generateRow'),
),
'label' => array
(
'fields' => array('title'),
'format' => '%s',
),
'global_operations' => array
(
'styles' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'system/modules/leaflet/assets/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'popups' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'system/modules/leaflet/assets/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"'
),
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'cut' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['cut'],
'href' => 'act=paste&amp;mode=cut',
'icon' => 'cut.gif',
'attributes' => 'onclick="Backend.getScrollOffset()"',
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::stateButton(
'tl_leaflet_vector',
'active'
)
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'palettes' => array(
'__selector__' => array('type')
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias', 'type'),
'data' => array(),
'popup' => array(':hide','addPopup'),
'config' => array(':hide', 'style', 'className', 'clickable'),
'expert' => array(':hide', 'featureData'),
'active' => array('active', 'ignoreForBounds')
),
'polyline extends default' => array(
'+config' => array('smoothFactor', 'noClip'),
'data' => array('data')
),
'multiPolyline extends polyline' => array(
'data' => array('multiData')
),
'polygon extends polyline' => array(),
'multiPolygon extends multiPolyline' => array(
),
'rectangle extends polygon' => array(
'data' => array('bounds'),
),
'circle extends default' => array(
'+data' => array('coordinates', 'radius'),
),
'circleMarker extends circle' => array(),
),
'metasubpalettes' => array(
'addPopup' => array('popup', 'popupContent'),
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'pid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'sorting' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'",
'sorting' => true,
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['title'],
'exclude' => true,
'inputType' => 'text',
'filter' => false,
'sorting' => true,
'search' => true,
'flag' => 1,
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => array(
\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::aliasGenerator(
'tl_leaflet_vector',
'alias',
['title'],
\Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices::ALIAS_GENERATOR
),
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateAlias'),
),
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
'sql' => "varchar(255) NULL"
),
'type' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['type'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 1,
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
'helpwizard' => true,
),
'options' => &$GLOBALS['LEAFLET_VECTORS'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_vector'],
'sql' => "varchar(32) NOT NULL default ''"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 12,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
\Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('clearCache'),
],
),
'addPopup' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['addPopup'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'popup' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popup'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\MarkerCallbacks', 'getPopups'),
'eval' => array(
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
),
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'popupContent' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popupContent'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'rte' => 'tinyMCE', 'helpwizard' => true, 'tl_class' => 'clr'),
'explanation' => 'insertTags',
'sql' => "mediumtext NULL"
),
'style' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['style'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => Netzmacht\Contao\Leaflet\Dca\VectorCallbacks::callback('getStyles'),
'eval' => array(
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
),
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'clickable' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['clickable'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'm12 w50'),
'sql' => "char(1) NOT NULL default ''"
),
'className' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['className'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'coordinates' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['coordinates'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateCoordinates')
),
'wizard' => array(
Netzmacht\Contao\Leaflet\Dca\LeafletCallbacks::callback('getGeocoder')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
'mandatory' => true,
),
'sql' => "varchar(255) NULL"
),
'radius' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['radius'],
'exclude' => true,
'inputType' => 'text',
'default' => 5,
'eval' => array('mandatory' => false, 'maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'clr w50'),
'sql' => "int(10) NOT NULL default '5'"
),
'data' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['data'],
'inputType' => 'textarea',
'search' => false,
'eval' => array('mandatory' => true, 'alwaysSave' => true),
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateMultipleCoordinates')
),
'sql' => "longblob NULL"
),
'multiData' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['multiData'],
'inputType' => 'multiColumnWizard',
'search' => false,
'eval' => array(
'mandatory' => true,
'alwaysSave' => true,
'flatArray' => true,
'columnFields' => array
(
'data' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['data'],
'inputType' => 'textarea',
'search' => false,
'eval' => array('alwaysSave' => true, 'style' => 'width:600px'),
)
)
),
'save_callback' => array(
\Netzmacht\Contao\Leaflet\Dca\Validator::callback('validateMultipleCoordinateSets')
),
'sql' => "longblob NULL"
),
'bounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['bounds'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(),
'eval' => array(
'maxlength' => 255,
'multiple'=>true,
'size'=>2,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
),
'sql' => "mediumblob NULL"
),
'ignoreForBounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['ignoreForBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'featureData' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['featureData'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array('tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json'
),
'sql' => "text NULL"
),
),
);

View File

@@ -1,79 +0,0 @@
<?php
/**
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @filesource
*
*/
$GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = array(
'type' => array('name', 'type', 'headline'),
'leaflet' => array('leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'),
'templates' => array(':hide', 'customTpl'),
'protected' => array(':hide', 'protected'),
'expert' => array(':hide', 'guests', 'cssID', 'space'),
'invisible' => array(':hide', 'invisible', 'start', 'start')
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_map'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_map'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => \Netzmacht\Contao\Leaflet\Dca\FrontendIntegration::callback('getMaps'),
'wizard' => array(
\Netzmacht\Contao\Leaflet\Dca\FrontendIntegration::callback('getEditMapLink'),
),
'eval' => array(
'tl_class' => 'w50 wizard',
'chosen' => true,
),
'sql' => "int(10) unsigned NOT NULL default '0'"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_mapId'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_mapId'],
'inputType' => 'text',
'exclude' => true,
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
'maxlength' => 16,
),
'sql' => "varchar(16) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_width'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_width'],
'inputType' => 'inputUnit',
'options' => array('px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'),
'search' => false,
'exclude' => true,
'eval' => array('rgxp' => 'digit', 'tl_class' => 'clr w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_height'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_height'],
'inputType' => 'inputUnit',
'options' => array('px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'),
'search' => false,
'exclude' => true,
'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_template'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_template'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => \Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::getTemplates('leaflet_map_js'),
'eval' => array(
'tl_class' => 'w50',
'chosen' => true,
),
'sql' => "varchar(64) NOT NULL default ''"
);

View File

@@ -1,7 +0,0 @@
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>

View File

@@ -4,10 +4,10 @@
"description": "Leaflet maps for Contao",
"main": "gulpfile.js",
"dependencies": {
"del": "^2.2.2",
"del": "^3.0.0",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-uglify": "^2.0.0"
"gulp-uglify": "^3.0.0"
},
"devDependencies": {},
"scripts": {

View File

@@ -1,13 +1,17 @@
<?php
/**
* @package netzmacht
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2016 netzmacht David Molineus. All rights reserved.
* @filesource
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Alias;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\AbstractFilter;
@@ -42,7 +46,7 @@ class DefaultAliasFilter extends AbstractFilter
/**
* {@inheritdoc}
*/
public function repeatUntilValid()
public function repeatUntilValid(): bool
{
return false;
}
@@ -50,7 +54,7 @@ class DefaultAliasFilter extends AbstractFilter
/**
* {@inheritdoc}
*/
public function apply($model, $value, $separator)
public function apply($model, $value, string $separator): string
{
if (!$value) {
return $this->prefix . $separator . $model->id;

View File

@@ -0,0 +1,66 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Alias;
use Doctrine\DBAL\Connection;
use Netzmacht\Contao\Toolkit\Data\Alias\AliasGenerator;
use Netzmacht\Contao\Toolkit\Data\Alias\Factory\AliasGeneratorFactory;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\ExistingAliasFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\SlugifyFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\SuffixFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\FilterBasedAliasGenerator;
use Netzmacht\Contao\Toolkit\Data\Alias\Validator\UniqueDatabaseValueValidator;
/**
* Class DefaultAliasGeneratorFactory.
*
* @package Netzmacht\Contao\Leaflet\Alias
*/
class DefaultAliasGeneratorFactory implements AliasGeneratorFactory
{
/**
* Database connection.
*
* @var Connection
*/
private $connection;
/**
* DefaultAliasGeneratorFactory constructor.
*
* @param Connection $connection Database connection.
*/
public function __construct(Connection $connection)
{
$this->connection = $connection;
}
/**
* {@inheritDoc}
*/
public function create(string $dataContainerName, string $aliasField, array $fields): AliasGenerator
{
$filters = [
new ExistingAliasFilter(),
new SlugifyFilter($fields),
new DefaultAliasFilter($dataContainerName),
new SuffixFilter(),
];
$validator = new UniqueDatabaseValueValidator($this->connection, $dataContainerName, $aliasField);
return new FilterBasedAliasGenerator($filters, $validator, $dataContainerName, $aliasField, '_');
}
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Alias;
use Doctrine\DBAL\Connection;
use Netzmacht\Contao\Toolkit\Data\Alias\AliasGenerator;
use Netzmacht\Contao\Toolkit\Data\Alias\Factory\AliasGeneratorFactory;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\ExistingAliasFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\SlugifyFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\Filter\SuffixFilter;
use Netzmacht\Contao\Toolkit\Data\Alias\FilterBasedAliasGenerator;
use Netzmacht\Contao\Toolkit\Data\Alias\Validator\UniqueDatabaseValueValidator;
/**
* Alias generator validating against the parent id (pid).
*
* @package Netzmacht\Contao\Leaflet\Alias
*/
class ParentAliasGeneratorFactory implements AliasGeneratorFactory
{
/**
* Database connection.
*
* @var Connection
*/
private $connection;
/**
* DefaultAliasGeneratorFactory constructor.
*
* @param Connection $connection Database connection.
*/
public function __construct(Connection $connection)
{
$this->connection = $connection;
}
/**
* {@inheritDoc}
*/
public function create(string $dataContainerName, string $aliasField, array $fields): AliasGenerator
{
$filters = [
new ExistingAliasFilter(),
new SlugifyFilter($fields),
new DefaultAliasFilter($dataContainerName),
new SuffixFilter(),
];
$validator = new UniqueDatabaseValueValidator($this->connection, $dataContainerName, $aliasField, ['pid']);
return new FilterBasedAliasGenerator($filters, $validator, $dataContainerName, $aliasField, '_');
}
}

View File

@@ -1,12 +1,13 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2016 netzmacht David Molineus
* @license LGPL 3.0
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*
*/
namespace Netzmacht\Contao\Leaflet\Backend;
@@ -81,8 +82,8 @@ class About
*/
private function extractFromComposer()
{
$extFile = TL_ROOT . '/composer/vendor/netzmacht/contao-leaflet-maps/composer.json';
$lockFile = TL_ROOT . '/composer/composer.lock';
$extFile = TL_ROOT . '/vendor/netzmacht/contao-leaflet-maps/composer.json';
$lockFile = TL_ROOT . '/composer.lock';
if (!file_exists($extFile) || !file_exists($lockFile)) {
return array();

View File

@@ -0,0 +1,38 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
/**
* Class AbstractLabelRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
abstract class AbstractLabelRenderer implements LayerLabelRenderer
{
/**
* {@inheritdoc}
*/
public function supports(array $row): bool
{
return $row['type'] === $this->getLayerType();
}
/**
* Get the supported layer type.
*
* @return string
*/
abstract protected function getLayerType(): string;
}

View File

@@ -0,0 +1,70 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Class ChainRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
final class ChainRenderer implements LayerLabelRenderer
{
/**
* List of layer label renderer.
*
* @var array|LayerLabelRenderer[]
*/
private $renderer;
/**
* ChainRenderer constructor.
*
* @param array|LayerLabelRenderer[] $renderer List of layer label renderer.
*/
public function __construct($renderer)
{
$this->renderer = $renderer;
}
/**
* {@inheritDoc}
*/
public function supports(array $row): bool
{
foreach ($this->renderer as $renderer) {
if ($renderer->supports($row)) {
return true;
}
}
return false;
}
/**
* {@inheritDoc}
*/
public function render(array $row, string $label, Translator $translator): string
{
foreach ($this->renderer as $renderer) {
if ($renderer->supports($row)) {
return $renderer->render($row, $label, $translator);
}
}
return $label;
}
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Interface LayerLabelRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
interface LayerLabelRenderer
{
/**
* Check if current row is supported.
*
* @param array $row Current row.
*
* @return bool
*/
public function supports(array $row): bool;
/**
* Render the backend label of an layer.
*
* @param array $row Current row.
* @param string $label Default label.
* @param Translator $translator The translator.
*
* @return string
*/
public function render(array $row, string $label, Translator $translator): string;
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Netzmacht\Contao\Leaflet\Model\MarkerModel;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Class MarkersLabelRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
final class MarkersLabelRenderer extends AbstractLabelRenderer
{
/**
* {@inheritdoc}
*/
protected function getLayerType(): string
{
return 'markers';
}
/**
* {@inheritdoc}
*/
public function render(array $row, string $label, Translator $translator): string
{
$count = MarkerModel::countBy('pid', $row['id']);
$label .= sprintf(
'<span class="tl_gray"> (%s %s)</span>',
$count,
$translator->trans('countEntries', [], 'contao_tl_leaflet_layer')
);
return $label;
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Contao\StringUtil;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Class OverpassLabelRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
final class OverpassLabelRenderer extends AbstractLabelRenderer
{
/**
* {@inheritdoc}
*/
protected function getLayerType(): string
{
return 'vectors';
}
/**
* {@inheritdoc}
*/
public function render(array $row, string $label, Translator $translator): string
{
if ($row['overpassQuery']) {
$label .= '<span class="tl_gray"> ' . StringUtil::substr($row['overpassQuery'], 50) . '</span>';
}
return $label;
}
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Backend label renderer for provider layer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
final class ProviderLabelRenderer extends AbstractLabelRenderer
{
/**
* {@inheritdoc}
*/
protected function getLayerType(): string
{
return 'provider';
}
/**
* {@inheritdoc}
*/
public function render(array $row, string $label, Translator $translator): string
{
$langKey = 'leaflet_provider.' . $row['tile_provider'] . '.0';
$translated = $translator->trans($langKey, [], 'contao_leaflet');
if ($translated !== $langKey) {
$provider = $translated;
} else {
$provider = $row['tile_provider'];
}
$label .= sprintf('<span class="tl_gray"> (%s)</span>', $provider);
return $label;
}
}

View File

@@ -0,0 +1,48 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Class ReferenceLabelRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
final class ReferenceLabelRenderer extends AbstractLabelRenderer
{
/**
* {@inheritdoc}
*/
protected function getLayerType(): string
{
return 'vectors';
}
/**
* {@inheritdoc}
*/
public function render(array $row, string $label, Translator $translator): string
{
$reference = LayerModel::findByPk($row['reference']);
if ($reference) {
$label .= '<span class="tl_gray"> (' . $reference->title . ')</span>';
}
return $label;
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer;
use Netzmacht\Contao\Leaflet\Model\VectorModel;
use Symfony\Component\Translation\TranslatorInterface as Translator;
/**
* Class VectorsLabelRenderer.
*
* @package Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer
*/
final class VectorsLabelRenderer extends AbstractLabelRenderer
{
/**
* {@inheritdoc}
*/
protected function getLayerType(): string
{
return 'vectors';
}
/**
* {@inheritdoc}
*/
public function render(array $row, string $label, Translator $translator): string
{
$count = VectorModel::countBy('pid', $row['id']);
$label .= sprintf(
'<span class="tl_gray"> (%s %s)</span>',
$count,
$translator->trans('countEntries', [], 'contao_tl_leaflet_layer')
);
return $label;
}
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle\ContaoManager;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use Netzmacht\Contao\Leaflet\Bundle\NetzmachtContaoLeafletBundle;
use Netzmacht\Contao\Toolkit\Bundle\NetzmachtContaoToolkitBundle;
/**
* Contao manager plugin.
*
* @package Netzmacht\Contao\Leaflet\ContaoManager
*/
class Plugin implements BundlePluginInterface
{
/**
* {@inheritdoc}
*/
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(NetzmachtContaoLeafletBundle::class)
->setLoadAfter([ContaoCoreBundle::class, NetzmachtContaoToolkitBundle::class])
->setReplace(['leaflet'])
];
}
}

View File

@@ -0,0 +1,53 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* Class NetzmachtContaoLeafletExtension.
*
* @package Netzmacht\Contao\Leaflet\DependencyInjection
*/
class NetzmachtContaoLeafletExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader(
$container,
new FileLocator(dirname(__DIR__) .'/Resources/config')
);
// Common config, services and listeners
$loader->load('config.yml');
$loader->load('services.yml');
$loader->load('listeners.yml');
// Amenities and providers config
$loader->load('amenities.yml');
$loader->load('providers.yml');
// Other services
$loader->load('mappers.yml');
$loader->load('encoders.yml');
$loader->load('layers.yml');
}
}

View File

@@ -0,0 +1,50 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle\DependencyInjection\Pass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
/**
* Register all definition mappers.
*
* @package Netzmacht\Contao\Leaflet\DependencyInjection\Pass
*/
class RegisterDefinitionMapperPass implements CompilerPassInterface
{
/**
* {@inheritDoc}
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('netzmacht.contao_leaflet.definition.mapper')) {
return;
}
$definition = $container->getDefinition('netzmacht.contao_leaflet.definition.mapper');
$taggedServices = $container->findTaggedServiceIds('netzmacht.contao_leaflet.mapper');
foreach ($taggedServices as $serviceId => $tags) {
foreach ($tags as $attributes) {
if (isset($attributes['priority'])) {
$definition->addMethodCall('register', [new Reference($serviceId), (int) $attributes['priority']]);
} else {
$definition->addMethodCall('register', [new Reference($serviceId)]);
}
}
}
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle\DependencyInjection\Pass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
/**
* Register all definition encoders.
*
* @package Netzmacht\Contao\Leaflet\DependencyInjection\Pass
*/
class RegisterEncodersPass implements CompilerPassInterface
{
/**
* {@inheritDoc}
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('netzmacht.contao_leaflet.definition.builder.event_dispatcher')) {
return;
}
$definition = $container->getDefinition('netzmacht.contao_leaflet.definition.builder.event_dispatcher');
$serviceIds = $container->findTaggedServiceIds('netzmacht.contao_leaflet.encoder');
foreach (array_keys($serviceIds) as $serviceId) {
$definition->addMethodCall('addSubscriber', [new Reference($serviceId)]);
}
}
}

View File

@@ -0,0 +1,56 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle\DependencyInjection\Pass;
use Netzmacht\LeafletPHP\Assets;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Class RegisterLibrariesPass.
*
* @package Netzmacht\Contao\Leaflet\DependencyInjection\Pass
*/
class RegisterLibrariesPass implements CompilerPassInterface
{
/**
* {@inheritDoc}
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('netzmacht.contao_leaflet.definition.builder')) {
return;
}
if (!$container->hasParameter('netzmacht.contao_leaflet.libraries')) {
return;
}
$definition = $container->getDefinition('netzmacht.contao_leaflet.definition.builder');
$libraries = $container->getParameter('netzmacht.contao_leaflet.libraries');
foreach ($libraries as $name => $assets) {
if (!empty($assets['css'])) {
list ($source, $type) = (array) $assets['css'];
$definition->addMethodCall('registerStylesheet', [$name, $source, $type ?: Assets::TYPE_FILE]);
}
if (!empty($assets['javascript'])) {
list ($source, $type) = (array) $assets['javascript'];
$definition->addMethodCall('registerJavascript', [$name, $source, $type ?: Assets::TYPE_FILE]);
}
}
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle;
use Netzmacht\Contao\Leaflet\Bundle\DependencyInjection\Pass\RegisterLibrariesPass;
use Netzmacht\Contao\Leaflet\Bundle\DependencyInjection\Pass\RegisterDefinitionMapperPass;
use Netzmacht\Contao\Leaflet\Bundle\DependencyInjection\Pass\RegisterEncodersPass;
use Netzmacht\Contao\Toolkit\Bundle\DependencyInjection\Compiler\AddTaggedServicesAsArgumentPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class NetzmachtContaoLeafletBundle.
*
* @package Netzmacht\Contao\Leaflet
*/
class NetzmachtContaoLeafletBundle extends Bundle
{
/**
* {@inheritDoc}
*/
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new RegisterDefinitionMapperPass());
$container->addCompilerPass(new RegisterEncodersPass());
$container->addCompilerPass(new RegisterLibrariesPass());
$container->addCompilerPass(
new AddTaggedServicesAsArgumentPass(
'netzmacht.contao_leaflet.layer_label_renderer',
'netzmacht.contao_leaflet.layer_label_renderer'
)
);
}
}

View File

@@ -0,0 +1,202 @@
parameters:
netzmacht.contao_leaflet.amenities:
- 'administration'
- 'advertising'
- 'alm'
- 'animal_boarding'
- 'animal_breeding'
- 'animal_shelter'
- 'architect_office'
- 'arts_centre'
- 'artwork'
- 'atm'
- 'audiologist'
- 'baby_hatch'
- 'bank'
- 'bar'
- 'bbq'
- 'bench'
- 'bicycle_parking'
- 'bicycle_rental'
- 'bicycle_repair_station'
- 'bicycle_trailer_sharing'
- 'biergarten'
- 'bikeshed'
- 'boat_rental'
- 'boat_sharing'
- 'boat_storage'
- 'brothel'
- 'bts'
- 'bureau_de_change'
- 'bus_station'
- 'cafe'
- 'canoe_hire'
- 'car_rental'
- 'car_repair'
- 'car_sharing'
- 'car_wash'
- 'casino'
- 'charging_station'
- 'childcare'
- 'cinema'
- 'citymap_post'
- 'clinic'
- 'clock'
- 'club'
- 'coast_guard'
- 'coast_radar_station'
- 'college'
- 'community_center'
- 'community_centre'
- 'compressed_air'
- 'concert_hall'
- 'conference_centre'
- 'courthouse'
- 'coworking_space'
- 'crematorium'
- 'crucifix'
- 'crypt'
- 'customs'
- 'dancing_school'
- 'dead_pub'
- 'dentist'
- 'disused'
- 'dive_centre'
- 'doctors'
- 'dog_bin'
- 'dog_waste_bin'
- 'dojo'
- 'drinking_water'
- '_driving_school'
- 'education'
- 'embassy'
- 'emergency_phone'
- 'emergency_service'
- 'events_venue'
- 'ev_charging'
- 'exhibition_centre'
- 'fast_food'
- 'ferry_terminal'
- 'festival_grounds'
- 'financial_advice'
- 'fire_hydrant'
- 'fire_station'
- 'first_aid'
- 'fish_spa'
- 'food_court'
- 'fountain'
- 'fuel'
- 'gambling'
- 'game_feeding'
- 'garages'
- 'grave_yard'
- 'grit_bin'
- 'harbourmaster'
- 'hospice'
- 'hospital'
- 'hotel'
- 'hunting_stand'
- 'ice_cream'
- 'internet_cafe'
- 'jobcentre'
- 'kindergarten'
- 'kiosk'
- 'kitchen'
- 'Kneippbecken'
- 'kneipp_water_cure'
- 'language_school'
- 'lavoir'
- 'library'
- 'lifeboat_station'
- 'life_ring'
- 'loading_dock'
- 'love_hotel'
- 'marae'
- 'marketplace'
- 'milk_dispenser'
- 'mobile_library'
- 'monastery'
- 'money_transfer'
- 'mortuary'
- 'motorcycle_parking'
- 'motorcycle_rental'
- 'music_school'
- 'music_venue'
- 'nameplate'
- 'nightclub'
- 'nursery'
- 'nursing_home'
- 'park'
- 'parking'
- 'parking_entrance'
- 'parking_space'
- 'pharmacy'
- 'photo_booth'
- 'place_of_worship'
- 'planetarium'
- 'police'
- 'post_box'
- 'post_office'
- 'preschool'
- 'printer'
- 'prison'
- 'prison_camp'
- 'proposed'
- 'pub'
- 'public_bath'
- 'public_bookcase'
- 'public_building'
- 'public_hall'
- 'ranger_station'
- 'recycling'
- 'refugee_housing'
- 'register_office'
- 'rescue_box'
- 'rescue_station'
- 'research_institute'
- 'restaurant'
- 'retirement_home'
- 'sanatorium'
- 'sanitary_dump_station'
- 'sauna'
- 'school'
- 'scout_hut'
- 'shelter'
- 'shop'
- 'shower'
- 'ski_school'
- 'smoking_area'
- 'social_centre'
- 'social_facility'
- 'spa'
- 'stables'
- 'stripclub'
- 'studio'
- 'swimming_pool'
- 'swingerclub'
- 'table'
- 'taxi'
- 'telephone'
- 'theatre'
- 'ticket_booth'
- 'ticket_validator'
- 'toilets'
- 'townhall'
- 'trolley_bay'
- 'university'
- 'vacuum_cleaner'
- 'vehicle_inspection'
- 'vending_machine'
- 'veterinary'
- 'vivarium'
- 'wash_center'
- 'waste_basket'
- 'waste_disposal'
- 'waste_transfer_station'
- 'water'
- 'watering_place'
- 'water_point'
- 'weighbridge'
- 'winery'
- 'yacht_club'
- 'youth_centre'

View File

@@ -0,0 +1,65 @@
parameters:
# leaflet controls.
#
# Supported leaflet control types. Register your type for the database driven definition here.
netzmacht.contao_leaflet.controls:
- 'zoom'
- 'layers'
- 'scale'
- 'attribution'
- 'loading'
- 'fullscreen'
# Leaflet icons.
#
# Supported leaflet icon types. Register you type for the database driven definition here.
netzmacht.contao_leaflet.icons:
- 'image'
- 'div'
- 'extra'
# The style concept is not part of the LeafletJS library. Styles are extracted from the Path options. Instead
# of defining the style for every vector again, manage them at one place.
#
# The goal is to provide different style strategies. For instance a random style chooser, one which uses a color
# range and so one.
netzmacht.contao_leaflet.styles:
- 'fixed'
# Leaflet vectors.
#
# Supported leaflet vector types. Register you type for the database driven definition here.
netzmacht.contao_leaflet.vectors:
- 'polyline'
- 'polygon'
- 'multiPolyline'
- 'multiPolygon'
- 'rectangle'
- 'circle'
- 'circleMarker'
# When creating a GeoJSON feature of a map object a feature.properties.model object is passed.
# Define the properties you always want to set.
#
# For more control you can subscribe the ConvertToGeoJsonEvent.
#
# The entry can be a string or an array. If an array is passed, the 2nd value is the type. Following types
# are supported.
# - array: Use deserialize before adding the value
# - file: Thread value a uuid and find the path.
# - files: Thread values as a list of file uuids and get an array of paths.
netzmacht.contao_leaflet.feature_model_properties:
tl_leaflet_marker:
- 'id'
- 'title'
- 'alias'
tl_leaflet_vector:
- 'id'
- 'title'
- 'alias'
# Filters can be passed to a data request to get only specific data from a layer.
netzmacht.contao_leaflet.filters:
bbox: Netzmacht\Contao\Leaflet\Filter\BboxFilter
distance: Netzmacht\Contao\Leaflet\Filter\DistanceFilter

View File

@@ -0,0 +1,47 @@
# Leaflet encoders.
#
# The encoders transforms the definitions into javascript. The encoders has to be an implementation of the
# EventSubscriberInterface of the event dispatcher.
services:
_defaults:
public: false
netzmacht.contao_leaflet.encoder.map:
class: Netzmacht\LeafletPHP\Encoder\MapEncoder
tags:
- { name: netzmacht.contao_leaflet.encoder }
netzmacht.contao_leaflet.encoder.control:
class: Netzmacht\LeafletPHP\Encoder\ControlEncoder
tags:
- { name: netzmacht.contao_leaflet.encoder }
netzmacht.contao_leaflet.encoder.group:
class: Netzmacht\LeafletPHP\Encoder\GroupEncoder
tags:
- { name: netzmacht.contao_leaflet.encoder }
netzmacht.contao_leaflet.encoder.raster:
class: Netzmacht\LeafletPHP\Encoder\RasterEncoder
tags:
- { name: netzmacht.contao_leaflet.encoder }
netzmacht.contao_leaflet.encoder.vector:
class: Netzmacht\LeafletPHP\Encoder\VectorEncoder
tags:
- { name: netzmacht.contao_leaflet.encoder }
netzmacht.contao_leaflet.encoder.ui:
class: Netzmacht\LeafletPHP\Encoder\UIEncoder
tags:
- { name: netzmacht.contao_leaflet.encoder }
netzmacht.contao_leaflet.encoder.type:
class: Netzmacht\LeafletPHP\Encoder\TypeEncoder
tags:
- { name: netzmacht.contao_leaflet.encoder }
netzmacht.contao_leaflet.encoder.subscriber:
class: Netzmacht\Contao\Leaflet\Subscriber\EncoderSubscriber
tags:
- { name: netzmacht.contao_leaflet.encoder }

View File

@@ -0,0 +1,80 @@
# Leaflet layer types.
#
# The type is used for the database driven definitions.
parameters:
netzmacht.contao_leaflet.layers:
provider:
children: false
icon: 'bundles/netzmachtcontaoleaflet/img/provider.png'
group:
children: true
icon: 'bundles/netzmachtcontaoleaflet/img/group.png'
markers:
children: false
icon: 'bundles/netzmachtcontaoleaflet/img/markers.png'
markers: true
boundsMode:
extend: true
fit: 'deferred'
vectors:
children: false
icon: 'bundles/netzmachtcontaoleaflet/img/vectors.png'
vectors: true
boundsMode:
extend: true
reference:
children: false
icon: 'bundles/netzmachtcontaoleaflet/img/reference.png'
markercluster:
children: true
icon: 'bundles/netzmachtcontaoleaflet/img/markercluster.png'
tile:
children: false
icon: 'bundles/netzmachtcontaoleaflet/img/tile.png'
overpass:
children: false
icon: 'bundles/netzmachtcontaoleaflet/img/overpass.png'
boundsMode:
extend: true
fit: true
services:
_defaults:
public: false
netzmacht.contao_leaflet.layer_label_renderer:
class: Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\ChainRenderer
arguments:
- []
netzmacht.contao_leaflet.layer_label_renderer.markers:
class: Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\MarkersLabelRenderer
tags:
- { name: 'netzmacht.contao_leaflet.layer_label_renderer' }
netzmacht.contao_leaflet.layer_label_renderer.overpass:
class: Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\OverpassLabelRenderer
tags:
- { name: 'netzmacht.contao_leaflet.layer_label_renderer' }
netzmacht.contao_leaflet.layer_label_renderer.provider:
class: Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\ProviderLabelRenderer
tags:
- { name: 'netzmacht.contao_leaflet.layer_label_renderer' }
netzmacht.contao_leaflet.layer_label_renderer.reference:
class: Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\ReferenceLabelRenderer
tags:
- { name: 'netzmacht.contao_leaflet.layer_label_renderer' }
netzmacht.contao_leaflet.layer_label_renderer.vectors:
class: Netzmacht\Contao\Leaflet\Backend\Renderer\Label\Layer\VectorsLabelRenderer
tags:
- { name: 'netzmacht.contao_leaflet.layer_label_renderer' }

View File

@@ -0,0 +1,90 @@
services:
netzmacht.contao_leaflet.listeners.dca.leaflet:
class: Netzmacht\Contao\Leaflet\Listener\Dca\LeafletDcaListener
arguments:
- '@filesystem'
- '%netzmacht.contao_leaflet.cache_dir%'
netzmacht.contao_leaflet.listeners.dca.validator:
class: Netzmacht\Contao\Leaflet\Listener\Dca\Validator
arguments:
- '@netzmacht.contao_toolkit.dca.manager'
- '@translator'
netzmacht.contao_leaflet.listeners.dca.frontend_integration:
class: Netzmacht\Contao\Leaflet\Listener\Dca\FrontendIntegrationListener
arguments:
- '@translator'
netzmacht.contao_leaflet.listeners.dca.map:
class: Netzmacht\Contao\Leaflet\Listener\Dca\MapDcaListener
arguments:
- '@netzmacht.contao_toolkit.dca.manager'
- '@database_connection'
netzmacht.contao_leaflet.listeners.dca.control:
class: Netzmacht\Contao\Leaflet\Listener\Dca\ControlDcaListener
arguments:
- '@netzmacht.contao_toolkit.dca.manager'
- '@database_connection'
- '%netzmacht.contao_leaflet.controls%'
netzmacht.contao_leaflet.listeners.dca.layer:
class: Netzmacht\Contao\Leaflet\Listener\Dca\LayerDcaListener
arguments:
- '@netzmacht.contao_toolkit.dca.manager'
- '@database_connection'
- '@translator'
- '@netzmacht.contao_leaflet.layer_label_renderer'
- '%netzmacht.contao_leaflet.layers%'
- '%netzmacht.contao_leaflet.providers%'
- '%netzmacht.contao_leaflet.amenities%'
netzmacht.contao_leaflet.listeners.dca.marker:
class: Netzmacht\Contao\Leaflet\Listener\Dca\MarkerDcaListener
arguments:
- '@database_connection'
netzmacht.contao_leaflet.listeners.dca.vector:
class: Netzmacht\Contao\Leaflet\Listener\Dca\VectorDcaListener
arguments:
- '@netzmacht.contao_toolkit.dca.manager'
- '%netzmacht.contao_leaflet.vectors%'
netzmacht.contao_leaflet.listeners.dca.icon:
class: Netzmacht\Contao\Leaflet\Listener\Dca\IconDcaListener
arguments:
- '%netzmacht.contao_leaflet.icons%'
netzmacht.contao_leaflet.listeners.dca.style:
class: Netzmacht\Contao\Leaflet\Listener\Dca\IconDcaListener
arguments:
- '%netzmacht.contao_leaflet.styles%'
netzmacht.contao_leaflet.listeners.geo_json_subscriber:
class: Netzmacht\Contao\Leaflet\Subscriber\GeoJsonSubscriber
arguments:
- '%netzmacht.contao_leaflet.feature_model_properties%'
tags:
- { name: 'kernel.event_subscriber' }
netzmacht.contao_leaflet.listeners.hash_subscriber:
class: Netzmacht\Contao\Leaflet\Subscriber\HashSubscriber
tags:
- { name: 'kernel.event_subscriber' }
netzmacht.contao_leaflet.listeners.load_assets:
class: Netzmacht\Contao\Leaflet\Listener\LoadAssetsListener
arguments:
- '@netzmacht.contao_leaflet.map.assets'
- '@netzmacht.contao_leaflet.definition.mapper'
- '@netzmacht.contao_leaflet.libraries'
tags:
- { name: 'kernel.event_listener', event: 'netzmacht.contao_leaflet.get_javascript', method: 'onGetJavascriptEvent' }
netzmacht.contao_leaflet.listeners.register_libraries:
class: Netzmacht\Contao\Leaflet\Listener\RegisterLibrariesListener
arguments:
- '@netzmacht.contao_leaflet.libraries'
- '@netzmacht.contao_leaflet.definition.builder'

View File

@@ -0,0 +1,177 @@
# Leaflet mappers.
#
# Mappers translate between the database models and the leaflet definition.
services:
_defaults:
public: false
# Map mapper
netzmacht.contao_leaflet.mapper.map:
class: Netzmacht\Contao\Leaflet\Mapper\MapMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
# Layer mappers
netzmacht.contao_leaflet.mapper.tile_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\TileLayerMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.provider_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\ProviderLayerMapper
arguments:
- '%netzmacht.contao_leaflet.providers%'
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.markers_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\MarkersLayerMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.group_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\GroupLayerMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.vectors_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\VectorsLayerMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.reference_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\ReferenceLayerMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.overpass_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\OverpassLayerMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.marker_cluster_layer:
class: Netzmacht\Contao\Leaflet\Mapper\Layer\MarkerClusterLayerMapper
arguments:
- '@netzmacht.contao_leaflet.map.assets'
tags:
- { name: netzmacht.contao_leflet_maps.mapper }
# Control mappers
netzmacht.contao_leaflet.mapper.zoom_control:
class: Netzmacht\Contao\Leaflet\Mapper\Control\ZoomControlMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.scale_control:
class: Netzmacht\Contao\Leaflet\Mapper\Control\ScaleControlMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.layers_control:
class: Netzmacht\Contao\Leaflet\Mapper\Control\LayersControlMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.attribution_control:
class: Netzmacht\Contao\Leaflet\Mapper\Control\AttributionControlMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.loading_control:
class: Netzmacht\Contao\Leaflet\Mapper\Control\LoadingControlMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.fullscreen_control:
class: Netzmacht\Contao\Leaflet\Mapper\Control\FullscreenControlMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
# Vector mappers
netzmacht.contao_leaflet.mapper.polyline:
class: Netzmacht\Contao\Leaflet\Mapper\Vector\PolylineMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.multi_polyline:
class: Netzmacht\Contao\Leaflet\Mapper\Vector\MultiPolylineMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.polygon:
class: Netzmacht\Contao\Leaflet\Mapper\Vector\PolygonMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.multi_polygon:
class: Netzmacht\Contao\Leaflet\Mapper\Vector\MultiPolygonMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.circle:
class: Netzmacht\Contao\Leaflet\Mapper\Vector\CircleMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.circle_mapper:
class: Netzmacht\Contao\Leaflet\Mapper\Vector\CircleMarkerMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.rectangle_mapper:
class: Netzmacht\Contao\Leaflet\Mapper\Vector\RectangleMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }
# Miscellaneous mappers
netzmacht.contao_leaflet.mapper.popup:
class: Netzmacht\Contao\Leaflet\Mapper\UI\PopupMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.image_icon:
class: Netzmacht\Contao\Leaflet\Mapper\Type\ImageIconMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.div_icon:
class: Netzmacht\Contao\Leaflet\Mapper\Type\DivIconMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.extra_markers:
class: Netzmacht\Contao\Leaflet\Mapper\Type\ExtraMarkersIconMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.fixed_style:
class: Netzmacht\Contao\Leaflet\Mapper\Style\FixedStyleMapper
tags:
- { name: netzmacht.contao_leaflet.mapper }
netzmacht.contao_leaflet.mapper.marker:
class: Netzmacht\Contao\Leaflet\Mapper\UI\MarkerMapper
arguments:
- '@netzmacht.contao_leaflet.frontend.value_filter'
tags:
- { name: netzmacht.contao_leaflet.mapper }

View File

@@ -0,0 +1,157 @@
parameters:
netzmacht.contao_leaflet.providers:
OpenStreetMap:
variants: ['Mapnik', 'BlackAndWhite', 'DE', 'France', 'HOT', 'BZH']
OpenSeaMap: []
OpenTopoMap: []
Thunderforest:
variants:
- 'OpenCycleMap'
- 'Transport'
- 'TransportDark'
- 'SpinalMap'
- 'Landscape'
- 'Outdoors'
- 'Pioneer'
OpenMapSurfer:
variants: ['Roads', 'AdminBounds', 'Grayscale']
Hydda:
variants: ['Full', 'Base', 'RoadsAndLabels']
MapBox:
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\MapBoxProvider'
options:
key: 'tile_provider_key'
Stamen:
variants:
- 'Toner'
- 'TonerBackground'
- 'TonerHybrid'
- 'TonerLines'
- 'TonerLabels'
- 'TonerLite'
- 'Terrain'
- 'TerrainBackground'
- 'TopOSMRelief'
- 'TopOSMFeatures'
- 'Watercolor'
Esri:
variants:
- 'WorldStreetMap'
- 'DeLorme'
- 'WorldTopoMap'
- 'WorldImagery'
- 'WorldTerrain'
- 'WorldShadedRelief'
- 'WorldPhysical'
- 'OceanBasemap'
- 'NatGeoWorldMap'
- 'WorldGrayCanvas'
OpenWeatherMap:
variants:
- 'Clouds'
- 'CloudsClassic'
- 'Precipitation'
- 'PrecipitationClassic'
- 'Rain'
- 'RainClassic'
- 'Pressure'
- 'PressureContour'
- 'Wind'
- 'Temperature'
- 'Snow'
HERE:
class: 'Netzmacht\LeafletPHP\Plugins\LeafletProviders\HereProvider'
variants:
- 'normalDay'
- 'normalDayCustom'
- 'normalDayGrey'
- 'normalDayMobile'
- 'normalDayGreyMobile'
- 'normalDayTransit'
- 'normalDayTransitMobile'
- 'normalNight'
- 'normalNightMobile'
- 'normalNightGrey'
- 'normalNightGreyMobile'
- 'basicMap'
- 'mapLabels'
- 'trafficFlow'
- 'carnavDayGrey'
- 'hybridDay'
- 'hybridDayMobile'
- 'pedestrianDay'
- 'pedestrianNight'
- 'satelliteDay'
- 'terrainDay'
- 'terrainDayMobile'
options:
appId: 'tile_provider_key'
appCode: 'tile_provider_code'
fields: ['tile_provider_key', 'tile_provider_code']
JusticeMap:
variants:
- 'income'
- 'americanIndian'
- 'asian'
- 'black'
- 'hispanic'
- 'multi'
- 'nonWhite'
- 'white'
- 'plurality'
FreeMapSK: []
MtbMap: []
CartoDB:
variants:
- 'Positron'
- 'PositronNoLabels'
- 'PositronOnlyLabels'
- 'DarkMatter'
- 'DarkMatterNoLabels'
- 'DarkMatterOnlyLabels'
HikeBike:
variants:
- 'HikeBike'
- 'HillShading'
BasemapAT:
variants:
- 'basemap'
- 'grau'
- 'overlay'
- 'highdpi'
- 'orthofoto'
nlmaps:
variants:
- 'standaard'
- 'pastel'
- 'grijs'
- 'luchtfoto'
NASAGIBS:
variants:
- 'ModisTerraTrueColorCR'
- 'ModisTerraBands367CR'
- 'ViirsEarthAtNight2012'
- 'ModisTerraLSTDay'
- 'ModisTerraSnowCover'
- 'ModisTerraAOD'
- 'ModisTerraChlorophyll'
NLS: []

View File

@@ -0,0 +1,114 @@
parameters:
netzmacht.contao_leaflet.cache_dir: '%kernel.cache_dir%/leaflet'
# JSON_UNESCAPED_SLASHES ^ Netzmacht\JavascriptBuilder\Flags::BUILD_STACK
netzmacht.contao_leaflet.encoding_flags: 16448
services:
netzmacht.contao_leaflet.map.provider:
class: Netzmacht\Contao\Leaflet\MapProvider
arguments:
- '@netzmacht.contao_leaflet.definition.mapper'
- '@netzmacht.contao_leaflet.definition.builder'
- '@event_dispatcher'
- '@netzmacht.contao_toolkit.contao.input_adapter'
- '@netzmacht.contao_leaflet.map.assets'
- '@netzmacht.contao_leaflet.cache'
- '@netzmacht.contao_leaflet.frontend.data_controller'
netzmacht.contao_leaflet.libraries:
class: Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration
arguments:
- '@contao.framework'
netzmacht.contao_leaflet.filter_factory:
class: Netzmacht\Contao\Leaflet\Filter\FilterFactory
arguments:
- '%netzmacht.contao_leaflet.filters%'
netzmacht.contao_leaflet.cache:
alias: 'netzmacht.contao_leaflet.cache.default'
netzmacht.contao_leaflet.cache.default:
class: Doctrine\Common\Cache\FilesystemCache
arguments:
- '%netzmacht.contao_leaflet.cache_dir%'
netzmacht.contao_leaflet.cache.debug:
class: Doctrine\Common\Cache\ArrayCache
netzmacht.contao_leaflet.frontend.value_filter:
class: Netzmacht\Contao\Leaflet\Frontend\ValueFilter
arguments:
- '@contao.framework'
netzmacht.contao_leaflet.map.assets:
class: Netzmacht\Contao\Leaflet\Encoder\ContaoAssets
arguments:
- '@netzmacht.contao_toolkit.assets_manager'
netzmacht.contao_leaflet.definition.builder:
class: Netzmacht\LeafletPHP\Leaflet
arguments:
- '@netzmacht.contao_leaflet.definition.builder.javascript_builder'
- '@netzmacht.contao_leaflet.definition.builder.event_dispatcher'
- []
- '%netzmacht.contao_leaflet.encoding_flags%'
netzmacht.contao_leaflet.definition.builder.javascript_builder:
class: Netzmacht\JavascriptBuilder\Builder
arguments:
- '@netzmacht.contao_leaflet.definition.encoder_factory'
netzmacht.contao_leaflet.definition.builder.event_dispatcher:
class: Symfony\Component\EventDispatcher\EventDispatcher
netzmacht.contao_leaflet.definition.mapper:
class: Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper
arguments:
- '@event_dispatcher'
netzmacht.contao_leaflet.definition.encoder_factory:
class: Netzmacht\Contao\Leaflet\Encoder\EncoderFactory
arguments:
- '@netzmacht.contao_leaflet.definition.builder.event_dispatcher'
netzmacht.contao_leaflet.definition.alias_generator.factory_default:
class: Netzmacht\Contao\Leaflet\Alias\DefaultAliasGeneratorFactory
arguments:
- '@database_connection'
netzmacht.contao_leaflet.definition.alias_generator.factory_parent:
class: Netzmacht\Contao\Leaflet\Alias\ParentAliasGeneratorFactory
arguments:
- '@database_connection'
netzmacht.contao_leaflet.frontend.element_factory:
class: Netzmacht\Contao\Leaflet\Frontend\ContentElement\MapElementFactory
arguments:
- '@service_container'
tags:
- { name: 'netzmacht.contao_toolkit.component.content_element_factory' }
- { name: 'netzmacht.contao_toolkit.component.content_element', alias: 'leaflet', category: 'includes' }
netzmacht.contao_leaflet.frontend.module_factory:
class: Netzmacht\Contao\Leaflet\Frontend\Module\MapModuleFactory
arguments:
- '@service_container'
tags:
- { name: 'netzmacht.contao_toolkit.component.frontend_module_factory' }
- { name: 'netzmacht.contao_toolkit.component.frontend_module', alias: 'leaflet', category: 'includes' }
netzmacht.contao_leaflet.frontend.insert_tag:
class: Netzmacht\Contao\Leaflet\Frontend\InsertTag\LeafletInsertTagParser
arguments:
- '@netzmacht.contao_leaflet.map.provider'
- '%kernel.debug%'
tags:
- { name: 'contao.hook', hook: 'replaceInsertTags', method: 'replace' }
netzmacht.contao_leaflet.frontend.data_controller:
class: Netzmacht\Contao\Leaflet\Frontend\DataController
arguments:
- '@netzmacht.contao_leaflet.filter_factory'
- '%kernel.debug%'

View File

@@ -0,0 +1,78 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
/*
* Backend module.
*/
array_insert(
$GLOBALS['BE_MOD'],
1,
array(
'leaflet' => array
(
'leaflet_map' => array
(
'tables' => array
(
'tl_leaflet_map',
'tl_leaflet_control',
),
'icon' => 'bundles/netzmachtcontaoleaflet/img/map.png',
'stylesheet' => 'bundles/netzmachtcontaoleaflet/css/backend.css',
),
'leaflet_layer' => array
(
'tables' => array
(
'tl_leaflet_layer',
'tl_leaflet_marker',
'tl_leaflet_vector',
'tl_leaflet_icon',
'tl_leaflet_style',
'tl_leaflet_popup',
),
'icon' => 'bundles/netzmachtcontaoleaflet/img/layers.png',
'stylesheet' => 'bundles/netzmachtcontaoleaflet/css/backend.css',
'javascript' => 'bundles/netzmachtcontaoleaflet/js/backend.js'
),
'leaflet_about' => array
(
'callback' => Netzmacht\Contao\Leaflet\Backend\About::class,
'icon' => 'bundles/netzmachtcontaoleaflet/img/about.png',
'stylesheet' => 'bundles/netzmachtcontaoleaflet/css/about.css',
)
)
)
);
/*
* Models.
*/
$GLOBALS['TL_MODELS']['tl_leaflet_control'] = \Netzmacht\Contao\Leaflet\Model\ControlModel::class;
$GLOBALS['TL_MODELS']['tl_leaflet_icon'] = \Netzmacht\Contao\Leaflet\Model\IconModel::class;
$GLOBALS['TL_MODELS']['tl_leaflet_layer'] = \Netzmacht\Contao\Leaflet\Model\LayerModel::class;
$GLOBALS['TL_MODELS']['tl_leaflet_map'] = \Netzmacht\Contao\Leaflet\Model\MapModel::class;
$GLOBALS['TL_MODELS']['tl_leaflet_marker'] = \Netzmacht\Contao\Leaflet\Model\MarkerModel::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_vector'] = \Netzmacht\Contao\Leaflet\Model\VectorModel::class;
/*
* Hooks.
*/
$GLOBALS['TL_HOOKS']['initializeSystem'][] = [
'netzmacht.contao_leaflet.listeners.register_libraries',
'onInitializeSystem'
];

View File

@@ -0,0 +1,85 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [
'type' => ['type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'],
'templates' => [':hide', 'customTpl', 'leaflet_template'],
'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'],
];
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_map'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_map'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.frontend_integration', 'getMaps'],
'wizard' => [
['netzmacht.contao_leaflet.listeners.dca.frontend_integration', 'getEditMapLink'],
],
'eval' => [
'tl_class' => 'w50 wizard',
'chosen' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
];
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_mapId'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_mapId'],
'inputType' => 'text',
'exclude' => true,
'eval' => [
'tl_class' => 'w50',
'chosen' => true,
'maxlength' => 16,
],
'sql' => "varchar(16) NOT NULL default ''",
];
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_width'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_width'],
'inputType' => 'inputUnit',
'options' => ['px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'],
'search' => false,
'exclude' => true,
'eval' => ['rgxp' => 'digit', 'tl_class' => 'clr w50'],
'sql' => "varchar(64) NOT NULL default ''",
];
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_height'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_height'],
'inputType' => 'inputUnit',
'options' => ['px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'],
'search' => false,
'exclude' => true,
'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
];
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_template'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_template'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => ['netzmacht.contao_toolkit.dca.listeners.template_options', 'handleOptionsCallback'],
'eval' => [
'tl_class' => 'w50',
'chosen' => true,
],
'toolkit' => [
'template_options' => [
'prefix' => 'leaflet_map_js',
],
],
'sql' => "varchar(64) NOT NULL default ''",
];

View File

@@ -0,0 +1,409 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_control'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'ptable' => 'tl_leaflet_map',
'sql' => [
'keys' => [
'id' => 'primary',
'pid' => 'index',
],
],
'onload_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
// List configuration
'list' => [
'sorting' => [
'mode' => 4,
'fields' => ['sorting'],
'headerFields' => ['title'],
'flag' => 1,
'sorting' => 2,
'panelLayout' => 'filter,sort;search,limit',
'child_record_callback' => ['netzmacht.contao_leaflet.listeners.dca.control', 'generateRow'],
],
'label' => [
'fields' => ['title'],
'format' => '%s',
],
'global_operations' => [
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['edit'],
'href' => 'act=edit',
'icon' => 'header.gif',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback',
],
'toolkit' => [
'state_button' => [
'stateColumn' => 'active',
],
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'palettes' => [
'__selector__' => ['type'],
],
'metapalettes' => [
'default' => [
'name' => ['title', 'alias', 'type', 'position'],
'config' => [],
'active' => ['active'],
],
'zoom extends default' => [
'config' => ['zoomInText', 'zoomOutText', 'zoomInTitle', 'zoomOutTitle'],
],
'layers extends default' => [
'config' => ['layers', 'collapsed', 'autoZIndex'],
],
'scale extends default' => [
'config' => ['maxWidth', 'metric', 'imperial', 'updateWhenIdle'],
],
'attribution extends default' => [
'config' => ['attributions', 'prefix', 'disableDefault'],
],
'loading extends default' => [
'config' => ['separate', 'zoomControl', 'spinjs'],
],
'fullscreen extends default' => [
'config' => ['buttonTitle', 'separate', 'simulateFullScreen'],
],
],
'metasubpalettes' => [
'spinjs' => ['spin'],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'pid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'sorting' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
'sorting' => true,
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['title'],
'exclude' => true,
'inputType' => 'text',
'sorting' => true,
'search' => true,
'flag' => 1,
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_parent',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'type' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['type'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
'helpwizard' => true,
],
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.control', 'getControlTypes'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_control'],
'sql' => "varchar(32) NOT NULL default ''",
],
'position' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['position'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'options' => ['topleft', 'topright', 'bottomleft', 'bottomright'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'],
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50', 'helpwizard' => true],
'sql' => "varchar(255) NOT NULL default ''",
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'zoomInText' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'zoomOutText' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'zoomInTitle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInTitle'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'zoomOutTitle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutTitle'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'collapsed' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['collapsed'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'autoZIndex' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['autoZIndex'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'layers' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layers'],
'exclude' => true,
'inputType' => 'multiColumnWizard',
'load_callback' => [
['netzmacht.contao_leaflet.listeners.dca.control', 'loadLayerRelations'],
],
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.control', 'saveLayerRelations'],
],
'eval' => [
'tl_class' => 'leaflet-mcw leaflet-mcw-control-layers',
'columnFields' => [
'layer' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.control', 'getLayers'],
'eval' => [
'style' => 'width: 300px',
'chosen' => true,
'includeBlankOption' => true,
],
],
'mode' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'],
'exclude' => true,
'inputType' => 'select',
'options' => ['base', 'overlay'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'],
'eval' => [
'style' => 'width: 200px',
'helpwizard' => true,
],
],
],
],
'sql' => 'mediumblob NULL',
],
'maxWidth' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['maxWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => 100,
'eval' => ['tl_class' => 'w50', 'rgxp' => 'digit'],
'sql' => "int(5) NOT NULL default '100'",
],
'metric' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['metric'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => ['tl_class' => 'w50 clr'],
'sql' => "char(1) NOT NULL default '1'",
],
'imperial' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['imperial'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => '1',
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default '1'",
],
'updateWhenIdle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['updateWhenIdle'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'prefix' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['prefix'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'attributions' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['attributions'],
'exclude' => true,
'inputType' => 'listWizard',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'clr', 'allowHtml' => true],
'sql' => 'mediumblob NULL',
],
'separate' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['separate'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
'zoomControl' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomControl'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.control', 'getZoomControls'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'],
'eval' => [
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
],
'sql' => "varchar(255) NOT NULL default ''",
],
'spinjs' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['spinjs'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'spin' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['spin'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'style' => 'height:60px',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|json',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'simulateFullScreen' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['simulateFullScreen'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
'buttonTitle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['buttonTitle'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'disableDefault' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['disableDefault'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
],
];

View File

@@ -0,0 +1,44 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_control_layer'] = [
'config' => [
'dataContainer' => 'Table',
'sql' => [
'keys' => [
'id' => 'primary',
'cid,lid' => 'unique',
],
],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'sorting' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'cid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'lid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'mode' => [
'sql' => "varchar(16) NOT NULL default ''",
],
],
];

View File

@@ -0,0 +1,418 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => [
'keys' => [
'id' => 'primary',
'alias' => 'unique',
],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
'sorting' => [
'mode' => 1,
'fields' => ['title'],
'flag' => 1,
'panelLayout' => 'limit',
'headerFields' => ['title', 'type'],
],
'label' => [
'fields' => ['title', 'type'],
'format' => '%s <span class="tl_gray">[%s]</span>',
],
'global_operations' => [
'layers' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['layersBtn'],
'href' => 'table=tl_leaflet_layer',
'icon' => 'bundles/netzmachtcontaoleaflet/img/layers.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
'styles' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'popups' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback',
],
'toolkit' => [
'state_button' => [
'stateColumn' => 'active',
],
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'palettes' => [
'__selector__' => ['type'],
],
'metapalettes' => [
'default' => [
'title' => ['title', 'alias', 'type'],
],
'image extends default' => [
'config' => [
'iconImage',
'iconRetinaImage',
'iconAnchor',
'popupAnchor',
'className',
],
'shadow' => [
'shadowImage',
'shadowRetinaImage',
'shadowAnchor',
],
'active' => [
'active',
],
],
'div extends default' => [
'config' => [
'html',
'iconSize',
'iconAnchor',
'popupAnchor',
'className',
],
'active' => [
'active',
],
],
'extra extends default' => [
'config' => [
'icon',
'prefix',
'shape',
'markerColor',
'number',
'iconColor',
],
'active' => [
'active',
],
],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['title'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['alias'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'type' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['type'],
'exclude' => true,
'inputType' => 'select',
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
],
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.icon', 'getIconOptions'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_icon'],
'sql' => "varchar(32) NOT NULL default ''",
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'iconImage' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => [
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => true,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg',
],
'sql' => 'binary(16) NULL',
],
'iconRetinaImage' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconRetinaImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => [
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => false,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg',
],
'sql' => 'binary(16) NULL',
],
'shadowImage' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shadowImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => [
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => false,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg',
],
'sql' => 'binary(16) NULL',
],
'shadowRetinaImage' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shadowRetinaImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => [
'filesOnly' => true,
'fieldType' => 'radio',
'mandatory' => false,
'tl_class' => 'clr',
'extensions' => 'gif,png,svg,jpg',
],
'sql' => 'binary(16) NULL',
],
'iconAnchor' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconAnchor'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
],
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(255) NULL',
],
'shadowAnchor' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shadowAnchor'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
],
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(255) NULL',
],
'popupAnchor' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['popupAnchor'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
],
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(255) NULL',
],
'className' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['className'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
],
'iconSize' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconSize'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
'maxlength' => 64,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(64) NULL',
],
'html' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['html'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'style' => 'height:60px',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|html',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'icon' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['icon'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
'maxlength' => 64,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(64) NULL',
],
'prefix' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['prefix'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
'maxlength' => 64,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(64) NULL',
],
'shape' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['shape'],
'exclude' => true,
'inputType' => 'select',
'default' => 'circle',
'options' => ['circle', 'square', 'star', 'penta'],
'eval' => [
'tl_class' => 'w50',
],
'sql' => 'varchar(64) NULL',
],
'iconColor' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['iconColor'],
'exclude' => true,
'inputType' => 'text',
'wizard' => [
['netzmacht.contao_toolkit.dca.listeners.color_picker', 'handleWizardCallback'],
],
'eval' => [
'maxlength' => 64,
'tl_class' => 'w50 wizard',
'nullIfEmpty' => true,
],
'sql' => 'varchar(16) NULL',
],
'markerColor' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_icon']['markerColor'],
'exclude' => true,
'inputType' => 'select',
'default' => 'circle',
'options' => [
'blue',
'red',
'orange-dark',
'orange',
'yellow',
'blue-dark',
'cyan',
'purple',
'violet',
'pink',
'green-dark',
'green',
'green-light',
'black',
'white',
],
'eval' => [
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(16) NULL',
],
],
];

View File

@@ -0,0 +1,857 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'ctable' => ['tl_leaflet_vector', 'tl_leaflet_marker'],
'ondelete_callback' => [
['netzmacht.contao_leaflet.listeners.dca.layer', 'deleteRelations'],
],
'sql' => [
'keys' => [
'id' => 'primary',
'pid' => 'index',
'alias' => 'unique',
],
],
'onload_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
'sorting' => [
'mode' => 5,
'fields' => ['title'],
'flag' => 1,
'icon' => 'bundles/netzmachtcontaoleaflet/img/layers.png',
'panelLayout' => 'filter;search,limit',
'paste_button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getPasteButtons'],
],
'label' => [
'fields' => ['title'],
'format' => '%s',
'label_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateRow'],
],
'global_operations' => [
'styles' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'icons' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'],
'href' => 'table=tl_leaflet_icon',
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'popups' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
],
'operations' => [
'markers' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['markers'],
'href' => 'table=tl_leaflet_marker',
'icon' => 'edit.gif',
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateMarkersButton'],
],
'vectors' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['vectors'],
'href' => 'table=tl_leaflet_vector',
'icon' => 'edit.gif',
'button_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'generateVectorsButton'],
],
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['edit'],
'href' => 'act=edit',
'icon' => 'header.gif',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'cut' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cut'],
'href' => 'act=paste&amp;mode=cut',
'icon' => 'cut.gif',
'attributes' => 'onclick="Backend.getScrollOffset()"',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();
return ContaoLeafletAjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback',
],
'toolkit' => [
'state_button' => [
'stateColumn' => 'active',
],
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'palettes' => [
'__selector__' => ['type'],
],
'metapalettes' => [
'default' => [
'title' => ['title', 'alias', 'type'],
'config' => [],
'style' => [],
'expert' => [':hide'],
'active' => ['active'],
],
'markers extends default' => [
'+expert' => ['pointToLayer'],
'+config' => ['boundsMode', 'deferred'],
],
'group extends default' => [
'+title' => ['groupType'],
'+active' => ['boundsMode'],
],
'vectors extends default' => [
'+expert' => ['onEachFeature', 'pointToLayer'],
'+config' => ['boundsMode', 'deferred'],
],
'reference extends default' => [
'+title' => ['reference', 'standalone'],
],
'markercluster extends default' => [
'config' => [
'showCoverageOnHover',
'zoomToBoundsOnClick',
'removeOutsideVisibleBounds',
'animateAddingMarkers',
'spiderfyOnMaxZoom',
'disableClusteringAtZoom',
'maxClusterRadius',
'singleMarkerMode',
],
'+expert' => [
'polygonOptions',
'iconCreateFunction',
'disableDefaultStyle',
],
],
'tile extends default' => [
'config' => [
'tileUrl',
'subdomains',
'attribution',
'minZoom',
'maxZoom',
],
'+expert' => [
'errorTileUrl',
'tileSize',
'tms',
'continuousWorld',
'noWrap',
'zoomReverse',
'zoomOffset',
'maxNativeZoom',
'opacity',
'zIndex',
'unloadvisibleTiles',
'updateWhenIdle',
'detectRetina',
'reuseTiles',
'bounds',
],
],
'overpass extends default' => [
'config' => [
'overpassQuery',
'boundsMode',
'minZoom',
'overpassEndpoint',
'overpassPopup',
],
'style' => [
'amenityIcons',
],
'+expert' => [
'onEachFeature',
'pointToLayer',
],
],
],
'metasubselectpalettes' => [
'type' => [
'provider' => ['tile_provider', 'tile_provider_variant'],
],
'tile_provider' => [
'MapBox' => ['tile_provider_key'],
'HERE' => ['tile_provider_key', 'tile_provider_code'],
],
],
'metasubpalettes' => [
'spiderfyOnMaxZoom' => ['spiderfyDistanceMultiplier'],
'deferred' => ['cache'],
'cache' => ['cacheLifeTime'],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'pid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'sorting' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['title'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'type' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['type'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
'helpwizard' => true,
],
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getLayerOptions'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_layer'],
'sql' => "varchar(32) NOT NULL default ''",
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'tile_provider' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider'],
'exclude' => true,
'inputType' => 'select',
'eval' => [
'mandatory' => true,
'tl_class' => 'w50 clr',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
],
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getProviderOptions'],
'sql' => "varchar(32) NOT NULL default ''",
],
'tile_provider_variant' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_variant'],
'exclude' => true,
'inputType' => 'select',
'eval' => [
'mandatory' => false,
'tl_class' => 'w50',
'submitOnChange' => true,
'chosen' => false,
],
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getVariants'],
'sql' => "varchar(32) NOT NULL default ''",
],
'tile_provider_key' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_key'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'tile_provider_code' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tile_provider_code'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'deferred' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['deferred'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'groupType' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupType'],
'exclude' => true,
'inputType' => 'select',
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'submitOnChange' => true,
'helpwizard' => true,
],
'default' => 'layer',
'options' => ['layer', 'feature'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes'],
'sql' => "varchar(32) NOT NULL default ''",
],
'reference' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getLayers'],
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'standalone' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['standalone'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default ''",
],
'onEachFeature' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['onEachFeature'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'pointToLayer' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['pointToLayer'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'showCoverageOnHover' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['showCoverageOnHover'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'zoomToBoundsOnClick' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zoomToBoundsOnClick'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'spiderfyOnMaxZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['spiderfyOnMaxZoom'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'removeOutsideVisibleBounds' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['removeOutsideVisibleBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'animateAddingMarkers' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['animateAddingMarkers'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default ''",
],
'disableClusteringAtZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['disableClusteringAtZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'default' => null,
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'maxClusterRadius' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxClusterRadius'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true],
'sql' => 'int(5) NULL',
],
'singleMarkerMode' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['singleMarkerMode'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => false, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default ''",
],
'polygonOptions' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['polygonOptions'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|json',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'spiderfyDistanceMultiplier' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['spiderfyDistanceMultiplier'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true],
'sql' => 'int(5) NULL',
],
'iconCreateFunction' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'disableDefaultStyle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['disableDefaultStyle'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true],
'sql' => "char(1) NOT NULL default ''",
],
'boundsMode' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['boundsMode'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getBoundsModes'],
'eval' => ['tl_class' => 'w50', 'includeBlankOption' => true],
'sql' => "varchar(6) NOT NULL default ''",
],
'tileUrl' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tileUrl'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50', 'mandatory' => true],
'sql' => "varchar(255) NOT NULL default ''",
],
'minZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'maxZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'maxNativeZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['maxNativeZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'tileSize' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tileSize'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true],
'sql' => 'int(5) NULL',
],
'subdomains' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['subdomains'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['maxlength' => 16, 'tl_class' => 'w50'],
'sql' => "varchar(16) NOT NULL default ''",
],
'errorTileUrl' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['errorTileUrl'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'attribution' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['attribution'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['maxlength' => 255, 'tl_class' => 'long', 'allowHtml' => true],
'sql' => "varchar(255) NOT NULL default ''",
],
'tms' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['tms'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'continuousWorld' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['continuousWorld'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'noWrap' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['noWrap'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'zoomOffset' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zoomOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true],
'sql' => 'int(5) NULL',
],
'zoomReverse' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zoomReverse'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'opacity' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['opacity'],
'exclude' => true,
'inputType' => 'text',
'default' => '1.0',
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50 clr'],
'sql' => "varchar(4) NOT NULL default ''",
],
'zIndex' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['zIndex'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true],
'sql' => 'int(5) NULL',
],
'unloadvisibleTiles' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['unloadvisibleTiles'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'updateWhenIdle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['updateWhenIdle'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'detectRetina' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['detectRetina'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'reuseTiles' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['reuseTiles'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'bounds' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['bounds'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
],
'eval' => [
'maxlength' => 255,
'multiple' => true,
'size' => 2,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
],
'sql' => 'mediumblob NULL',
],
'cache' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cache'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'cacheLifeTime' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cacheLifeTime'],
'exclude' => true,
'inputType' => 'text',
'default' => 0,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'overpassQuery' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassQuery'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'overpassEndpoint' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassEndpoint'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'overpassCallback' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassCallback'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
'minZoomIndicatorPosition' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorPosition'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'options' => ['topleft', 'topright', 'bottomleft', 'bottomright'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_layer'],
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50', 'helpwizard' => true],
'sql' => "varchar(255) NOT NULL default ''",
],
'minZoomIndicatorMessage' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorMessage'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['tl_class' => 'clr w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'minZoomIndicatorMessageNoLayer' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorMessageNoLayer'],
'exclude' => true,
'inputType' => 'text',
'default' => '',
'eval' => ['tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'debug' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['debug'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
'amenityIcons' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenityIcons'],
'exclude' => true,
'inputType' => 'multiColumnWizard',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getIcons'],
'eval' => [
'tl_class' => 'leaflet-mcw leaflet-mcw-amenity-icons',
'columnFields' => [
'amenity' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenity'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getAmenities'],
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'style' => 'width: 200px',
'chosen' => true,
],
],
'icon' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenityIcon'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getIcons'],
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'style' => 'width: 200px',
'chosen' => true,
],
],
],
],
'sql' => 'blob NULL',
],
'overpassPopup' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassPopup'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|javascript',
'tl_class' => 'clr',
],
'sql' => 'mediumtext NULL',
],
],
];

View File

@@ -0,0 +1,533 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_map'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'ctable' => ['tl_leaflet_control'],
'sql' => [
'keys' => [
'id' => 'primary',
'alias' => 'unique',
],
],
'onload_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
'sorting' => [
'mode' => 1,
'fields' => ['title'],
'panelLayout' => 'search,limit',
'flag' => 1,
],
'label' => [
'fields' => ['title', 'alias'],
'format' => '%s <span class="tl_gray">[%s]</span>',
],
'global_operations' => [
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['edit'],
'href' => 'act=edit',
'icon' => 'header.gif',
],
'controls' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['controls'],
'href' => 'table=tl_leaflet_control',
'icon' => 'bundles/netzmachtcontaoleaflet/img/control.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'metapalettes' => [
'default' => [
'title' => ['title', 'alias'],
'zoom' => ['center', 'zoom', 'adjustZoomExtra', 'adjustBounds', 'dynamicLoad', 'boundsPadding'],
'locate' => ['locate'],
'layers' => ['layers'],
'interaction' => [
'dragging',
'touchZoom',
'scrollWheelZoom',
'doubleClickZoom',
'boxZoom',
'tap',
'keyboard',
],
'behaviour' => [
'zoomControl',
'trackResize',
'closeOnClick',
'bounceAtZoomLimits',
],
'expert' => [
'options',
'cache',
],
],
],
'metasubpalettes' => [
'keyboard' => [
'keyboardPanOffset',
'keyboardZoomOffset',
],
'adjustZoomExtra' => [
'minZoom',
'maxZoom',
'zoomSnap',
'zoomDelta',
],
'locate' => [
':hide',
'locateWatch',
'locateSetView',
'locateMaxZoom',
'locateTimeout',
'locateMaximumAge',
'enableHighAccuracy',
],
'cache' => [
'cacheLifeTime',
],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['title'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'center' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['center'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
],
'wizard' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getGeocoder'],
],
'eval' => [
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
],
'sql' => 'varchar(255) NULL',
],
'layers' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'],
'exclude' => true,
'inputType' => 'multiColumnWizard',
'load_callback' => [
['netzmacht.contao_leaflet.listeners.dca.map', 'loadLayerRelations'],
],
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.map', 'saveLayerRelations'],
],
'eval' => [
'multiple' => true,
'doNotSaveEmpty' => true,
'tl_class' => 'leaflet-mcw leaflet-mcw-map-layers',
'columnFields' => [
'reference' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['reference'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.map', 'getLayers'],
'eval' => [
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
],
'flatArray' => true,
],
'sql' => 'mediumblob NULL',
],
'zoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'default' => null,
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'adjustZoomExtra' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustZoomExtra'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'minZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'maxZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'zoomSnap' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'varchar(4) NULL',
],
'zoomDelta' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'varchar(4) NULL',
],
'dragging' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['dragging'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'touchZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['touchZoom'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'scrollWheelZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['scrollWheelZoom'],
'exclude' => true,
'inputType' => 'select',
'options' => ['1', 'center'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'],
'default' => true,
'eval' => [
'tl_class' => 'w50',
'helpwizard' => true,
'includeBlankOption' => true,
'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'][''][0],
],
'sql' => "char(6) NOT NULL default ''",
],
'doubleClickZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'],
'exclude' => true,
'inputType' => 'select',
'options' => ['1', 'center'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'],
'default' => true,
'eval' => [
'tl_class' => 'w50',
'helpwizard' => true,
'includeBlankOption' => true,
'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'][''][0],
],
'sql' => "char(6) NOT NULL default ''",
],
'boxZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['boxZoom'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'tap' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['tap'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'trackResize' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['trackResize'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default '1'",
],
'bounceAtZoomLimits' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['bounceAtZoomLimits'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default '1'",
],
'closeOnClick' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['closeOnClick'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default '1'",
],
'keyboard' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboard'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'keyboardPanOffset' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardPanOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => 80,
'eval' => ['mandatory' => true, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'clr w50'],
'sql' => "int(4) NOT NULL default '80'",
],
'keyboardZoomOffset' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardZoomOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => 1,
'eval' => ['mandatory' => true, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "int(4) NOT NULL default '1'",
],
'zoomControl' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default '1'",
],
'options' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['options'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
],
'sql' => 'text NULL',
],
'adjustBounds' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'options' => ['load', 'deferred'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBoundsOptions'],
'eval' => ['tl_class' => 'clr w50', 'multiple' => true, 'helpwizard' => true],
'sql' => "varchar(255) NOT NULL default ''",
],
'dynamicLoad' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['dynamicLoad'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'clr w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default ''",
],
'boundsPadding' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['boundsPadding'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
'maxlength' => 32,
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'varchar(32) NULL',
],
'locate' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locate'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'locateWatch' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateWatch'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'locateSetView' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateSetView'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default ''",
],
'locateTimeout' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateTimeout'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true],
'sql' => 'int(9) NULL',
],
'locateMaximumAge' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaximumAge'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true],
'sql' => 'int(9) NULL',
],
'enableHighAccuracy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['enableHighAccuracy'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
'locateMaxZoom' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaxZoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getZoomLevels'],
'eval' => [
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'clr w50',
'includeBlankOption' => true,
'nullIfEmpty' => true,
],
'sql' => 'int(4) NULL',
],
'cache' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['cache'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'cacheLifeTime' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['cacheLifeTime'],
'exclude' => true,
'inputType' => 'text',
'default' => 0,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "int(9) NOT NULL default '0'",
],
],
];

View File

@@ -0,0 +1,41 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_map_layer'] = [
'config' => [
'dataContainer' => 'Table',
'sql' => [
'keys' => [
'id' => 'primary',
'mid,lid' => 'unique',
],
],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'sorting' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'mid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'lid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
],
];

View File

@@ -0,0 +1,342 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'ptable' => 'tl_leaflet_layer',
'sql' => [
'keys' => [
'id' => 'primary',
'pid' => 'index',
'alias' => 'unique',
],
],
'onload_callback' => [
['netzmacht.contao_leaflet.listeners.dca.marker', 'initialize'],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
'sorting' => [
'mode' => 4,
'fields' => ['sorting'],
'flag' => 1,
'panelLayout' => 'sort,filter;search,limit',
'headerFields' => ['title', 'type'],
'child_record_callback' => ['netzmacht.contao_leaflet.listeners.dca.marker', 'generateRow'],
],
'label' => [
'fields' => ['title'],
'format' => '%s',
],
'global_operations' => [
'icons' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icons'],
'href' => 'table=tl_leaflet_icon&id=',
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
'popups' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback',
],
'toolkit' => [
'state_button' => [
'stateColumn' => 'active',
],
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'metapalettes' => [
'default' => [
'title' => ['title', 'alias', 'coordinates'],
'content' => ['tooltip', 'alt', 'addPopup'],
'config' => [
':hide',
'clickable',
'draggable',
'keyboard',
'zIndexOffset',
'opacity',
'riseOnHover',
'riseOffset',
'customIcon',
],
'expert' => [':hide', 'featureData'],
'active' => ['active', 'ignoreForBounds'],
],
],
'metasubpalettes' => [
'addPopup' => ['popup', 'popupContent'],
'customIcon' => ['icon'],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'sorting' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
'sorting' => true,
],
'pid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['title'],
'exclude' => true,
'search' => true,
'sorting' => true,
'flag' => 1,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'coordinates' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['coordinates'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
['netzmacht.contao_leaflet.listeners.dca.marker', 'saveCoordinates'],
],
'load_callback' => [
['netzmacht.contao_leaflet.listeners.dca.marker', 'loadCoordinates'],
],
'wizard' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getGeocoder'],
],
'eval' => [
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
'doNotSaveEmpty' => true,
],
],
'latitude' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['latitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => 'decimal(10,8) NULL',
],
'longitude' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['longitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => 'decimal(11,8) NULL',
],
'altitude' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['altitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => 'float NULL',
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['active'],
'exclude' => true,
'filter' => true,
'sorting' => true,
'flag' => 12,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'tooltip' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['tooltip'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alt' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['alt'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'addPopup' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['addPopup'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'popup' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popup'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.marker', 'getPopups'],
'eval' => [
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'popupContent' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popupContent'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'rte' => 'tinyMCE', 'helpwizard' => true, 'tl_class' => 'clr'],
'explanation' => 'insertTags',
'sql' => 'mediumtext NULL',
],
'customIcon' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['customIcon'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'clr w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'icon' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icon'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.marker', 'getIcons'],
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'chosen' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'draggable' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['draggable'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'clickable' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['clickable'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'keyboard' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['keyboard'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'zIndexOffset' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['zIndexOffset'],
'exclude' => true,
'inputType' => 'text',
'default' => 0,
'eval' => ['maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'clr w50', 'nullIfEmpty' => true],
'sql' => 'int(5) NULL',
],
'ignoreForBounds' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['ignoreForBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'featureData' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['featureData'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
],
'sql' => 'text NULL',
],
],
];

View File

@@ -0,0 +1,276 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => [
'keys' => [
'id' => 'primary',
'alias' => 'unique',
],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
'sorting' => [
'mode' => 1,
'fields' => ['title'],
'flag' => 1,
'panelLayout' => 'limit',
'headerFields' => ['title', 'type'],
],
'label' => [
'fields' => ['title', 'type'],
'format' => '%s <span class="tl_gray">[%s]</span>',
],
'global_operations' => [
'layers' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'],
'href' => 'table=tl_leaflet_layer',
'icon' => 'bundles/netzmachtcontaoleaflet/img/layers.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
'styles' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'icons' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'],
'href' => 'table=tl_leaflet_icon',
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback',
],
'toolkit' => [
'state_button' => [
'stateColumn' => 'active',
],
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'palettes' => [
'__selector__' => ['type'],
],
'metapalettes' => [
'default' => [
'title' => ['title', 'alias'],
'size' => ['maxWidth', 'minWidth', 'maxHeight'],
'config' => [
':hide',
'closeButton',
'keepInView',
'closeOnClick',
'zoomAnimation',
'offset',
'className',
'autoPan',
],
'active' => ['active'],
],
],
'metasubpalettes' => [
'autoPan' => ['autoPanPadding'],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['title'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['alias'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'maxWidth' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['maxWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => 'int(4) NULL',
],
'minWidth' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['minWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => 'int(4) NULL',
],
'maxHeight' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['maxHeight'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => 'int(4) NULL',
],
'autoPan' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['autoPan'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'keepInView' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default ''",
],
'closeButton' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['closeButton'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default '1'",
],
'offset' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['offset'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
],
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
],
'sql' => 'varchar(255) NULL',
],
'autoPanPadding' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['autoPanPadding'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
'multiple' => true,
'size' => 2,
],
'sql' => 'varchar(255) NULL',
],
'zoomAnimation' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['zoomAnimation'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default '1'",
],
'closeOnClick' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['closeOnClick'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default '1'",
],
'className' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['className'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 12,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
],
];

View File

@@ -0,0 +1,284 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_style'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => [
'keys' => [
'id' => 'primary',
'alias' => 'unique',
],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
'sorting' => [
'mode' => 1,
'fields' => ['title'],
'flag' => 1,
'panelLayout' => 'limit',
'headerFields' => ['title', 'type'],
],
'label' => [
'fields' => ['title', 'type'],
'format' => '%s <span class="tl_gray">[%s]</span>',
],
'global_operations' => [
'layers' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['layersBtn'],
'href' => 'table=tl_leaflet_layer',
'icon' => 'bundles/netzmachtcontaoleaflet/img/layers.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
'icons' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'],
'href' => 'table=tl_leaflet_icon',
'icon' => 'bundles/netzmachtcontaoleaflet/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'popups' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback',
],
'toolkit' => [
'state_button' => [
'stateColumn' => 'active',
],
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'palettes' => [
'__selector__' => ['type'],
],
'metapalettes' => [
'default' => [
'title' => ['title', 'alias', 'type'],
'config' => [],
'active' => ['active'],
],
'fixed extends default' => [
'config' => ['stroke', 'fill'],
],
],
'metasubpalettes' => [
'stroke' => ['color', 'weight', 'opacity', 'dashArray', 'lineCap', 'lineJoin'],
'fill' => ['fillColor', 'fillOpacity',],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['title'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['alias'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'type' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['type'],
'exclude' => true,
'inputType' => 'select',
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
],
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.style', 'getStyleOptions'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_style'],
'sql' => "varchar(32) NOT NULL default ''",
],
'stroke' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['stroke'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'w50', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'color' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['color'],
'exclude' => true,
'inputType' => 'text',
'wizard' => [
['netzmacht.contao_toolkit.dca.listeners.color_picker', 'handleWizardCallback'],
],
'eval' => [
'tl_class' => 'w50 wizard clr',
'maxlength' => 7,
'decodeEntities' => true,
],
'sql' => "varchar(8) NOT NULL default ''",
],
'weight' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['weight'],
'exclude' => true,
'inputType' => 'text',
'default' => 5,
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "int(4) NOT NULL default '5'",
],
'opacity' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity'],
'exclude' => true,
'inputType' => 'text',
'default' => '0.5',
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "varchar(4) NOT NULL default '0.5'",
],
'fill' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['fill'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'clr w50', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'fillColor' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['fillColor'],
'exclude' => true,
'inputType' => 'text',
'wizard' => [
['netzmacht.contao_toolkit.dca.listeners.color_picker', 'handleWizardCallback'],
],
'eval' => [
'tl_class' => 'clr w50 wizard',
'maxlength' => 7,
'decodeEntities' => true,
],
'sql' => "varchar(8) NOT NULL default ''",
],
'fillOpacity' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['fillOpacity'],
'exclude' => true,
'inputType' => 'text',
'default' => '0.2',
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "varchar(4) NOT NULL default '0.2'",
],
'dashArray' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['dashArray'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 32, 'tl_class' => 'w50'],
'sql' => "varchar(32) NOT NULL default ''",
],
'lineCap' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineCap'],
'exclude' => true,
'inputType' => 'select',
'options' => ['butt', 'round', 'square', 'inherit'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineCaps'],
'eval' => [
'mandatory' => false,
'tl_class' => 'w50 clr',
'includeBlankOption' => true,
'helpwizard' => true,
],
'sql' => "varchar(8) NOT NULL default ''",
],
'lineJoin' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineJoin'],
'exclude' => true,
'inputType' => 'select',
'options' => ['miter', 'round', 'bevel', 'inherit'],
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['lineJoins'],
'eval' => ['mandatory' => false, 'tl_class' => 'w50', 'includeBlankOption' => true, 'helpwizard'],
'sql' => "varchar(8) NOT NULL default ''",
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_style']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 12,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
],
];

View File

@@ -0,0 +1,382 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'ptable' => 'tl_leaflet_layer',
'sql' => [
'keys' => [
'id' => 'primary',
'pid' => 'index',
'alias' => 'unique',
],
],
'onload_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'loadLanguageFile'],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'list' => [
'sorting' => [
'mode' => 4,
'fields' => ['sorting'],
'flag' => 1,
'panelLayout' => 'sort,filter;search,limit',
'headerFields' => ['title', 'type'],
'child_record_callback' => ['netzmacht.contao_leaflet.listeners.dca.vector', 'generateRow'],
],
'label' => [
'fields' => ['title'],
'format' => '%s',
],
'global_operations' => [
'styles' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['styles'],
'href' => 'table=tl_leaflet_style',
'icon' => 'bundles/netzmachtcontaoleaflet/img/style.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'popups' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popups'],
'href' => 'table=tl_leaflet_popup',
'icon' => 'bundles/netzmachtcontaoleaflet/img/popup.png',
'attributes' => 'onclick="Backend.getScrollOffset();"',
],
'all' => [
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
],
],
'operations' => [
'edit' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
],
'copy' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
],
'cut' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['cut'],
'href' => 'act=paste&amp;mode=cut',
'icon' => 'cut.gif',
'attributes' => 'onclick="Backend.getScrollOffset()"',
],
'delete' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm']
. '\'))return false;Backend.getScrollOffset()"',
],
'toggle' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => [
'netzmacht.contao_toolkit.dca.listeners.state_button_callback',
'handleButtonCallback',
],
'toolkit' => [
'state_button' => [
'stateColumn' => 'active',
],
],
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
'palettes' => [
'__selector__' => ['type'],
],
'metapalettes' => [
'default' => [
'title' => ['title', 'alias', 'type'],
'data' => [],
'popup' => [':hide', 'addPopup'],
'config' => [':hide', 'style', 'className', 'clickable'],
'expert' => [':hide', 'featureData'],
'active' => ['active', 'ignoreForBounds'],
],
'polyline extends default' => [
'+config' => ['smoothFactor', 'noClip'],
'data' => ['data'],
],
'multiPolyline extends polyline' => [
'data' => ['multiData'],
],
'polygon extends polyline' => [],
'multiPolygon extends multiPolyline' => [
],
'rectangle extends polygon' => [
'data' => ['bounds'],
],
'circle extends default' => [
'+data' => ['coordinates', 'radius'],
],
'circleMarker extends circle' => [],
],
'metasubpalettes' => [
'addPopup' => ['popup', 'popupContent'],
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'pid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'sorting' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
'sorting' => true,
],
'title' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['title'],
'exclude' => true,
'inputType' => 'text',
'filter' => false,
'sorting' => true,
'search' => true,
'flag' => 1,
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['alias'],
'exclude' => true,
'inputType' => 'text',
'search' => true,
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
'fields' => ['title'],
],
],
'sql' => 'varchar(255) NULL',
],
'type' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['type'],
'exclude' => true,
'inputType' => 'select',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 1,
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'includeBlankOption' => true,
'submitOnChange' => true,
'chosen' => true,
'helpwizard' => true,
],
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.vector', 'getVectorOptions'],
'reference' => &$GLOBALS['TL_LANG']['leaflet_vector'],
'sql' => "varchar(32) NOT NULL default ''",
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 12,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
],
'addPopup' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['addPopup'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
],
'popup' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popup'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.vector', 'getPopups'],
'eval' => [
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'popupContent' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['popupContent'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'rte' => 'tinyMCE', 'helpwizard' => true, 'tl_class' => 'clr'],
'explanation' => 'insertTags',
'sql' => 'mediumtext NULL',
],
'style' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['style'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.vector', 'getStyles'],
'eval' => [
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'clickable' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['clickable'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => ['tl_class' => 'm12 w50'],
'sql' => "char(1) NOT NULL default ''",
],
'className' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['className'],
'exclude' => true,
'inputType' => 'text',
'eval' => ['mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
],
'coordinates' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['coordinates'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
],
'wizard' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'getGeocoder'],
],
'eval' => [
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
'mandatory' => true,
],
'sql' => 'varchar(255) NULL',
],
'radius' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['radius'],
'exclude' => true,
'inputType' => 'text',
'default' => 5,
'eval' => ['mandatory' => false, 'maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'clr w50'],
'sql' => "int(10) NOT NULL default '5'",
],
'data' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['data'],
'inputType' => 'textarea',
'search' => false,
'eval' => ['mandatory' => true, 'alwaysSave' => true],
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateMultipleCoordinates'],
],
'sql' => 'longblob NULL',
],
'multiData' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['multiData'],
'inputType' => 'multiColumnWizard',
'search' => false,
'eval' => [
'tl_class' => 'leaflet-mcw',
'mandatory' => true,
'alwaysSave' => true,
'flatArray' => true,
'columnFields' => [
'data' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['data'],
'inputType' => 'textarea',
'search' => false,
'eval' => ['alwaysSave' => true, 'style' => 'width:600px'],
],
],
],
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateMultipleCoordinateSets'],
],
'sql' => 'longblob NULL',
],
'bounds' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['bounds'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => [],
'eval' => [
'maxlength' => 255,
'multiple' => true,
'size' => 2,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
],
'sql' => 'mediumblob NULL',
],
'ignoreForBounds' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['ignoreForBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
],
'featureData' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['featureData'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => [
'tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json',
],
'sql' => 'text NULL',
],
],
];

View File

@@ -0,0 +1,85 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = [
'type' => ['name', 'type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'],
'templates' => [':hide', 'customTpl'],
'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'],
];
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_map'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_map'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.frontend_integration', 'getMaps'],
'wizard' => [
['netzmacht.contao_leaflet.listeners.dca.frontend_integration', 'getEditMapLink'],
],
'eval' => [
'tl_class' => 'w50 wizard',
'chosen' => true,
],
'sql' => "int(10) unsigned NOT NULL default '0'",
];
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_mapId'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_mapId'],
'inputType' => 'text',
'exclude' => true,
'eval' => [
'tl_class' => 'w50',
'chosen' => true,
'maxlength' => 16,
],
'sql' => "varchar(16) NOT NULL default ''",
];
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_width'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_width'],
'inputType' => 'inputUnit',
'options' => ['px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'],
'search' => false,
'exclude' => true,
'eval' => ['rgxp' => 'digit', 'tl_class' => 'clr w50'],
'sql' => "varchar(64) NOT NULL default ''",
];
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_height'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_height'],
'inputType' => 'inputUnit',
'options' => ['px', '%', 'em', 'pt', 'pc', 'in', 'cm', 'mm'],
'search' => false,
'exclude' => true,
'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
];
$GLOBALS['TL_DCA']['tl_module']['fields']['leaflet_template'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['leaflet_template'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => ['netzmacht.contao_toolkit.dca.listeners.template_options', 'handleOptionsCallback'],
'eval' => [
'tl_class' => 'w50',
'chosen' => true,
],
'toolkit' => [
'template_options' => [
'prefix' => 'leaflet_map_js',
],
],
'sql' => "varchar(64) NOT NULL default ''",
];

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['leaflet_control']['zoom'][0] = 'Zoom control';
$GLOBALS['TL_LANG']['leaflet_control']['zoom'][1] = 'A basic zoom control. For more details read the <a href="http://leafletjs.com/reference.html#control-zoom" target="_blank">Leaflet documentation</a>.';
$GLOBALS['TL_LANG']['leaflet_control']['attribution'][0] = 'Attribution control';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['MOD']['leaflet'][0] = 'Leaflet';
$GLOBALS['TL_LANG']['MOD']['leaflet'][1] = 'Leaflet extension for Contao';
$GLOBALS['TL_LANG']['MOD']['leaflet_map'][0] = 'Leaflet Maps';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_content']['leaflet_legend'] = 'Leaflet map configuration';
$GLOBALS['TL_LANG']['tl_content']['leaflet_map'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['tl_content']['leaflet_map'][1] = 'Choose a Leaflet Map';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_control']['name_legend'] = 'Title and type';
$GLOBALS['TL_LANG']['tl_leaflet_control']['config_legend'] = 'Configuration';
$GLOBALS['TL_LANG']['tl_leaflet_control']['active_legend'] = 'Activation';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_icon']['title_legend'] = 'Title';
$GLOBALS['TL_LANG']['tl_leaflet_icon']['config_legend'] = 'Configuration';
$GLOBALS['TL_LANG']['tl_leaflet_icon']['shadow_legend'] = 'Shadow';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_layer']['title_legend'] = 'Layer';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['active_legend'] = 'Activation';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['expert_legend'] = 'Expert settings';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_map']['title_legend'] = 'Title';
$GLOBALS['TL_LANG']['tl_leaflet_map']['interaction_legend'] = 'Interaction controls';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom_legend'] = 'Center and zoom';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_marker']['title_legend'] = 'Title and type';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['content_legend'] = 'Content';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['config_legend'] = 'Configuration';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_popup']['title_legend'] = 'Title';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['config_legend'] = 'Configuration';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['size_legend'] = 'Popup size';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_style']['title_legend'] = 'Title and type';
$GLOBALS['TL_LANG']['tl_leaflet_style']['active_legend'] = 'Activation';
$GLOBALS['TL_LANG']['tl_leaflet_style']['config_legend'] = 'Configuration';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_leaflet_vector']['title_legend'] = 'Title and type';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['active_legend'] = 'Activation';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['config_legend'] = 'Configuration';

View File

@@ -1,5 +1,15 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
$GLOBALS['TL_LANG']['tl_module']['leaflet_legend'] = 'Leaflet map configuration';
$GLOBALS['TL_LANG']['tl_module']['leaflet_map'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['tl_module']['leaflet_map'][1] = 'Choose a Leaflet Map';

Some files were not shown because too many files have changed in this diff Show More