commit 86baf561ba42fc6fefe5b826b3c6639708b3c041 Author: David Molineus Date: Sat Dec 27 22:58:58 2014 +0100 Initial commit. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b21208 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/vendor/ +/bin/ +/demo/ + +coverage.xml + +composer.lock diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f64d103 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..c3f919a --- /dev/null +++ b/build.properties @@ -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 diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..ccf97f7 --- /dev/null +++ b/build.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..e0b8b97 --- /dev/null +++ b/composer.json @@ -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" + } + } + } +} diff --git a/module/config/config.php b/module/config/config.php new file mode 100644 index 0000000..fb0e613 --- /dev/null +++ b/module/config/config.php @@ -0,0 +1,5 @@ + array('tl_leaflet_map') +); diff --git a/module/dca/tl_leaflet_control.php b/module/dca/tl_leaflet_control.php new file mode 100644 index 0000000..158d86a --- /dev/null +++ b/module/dca/tl_leaflet_control.php @@ -0,0 +1,164 @@ + 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 ''" + ), + ), +); diff --git a/module/dca/tl_leaflet_layer.php b/module/dca/tl_leaflet_layer.php new file mode 100644 index 0000000..e69de29 diff --git a/module/dca/tl_leaflet_map.php b/module/dca/tl_leaflet_map.php new file mode 100644 index 0000000..20a4100 --- /dev/null +++ b/module/dca/tl_leaflet_map.php @@ -0,0 +1,192 @@ + 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 ''" + ), + ), +);