forked from Snck3rs/contao-leaflet-maps
Move bundle files to Bundle namespace.
This commit is contained in:
85
src/Bundle/Resources/contao/dca/tl_content.php
Normal file
85
src/Bundle/Resources/contao/dca/tl_content.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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', 'leaflet_template'],
|
||||
'templates' => [':hide', 'customTpl'],
|
||||
'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_maps.listeners.dca.frontend_integration', 'getMaps'],
|
||||
'wizard' => [
|
||||
['netzmacht.contao_leaflet_maps.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 ''",
|
||||
];
|
||||
409
src/Bundle/Resources/contao/dca/tl_leaflet_control.php
Normal file
409
src/Bundle/Resources/contao/dca/tl_leaflet_control.php
Normal file
@@ -0,0 +1,409 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.listeners.dca.leaflet', 'loadLanguageFile'],
|
||||
],
|
||||
'onsubmit_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => [
|
||||
'mandatory' => false,
|
||||
'maxlength' => 255,
|
||||
'tl_class' => 'w50',
|
||||
'nullIfEmpty' => true,
|
||||
],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.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_maps.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_maps.listeners.dca.control', 'loadLayerRelations'],
|
||||
],
|
||||
'save_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.listeners.dca.control', 'saveLayerRelations'],
|
||||
],
|
||||
'eval' => [
|
||||
'tl_class' => 'clr',
|
||||
'columnFields' => [
|
||||
'layer' => [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'select',
|
||||
'options_callback' => ['netzmacht.contao_leaflet_maps.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_maps.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 ''",
|
||||
],
|
||||
],
|
||||
];
|
||||
44
src/Bundle/Resources/contao/dca/tl_leaflet_control_layer.php
Normal file
44
src/Bundle/Resources/contao/dca/tl_leaflet_control_layer.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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 ''",
|
||||
],
|
||||
],
|
||||
];
|
||||
418
src/Bundle/Resources/contao/dca/tl_leaflet_icon.php
Normal file
418
src/Bundle/Resources/contao/dca/tl_leaflet_icon.php
Normal file
@@ -0,0 +1,418 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.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_maps.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_maps.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_maps.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_maps.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',
|
||||
],
|
||||
],
|
||||
];
|
||||
855
src/Bundle/Resources/contao/dca/tl_leaflet_layer.php
Normal file
855
src/Bundle/Resources/contao/dca/tl_leaflet_layer.php
Normal file
@@ -0,0 +1,855 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.listeners.dca.layer', 'deleteRelations'],
|
||||
],
|
||||
'sql' => [
|
||||
'keys' => [
|
||||
'id' => 'primary',
|
||||
'pid' => 'index',
|
||||
'alias' => 'unique',
|
||||
],
|
||||
],
|
||||
'onload_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.listeners.dca.leaflet', 'loadLanguageFile'],
|
||||
],
|
||||
'onsubmit_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.listeners.dca.layer', 'getPasteButtons'],
|
||||
],
|
||||
'label' => [
|
||||
'fields' => ['title'],
|
||||
'format' => '%s',
|
||||
'label_callback' => ['netzmacht.contao_leaflet_maps.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_maps.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_maps.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&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 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_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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.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_maps.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_maps.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_maps.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_maps.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_maps.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_maps.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_maps.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_maps.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_maps.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_maps.listeners.dca.layer', 'getIcons'],
|
||||
'eval' => [
|
||||
'columnFields' => [
|
||||
'amenity' => [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenity'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'select',
|
||||
'options_callback' => ['netzmacht.contao_leaflet_maps.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_maps.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',
|
||||
],
|
||||
],
|
||||
];
|
||||
533
src/Bundle/Resources/contao/dca/tl_leaflet_map.php
Normal file
533
src/Bundle/Resources/contao/dca/tl_leaflet_map.php
Normal file
@@ -0,0 +1,533 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.listeners.dca.leaflet', 'loadLanguageFile'],
|
||||
],
|
||||
'onsubmit_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.listeners.dca.validator', 'validateCoordinates'],
|
||||
],
|
||||
'wizard' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.listeners.dca.map', 'loadLayerRelations'],
|
||||
],
|
||||
'save_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.listeners.dca.map', 'saveLayerRelations'],
|
||||
],
|
||||
'eval' => [
|
||||
'multiple' => true,
|
||||
'doNotSaveEmpty' => true,
|
||||
'columnFields' => [
|
||||
'reference' => [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['reference'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'select',
|
||||
'options_callback' => ['netzmacht.contao_leaflet_maps.listeners.dca.map', 'getLayers'],
|
||||
'eval' => [
|
||||
'mandatory' => false,
|
||||
'tl_class' => 'w50',
|
||||
'chosen' => true,
|
||||
'includeBlankOption' => true,
|
||||
'style' => 'width: 300px',
|
||||
],
|
||||
'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_maps.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_maps.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_maps.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_maps.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'",
|
||||
],
|
||||
],
|
||||
];
|
||||
41
src/Bundle/Resources/contao/dca/tl_leaflet_map_layer.php
Normal file
41
src/Bundle/Resources/contao/dca/tl_leaflet_map_layer.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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'",
|
||||
],
|
||||
],
|
||||
];
|
||||
342
src/Bundle/Resources/contao/dca/tl_leaflet_marker.php
Normal file
342
src/Bundle/Resources/contao/dca/tl_leaflet_marker.php
Normal file
@@ -0,0 +1,342 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.listeners.dca.marker', 'initialize'],
|
||||
],
|
||||
'onsubmit_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.listeners.dca.validator', 'validateCoordinates'],
|
||||
['netzmacht.contao_leaflet_maps.listeners.dca.marker', 'saveCoordinates'],
|
||||
],
|
||||
'load_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.listeners.dca.marker', 'loadCoordinates'],
|
||||
],
|
||||
'wizard' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.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_maps.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_maps.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',
|
||||
],
|
||||
],
|
||||
];
|
||||
276
src/Bundle/Resources/contao/dca/tl_leaflet_popup.php
Normal file
276
src/Bundle/Resources/contao/dca/tl_leaflet_popup.php
Normal file
@@ -0,0 +1,276 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.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_maps.listeners.dca.leaflet', 'clearCache'],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
284
src/Bundle/Resources/contao/dca/tl_leaflet_style.php
Normal file
284
src/Bundle/Resources/contao/dca/tl_leaflet_style.php
Normal file
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.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_maps.listeners.dca.leaflet', 'clearCache'],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
381
src/Bundle/Resources/contao/dca/tl_leaflet_vector.php
Normal file
381
src/Bundle/Resources/contao/dca/tl_leaflet_vector.php
Normal file
@@ -0,0 +1,381 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.listeners.dca.leaflet', 'loadLanguageFile'],
|
||||
],
|
||||
'onsubmit_callback' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.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&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_maps.listeners.dca.validator', 'validateAlias'],
|
||||
],
|
||||
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
|
||||
'toolkit' => [
|
||||
'alias_generator' => [
|
||||
'factory' => 'netzmacht.contao_leaflet_maps.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_maps.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_maps.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\Listener\Dca\MarkerDcaListener', '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_maps.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_maps.listeners.dca.validator', 'validateCoordinates'],
|
||||
],
|
||||
'wizard' => [
|
||||
['netzmacht.contao_leaflet_maps.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_maps.listeners.dca.validator', 'validateMultipleCoordinates'],
|
||||
],
|
||||
'sql' => 'longblob NULL',
|
||||
],
|
||||
'multiData' => [
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['multiData'],
|
||||
'inputType' => 'multiColumnWizard',
|
||||
'search' => false,
|
||||
'eval' => [
|
||||
'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_maps.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',
|
||||
],
|
||||
],
|
||||
];
|
||||
85
src/Bundle/Resources/contao/dca/tl_module.php
Normal file
85
src/Bundle/Resources/contao/dca/tl_module.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Leaflet maps for Contao CMS.
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2016-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_maps.listeners.dca.frontend_integration', 'getMaps'],
|
||||
'wizard' => [
|
||||
['netzmacht.contao_leaflet_maps.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 ''",
|
||||
];
|
||||
Reference in New Issue
Block a user