Files
contao-leaflet-maps/module/dca/tl_leaflet_map.php

492 lines
19 KiB
PHP
Raw Normal View History

2014-12-27 22:58:58 +01:00
<?php
2015-01-12 19:03:29 +01:00
/**
* @package dev
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014 netzmacht creative David Molineus
* @license LGPL 3.0
* @filesource
*
*/
2014-12-27 22:58:58 +01:00
$GLOBALS['TL_DCA']['tl_leaflet_map'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
2015-01-05 12:25:46 +01:00
'ctable' => array('tl_leaflet_control'),
2014-12-27 22:58:58 +01:00
'sql' => array
(
'keys' => array
(
2015-01-09 17:40:50 +01:00
'id' => 'primary',
'alias' => 'unique',
2014-12-27 22:58:58 +01:00
)
2015-01-23 20:57:52 +01:00
),
'onload_callback' => array(
function() {
\Controller::loadLanguageFile('leaflet');
}
2014-12-27 22:58:58 +01:00
)
),
'list' => array
(
'sorting' => array
(
'mode' => 1,
'fields' => array('title'),
2015-01-08 16:27:55 +01:00
'panelLayout' => 'search,limit',
2014-12-29 19:13:55 +01:00
'flag' => 1,
2014-12-27 22:58:58 +01:00
),
'label' => array
(
2015-01-09 17:50:10 +01:00
'fields' => array('title', 'alias'),
'format' => '%s <span class="tl_gray">[%s]</span>'
2014-12-27 22:58:58 +01:00
),
'global_operations' => array
(
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
2014-12-29 16:22:16 +01:00
),
2014-12-27 22:58:58 +01:00
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['edit'],
'href' => 'act=edit',
'icon' => 'header.gif'
),
2015-01-05 12:25:46 +01:00
'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"'
),
2014-12-27 22:58:58 +01:00
'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(
2014-12-29 12:17:40 +01:00
'title' => array('title', 'alias'),
'zoom' => array('center', 'zoom', 'adjustZoomExtra', 'adjustBounds'),
2015-01-24 11:38:15 +01:00
'locate' => array('locate'),
2014-12-29 16:22:16 +01:00
'layers' => array('layers'),
2014-12-29 12:17:40 +01:00
'interaction' => array(
2014-12-27 22:58:58 +01:00
'dragging',
'touchZoom',
'scrollWheelZoom',
'doubleClickZoom',
'boxZoom',
'tap',
2014-12-29 12:17:40 +01:00
'keyboard'
2014-12-27 22:58:58 +01:00
),
2014-12-29 12:17:40 +01:00
'behaviour' => array(
2015-01-24 11:38:15 +01:00
'zoomControl',
2014-12-27 22:58:58 +01:00
'trackResize',
2014-12-29 12:17:40 +01:00
'closeOnClick',
2014-12-27 22:58:58 +01:00
'bounceAtZoomLimits'
),
2014-12-29 16:22:16 +01:00
'expert' => array(
2014-12-29 12:17:40 +01:00
'options',
2014-12-27 22:58:58 +01:00
)
),
),
'metasubpalettes' => array(
2015-01-24 11:38:15 +01:00
'keyboard' => array(
'keyboardPanOffset',
'keyboardZoomOffset'
),
'adjustZoomExtra' => array(
'minZoom',
'maxZoom'
),
'locate' => array(
'locateWatch',
'locateSetView',
'locateMaxZoom',
'locateTimeout',
'locateMaximumAge',
'enableHighAccuracy'
),
2014-12-27 22:58:58 +01:00
),
2015-01-24 11:38:15 +01:00
2014-12-27 22:58:58 +01:00
'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',
2015-01-08 16:27:55 +01:00
'search' => true,
2014-12-29 12:17:40 +01:00
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
2014-12-27 22:58:58 +01:00
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'],
'exclude' => true,
'inputType' => 'text',
2015-01-08 16:27:55 +01:00
'search' => true,
2015-01-09 17:43:38 +01:00
'save_callback' => array(
\Netzmacht\Contao\DevTools\Dca::createGenerateAliasCallback('tl_leaflet_map', 'title'),
),
2015-01-09 17:40:50 +01:00
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
2014-12-27 22:58:58 +01:00
'sql' => "varchar(255) NOT NULL default ''"
),
2014-12-29 12:17:40 +01:00
'center' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['center'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'validateCoordinate')
),
'wizard' => array(
array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'getGeocoder')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
2014-12-29 16:22:16 +01:00
'layers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'],
'exclude' => true,
2015-01-24 11:38:15 +01:00
'inputType' => 'multiColumnWizard',
2015-01-09 22:33:57 +01:00
'load_callback' => array(
array('Netzmacht\Contao\Leaflet\Dca\Map', 'loadLayerRelations'),
),
'save_callback' => array(
array('Netzmacht\Contao\Leaflet\Dca\Map', 'saveLayerRelations'),
),
2014-12-29 16:22:16 +01:00
'eval' => array(
'multiple' => true,
2015-01-09 22:33:57 +01:00
'doNotSaveEmpty' => true,
2015-01-24 11:38:15 +01:00
'columnFields' => array(
'reference' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['reference'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\Layer', '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
2014-12-29 16:22:16 +01:00
),
'sql' => "mediumblob NULL"
),
2014-12-29 12:17:40 +01:00
'zoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\Leaflet', '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' => true,
'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' => array('Netzmacht\Contao\Leaflet\Dca\Leaflet', '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' => array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
2014-12-27 22:58:58 +01:00
'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,
2014-12-29 12:17:40 +01:00
'inputType' => 'select',
'options' => array('1', '', 'center'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'],
2014-12-27 22:58:58 +01:00
'default' => true,
2014-12-29 12:17:40 +01:00
'eval' => array('tl_class' => 'w50', 'helpwizard' => true,),
2014-12-29 16:22:16 +01:00
'sql' => "char(6) NOT NULL default ''"
2014-12-27 22:58:58 +01:00
),
'doubleClickZoom' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'],
'exclude' => true,
2014-12-29 12:17:40 +01:00
'inputType' => 'select',
'options' => array('1', '', 'center'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'],
2014-12-27 22:58:58 +01:00
'default' => true,
2014-12-29 12:17:40 +01:00
'eval' => array('tl_class' => 'w50', 'helpwizard' => true,),
2014-12-29 16:22:16 +01:00
'sql' => "char(6) NOT NULL default ''"
2014-12-27 22:58:58 +01:00
),
'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 ''"
),
2014-12-29 12:17:40 +01:00
'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
2014-12-27 22:58:58 +01:00
(
2014-12-29 12:17:40 +01:00
'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'],
2014-12-27 22:58:58 +01:00
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
2014-12-29 12:17:40 +01:00
'sql' => "char(1) NOT NULL default '1'"
),
'options' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['options'],
'exclude' => true,
'inputType' => 'textarea',
2015-01-23 11:02:32 +01:00
'eval' => array('tl_class' => 'clr lng',
'allowHtml' => true,
'style' => 'min-height: 40px;',
'rte' => 'ace|json'
),
'sql' => "text NULL"
2014-12-29 12:17:40 +01:00
),
'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'],
2015-01-24 11:38:15 +01:00
'eval' => array('tl_class' => 'clr w50', 'multiple' => true, 'helpwizard' => true),
'sql' => "varchar(255) NOT NULL default ''"
),
2015-01-24 11:38:15 +01:00
'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' => array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'getZoomLevels'),
'eval' => array(
'maxlength' => 4,
'rgxp' => 'digit',
'tl_class' => 'clr w50',
'includeBlankOption' => true,
'nullIfEmpty' => true
),
'sql' => "int(4) NULL"
),
2014-12-27 22:58:58 +01:00
),
);