Files
contao-leaflet-maps/src/Bundle/Resources/contao/dca/tl_leaflet_popup.php

284 lines
11 KiB
PHP
Raw Normal View History

2015-01-27 17:14:58 +01:00
<?php
/**
2017-10-05 15:45:43 +02:00
* Leaflet maps for Contao CMS.
*
2016-10-11 10:40:15 +02:00
* @package contao-leaflet-maps
2015-01-27 17:14:58 +01:00
* @author David Molineus <david.molineus@netzmacht.de>
2017-10-11 15:00:48 +02:00
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
2017-10-05 15:45:43 +02:00
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
2015-01-27 17:14:58 +01:00
* @filesource
*/
2017-10-09 16:54:32 +02:00
$GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
'config' => [
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => [
'keys' => [
2015-01-27 17:14:58 +01:00
'id' => 'primary',
'alias' => 'unique',
2017-10-09 16:54:32 +02:00
],
],
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
2017-10-09 16:54:32 +02:00
],
2015-01-27 17:14:58 +01:00
2017-10-09 16:54:32 +02:00
'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' => [
2015-01-27 17:14:58 +01:00
'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',
2017-10-09 16:54:32 +02:00
'handleButtonCallback',
],
2017-10-09 16:54:32 +02:00
'toolkit' => [
'state_button' => [
2017-10-10 16:07:16 +02:00
'stateColumn' => 'active',
2017-10-09 16:54:32 +02:00
],
],
2017-10-09 16:54:32 +02:00
],
'show' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
],
],
],
2015-01-27 17:14:58 +01:00
2017-10-09 16:54:32 +02:00
'palettes' => [
'__selector__' => ['type'],
],
2015-01-27 17:14:58 +01:00
2017-10-09 16:54:32 +02:00
'metapalettes' => [
'default' => [
'title' => ['title', 'alias'],
'size' => ['maxWidth', 'minWidth', 'maxHeight'],
'config' => [
2015-01-27 17:14:58 +01:00
':hide',
'closeButton',
'keepInView',
'closeOnClick',
'zoomAnimation',
'offset',
'className',
2017-10-09 16:54:32 +02:00
'autoPan',
],
'active' => ['active'],
],
],
2015-01-27 17:14:58 +01:00
2017-10-09 16:54:32 +02:00
'metasubpalettes' => [
'autoPan' => ['autoPanPadding'],
],
2015-01-27 17:14:58 +01:00
2017-10-09 16:54:32 +02:00
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'title' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['title'],
'exclude' => true,
'inputType' => 'text',
2017-10-09 16:54:32 +02:00
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'alias' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['alias'],
'exclude' => true,
'inputType' => 'text',
2017-10-09 16:54:32 +02:00
'save_callback' => [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
2017-10-09 16:54:32 +02:00
],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
2017-10-09 16:54:32 +02:00
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
2017-10-09 16:54:32 +02:00
'fields' => ['title'],
],
],
2017-10-09 16:54:32 +02:00
'sql' => 'varchar(255) NULL',
],
'maxWidth' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['maxWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
2017-10-09 16:54:32 +02:00
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => 'int(4) NULL',
],
'minWidth' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['minWidth'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
2017-10-09 16:54:32 +02:00
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => 'int(4) NULL',
],
'maxHeight' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['maxHeight'],
'exclude' => true,
'inputType' => 'text',
'default' => null,
2017-10-09 16:54:32 +02:00
'eval' => ['mandatory' => false, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => 'int(4) NULL',
],
'autoPan' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['autoPan'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
2017-10-09 16:54:32 +02:00
'eval' => ['tl_class' => 'w50 m12', 'submitOnChange' => true],
'sql' => "char(1) NOT NULL default '1'",
],
'keepInView' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
2017-10-09 16:54:32 +02:00
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default ''",
],
'closeButton' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['closeButton'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
2017-10-09 16:54:32 +02:00
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default '1'",
],
'offset' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['offset'],
'exclude' => true,
'inputType' => 'text',
2017-10-09 16:54:32 +02:00
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateCoordinates'],
2017-10-09 16:54:32 +02:00
],
'eval' => [
2015-01-27 17:14:58 +01:00
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
2017-10-09 16:54:32 +02:00
],
'sql' => 'varchar(255) NULL',
],
'autoPanPadding' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['autoPanPadding'],
'exclude' => true,
'inputType' => 'text',
'eval' => [
2015-01-27 17:14:58 +01:00
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
'multiple' => true,
'size' => 2,
2017-10-09 16:54:32 +02:00
],
'sql' => 'varchar(255) NULL',
],
'zoomAnimation' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['zoomAnimation'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
2017-10-09 16:54:32 +02:00
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default '1'",
],
'closeOnClick' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['closeOnClick'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
2017-10-09 16:54:32 +02:00
'eval' => ['tl_class' => 'w50', 'submitOnChange' => false],
'sql' => "char(1) NOT NULL default '1'",
],
'className' => [
2015-01-27 17:14:58 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['className'],
'exclude' => true,
'inputType' => 'text',
2017-10-09 16:54:32 +02:00
'eval' => ['mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
],
'active' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_popup']['active'],
'exclude' => true,
'inputType' => 'checkbox',
'filter' => true,
'sorting' => true,
'search' => false,
'flag' => 12,
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
'save_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
2017-10-09 16:54:32 +02:00
],
],
];