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

280 lines
10 KiB
PHP
Raw Normal View History

2015-01-06 14:55:53 +01:00
<?php
2015-01-08 12:27:08 +01:00
\Controller::loadLanguageFile('leaflet');
2015-01-06 14:55:53 +01:00
$GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
(
'config' => array(
'dataContainer' => 'Table',
'enableVersioning' => true,
'ptable' => 'tl_leaflet_layer',
'sql' => array
(
'keys' => array
(
2015-01-09 17:40:50 +01:00
'id' => 'primary',
'pid' => 'index',
'alias' => 'unique',
2015-01-06 14:55:53 +01:00
)
2015-01-08 12:27:08 +01:00
),
2015-01-06 14:55:53 +01:00
),
'list' => array
(
'sorting' => array
(
'mode' => 4,
2015-01-08 15:29:07 +01:00
'fields' => array('sorting'),
2015-01-06 14:55:53 +01:00
'flag' => 1,
2015-01-08 16:27:55 +01:00
'panelLayout' => 'sort,filter;search,limit',
2015-01-06 14:55:53 +01:00
'headerFields' => array('title', 'type'),
'child_record_callback' => array('Netzmacht\Contao\Leaflet\Dca\Marker', 'generateRow'),
),
'label' => array
(
'fields' => array('title'),
'format' => '%s',
),
'global_operations' => array
(
2015-01-08 15:21:45 +01:00
'icons' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icons'],
'href' => 'table=tl_leaflet_icon&id=',
'icon' => 'system/modules/leaflet/assets/img/icons.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
2015-01-06 14:55:53 +01:00
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
),
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'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' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\DevTools\Dca::createToggleIconCallback(
'tl_leaflet_marker',
'active'
)
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias', 'coordinates'),
'content' => array('tooltip', 'alt', 'addPopup'),
'config' => array(
':hide',
'clickable',
'draggable',
'keyboard',
'zIndexOffset',
'opacity',
'riseOnHover',
2015-01-06 21:30:57 +01:00
'riseOffset',
'customIcon',
2015-01-06 14:55:53 +01:00
),
'active' => array('active')
),
),
'metasubpalettes' => array(
'addPopup' => array('popupContent'),
2015-01-06 21:30:57 +01:00
'customIcon' => array('icon')
2015-01-06 14:55:53 +01:00
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
2015-01-08 15:29:07 +01:00
'sorting' => array
(
2015-01-08 16:27:55 +01:00
'sql' => "int(10) unsigned NOT NULL default '0'",
'sorting' => true,
2015-01-08 15:29:07 +01:00
),
2015-01-06 14:55:53 +01:00
'pid' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['title'],
'exclude' => true,
2015-01-08 16:27:55 +01:00
'search' => true,
'sorting' => true,
'flag' => 1,
2015-01-06 14:55:53 +01:00
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['alias'],
'exclude' => true,
'inputType' => 'text',
2015-01-08 16:27:55 +01:00
'search' => true,
2015-01-09 17:40:50 +01:00
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true),
2015-01-06 14:55:53 +01:00
'sql' => "varchar(255) NOT NULL default ''"
),
'coordinates' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['coordinates'],
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'validateCoordinate')
),
'wizard' => array(
array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'getGeocoder')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['active'],
'exclude' => true,
2015-01-08 16:27:55 +01:00
'filter' => true,
'sorting' => true,
'flag' => 12,
2015-01-06 14:55:53 +01:00
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'tooltip' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['tooltip'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alt' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['alt'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'addPopup' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['addPopup'],
'exclude' => true,
'inputType' => 'checkbox',
2015-01-08 16:27:55 +01:00
'filter' => true,
2015-01-06 14:55:53 +01:00
'eval' => array('tl_class' => 'w50', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'popupContent' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['popupContent'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => true, 'rte' => 'tinyMCE', 'helpwizard' => true, 'tl_class' => 'clr'),
'explanation' => 'insertTags',
'sql' => "mediumtext NULL"
),
'customIcon' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['customIcon'],
'exclude' => true,
'inputType' => 'checkbox',
2015-01-06 21:30:57 +01:00
'eval' => array('tl_class' => 'clr w50 m12', 'submitOnChange' => true),
2015-01-06 14:55:53 +01:00
'sql' => "char(1) NOT NULL default ''"
),
'icon' => array
(
2015-01-08 12:27:08 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['icon'],
2015-01-06 14:55:53 +01:00
'exclude' => true,
2015-01-06 21:30:57 +01:00
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\Marker', 'getIcons'),
2015-01-06 14:55:53 +01:00
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
2015-01-06 21:52:36 +01:00
'chosen' => true,
2015-01-06 14:55:53 +01:00
),
2015-01-06 21:30:57 +01:00
'sql' => "int(10) unsigned NOT NULL default '0'",
2015-01-06 14:55:53 +01:00
),
'draggable' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['draggable'],
'exclude' => true,
'inputType' => 'checkbox',
2015-01-08 12:27:08 +01:00
'default' => false,
2015-01-06 14:55:53 +01:00
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'clickable' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['clickable'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'keyboard' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['keyboard'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'zIndexOffset' => array
(
2015-01-08 12:27:08 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['zIndexOffset'],
2015-01-06 14:55:53 +01:00
'exclude' => true,
'inputType' => 'text',
'default' => 0,
2015-01-08 12:27:08 +01:00
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'clr w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
2015-01-06 14:55:53 +01:00
),
),
);