mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-28 19:13:55 +01:00
Initial commit.
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/vendor/
|
||||
/bin/
|
||||
/demo/
|
||||
|
||||
coverage.xml
|
||||
|
||||
composer.lock
|
||||
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
language: php
|
||||
php:
|
||||
- "5.4"
|
||||
- "5.5"
|
||||
- "5.6"
|
||||
|
||||
sudo: false
|
||||
|
||||
install:
|
||||
- composer install --prefer-dist --dev
|
||||
|
||||
script:
|
||||
- ant -keep-going
|
||||
3
build.properties
Normal file
3
build.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
phpcs.standard=${basedir}/vendor/contao-community-alliance/coding-standard/phpcs/ContaoCommunityAlliance/ruleset.xml
|
||||
phpmd.ruleset=${basedir}/vendor/contao-community-alliance/coding-standard/phpmd/ruleset.xml
|
||||
5
build.xml
Normal file
5
build.xml
Normal file
@@ -0,0 +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" />
|
||||
</project>
|
||||
51
composer.json
Normal file
51
composer.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"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.1,<3.5-dev",
|
||||
"contao-community-alliance/dependency-container":"~1.0",
|
||||
"contao-community-alliance/event-dispatcher":"~1.0",
|
||||
"netzmacht/php-javascript-builder": "~1.0",
|
||||
"netzmacht/php-leaflet": "~1.0"
|
||||
},
|
||||
"require-dev":{
|
||||
"netzmacht/contao-build-tools": "1.0.x-dev"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Netzmacht\\Contao\\Leaflet": "src/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "bin"
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"minimum-stability": "dev",
|
||||
"extra":{
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
},
|
||||
"contao": {
|
||||
"sources":{
|
||||
"module": "system/modules/leaflet"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
5
module/config/config.php
Normal file
5
module/config/config.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$GLOBALS['BE_MOD']['content']['leaflet'] = array(
|
||||
'tables' => array('tl_leaflet_map')
|
||||
);
|
||||
164
module/dca/tl_leaflet_control.php
Normal file
164
module/dca/tl_leaflet_control.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
$GLOBALS['TL_DCA']['tl_leaflet_control'] = array
|
||||
(
|
||||
'config' => array(
|
||||
'dataContainer' => 'Table',
|
||||
'enableVersioning' => true,
|
||||
'sql' => array
|
||||
(
|
||||
'keys' => array
|
||||
(
|
||||
'id' => 'primary'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
// List
|
||||
'list' => array
|
||||
(
|
||||
'sorting' => array
|
||||
(
|
||||
'mode' => 1,
|
||||
'fields' => array('title'),
|
||||
'flag' => 1
|
||||
),
|
||||
'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()"'
|
||||
),
|
||||
'show' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['show'],
|
||||
'href' => 'act=show',
|
||||
'icon' => 'show.gif'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'metapalettes' => array(
|
||||
'default' => array(
|
||||
'name' => array('title', 'type', 'position'),
|
||||
),
|
||||
'zoom extends default' => array(
|
||||
'zoom' => array('zoomInText', 'zoomOutText', 'zoomInTitle', 'zoomOutTitle'),
|
||||
),
|
||||
'layers extends default' => array(
|
||||
'layers' => array('collapsed', 'autoZIndex')
|
||||
),
|
||||
'scale extends default' => array(
|
||||
'scale' => array('maxWidth', 'scale', 'updateWhenIdle')
|
||||
)
|
||||
),
|
||||
|
||||
'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_control']['title'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'position' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['position'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'select',
|
||||
'options' => array('topleft', 'topright', 'bottomleft', 'bottomright'),
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'zoomInText' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'zoomOutText' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'zoomInTitle' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'zoomOutTitle' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'collapsed' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['collapsed'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'checkbox',
|
||||
'default' => '1',
|
||||
'eval' => array(),
|
||||
'sql' => "char(1) NOT NULL default ''"
|
||||
),
|
||||
'autoZIndex' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['autoZIndex'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'checkbox',
|
||||
'default' => '1',
|
||||
'eval' => array(),
|
||||
'sql' => "char(1) NOT NULL default ''"
|
||||
),
|
||||
),
|
||||
);
|
||||
0
module/dca/tl_leaflet_layer.php
Normal file
0
module/dca/tl_leaflet_layer.php
Normal file
192
module/dca/tl_leaflet_map.php
Normal file
192
module/dca/tl_leaflet_map.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
$GLOBALS['TL_DCA']['tl_leaflet_map'] = array
|
||||
(
|
||||
'config' => array(
|
||||
'dataContainer' => 'Table',
|
||||
'enableVersioning' => true,
|
||||
'ctable' => array('tl_leaflet'),
|
||||
'sql' => array
|
||||
(
|
||||
'keys' => array
|
||||
(
|
||||
'id' => 'primary'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'list' => array
|
||||
(
|
||||
'sorting' => array
|
||||
(
|
||||
'mode' => 1,
|
||||
'fields' => array('title'),
|
||||
'flag' => 1
|
||||
),
|
||||
'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_map']['edit'],
|
||||
'href' => 'act=edit',
|
||||
'icon' => 'header.gif'
|
||||
),
|
||||
'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(
|
||||
'name' => array('title', 'alias'),
|
||||
'zoom' => array('center', 'zoom', 'adjustExtraZoom'),
|
||||
'controls' => array('zoomControl', 'attributionControl', 'controls'),
|
||||
'operation' => array(
|
||||
'dragging',
|
||||
'touchZoom',
|
||||
'scrollWheelZoom',
|
||||
'doubleClickZoom',
|
||||
'boxZoom',
|
||||
'tap',
|
||||
'adjustKeyboard'
|
||||
),
|
||||
'behaviour' => array(
|
||||
'trackResize',
|
||||
'popupOnClick',
|
||||
'bounceAtZoomLimits'
|
||||
),
|
||||
'experts' => array(
|
||||
'cache',
|
||||
'options'
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
'metasubpalettes' => array(
|
||||
'adjustKeyboard' => array('keyboard', 'keyboardPanOffset', 'keyboardZoomOffset'),
|
||||
'adjustExtraZoom' => array('minZoom', 'maxZoom'),
|
||||
),
|
||||
|
||||
'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',
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'alias' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array('mandatory' => true, 'maxlength' => 255),
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
),
|
||||
'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' => 'checkbox',
|
||||
'default' => true,
|
||||
'eval' => array('tl_class' => 'w50'),
|
||||
'sql' => "char(1) NOT NULL default ''"
|
||||
),
|
||||
'doubleClickZoom' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'checkbox',
|
||||
'default' => true,
|
||||
'eval' => array('tl_class' => 'w50'),
|
||||
'sql' => "char(1) 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 ''"
|
||||
),
|
||||
'adjustKeyboard' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustKeyboard'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'checkbox',
|
||||
'default' => true,
|
||||
'eval' => array('tl_class' => 'w50'),
|
||||
'sql' => "char(1) NOT NULL default ''"
|
||||
),
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user