Files
contao-leaflet-maps/src/Bundle/Resources/contao/dca/tl_content.php
2017-10-12 10:59:17 +02:00

86 lines
3.1 KiB
PHP

<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-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'],
'templates' => [':hide', 'customTpl', 'leaflet_template'],
'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.listeners.dca.frontend_integration', 'getMaps'],
'wizard' => [
['netzmacht.contao_leaflet.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 ''",
];