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

86 lines
3.0 KiB
PHP
Raw Normal View History

2014-12-29 12:17:40 +01:00
<?php
2015-01-12 19:03:29 +01:00
/**
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-12 19:03:29 +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-12 19:03:29 +01:00
* @filesource
*/
2017-10-09 16:54:32 +02:00
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [
'type' => ['type', 'headline'],
2017-10-12 10:59:17 +02:00
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'],
'templates' => [':hide', 'customTpl', 'leaflet_template'],
2017-10-09 16:54:32 +02:00
'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'],
];
2014-12-29 12:17:40 +01:00
2017-10-09 16:54:32 +02:00
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_map'] = [
2014-12-29 12:17:40 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_map'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.frontend_integration', 'getMaps'],
2017-10-09 16:54:32 +02:00
'wizard' => [
['netzmacht.contao_leaflet.listeners.dca.frontend_integration', 'getEditMapLink'],
2017-10-09 16:54:32 +02:00
],
'eval' => [
'tl_class' => 'w50 wizard',
2014-12-29 12:17:40 +01:00
'chosen' => true,
2017-10-09 16:54:32 +02:00
],
'sql' => "int(10) unsigned NOT NULL default '0'",
];
2017-10-09 16:54:32 +02:00
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_mapId'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_mapId'],
'inputType' => 'text',
'exclude' => true,
'eval' => [
2015-01-30 17:44:24 +01:00
'tl_class' => 'w50',
'chosen' => true,
'maxlength' => 16,
2017-10-09 16:54:32 +02:00
],
'sql' => "varchar(16) NOT NULL default ''",
];
2015-01-30 17:44:24 +01:00
2017-10-09 16:54:32 +02:00
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_width'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_width'],
'inputType' => 'inputUnit',
'options' => $GLOBALS['TL_CSS_UNITS'],
'search' => false,
'exclude' => true,
2017-10-09 16:54:32 +02:00
'eval' => ['rgxp' => 'digit', 'tl_class' => 'clr w50'],
'sql' => "varchar(64) NOT NULL default ''",
];
2017-10-09 16:54:32 +02:00
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_height'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_height'],
'inputType' => 'inputUnit',
'options' => $GLOBALS['TL_CSS_UNITS'],
'search' => false,
'exclude' => true,
2017-10-09 16:54:32 +02:00
'eval' => ['rgxp' => 'digit', 'tl_class' => 'w50'],
'sql' => "varchar(64) NOT NULL default ''",
];
2015-01-30 17:44:24 +01:00
2017-10-09 16:54:32 +02:00
$GLOBALS['TL_DCA']['tl_content']['fields']['leaflet_template'] = [
2015-01-30 17:44:24 +01:00
'label' => &$GLOBALS['TL_LANG']['tl_content']['leaflet_template'],
'inputType' => 'select',
'exclude' => true,
'options_callback' => ['netzmacht.contao_toolkit.dca.listeners.template_options', 'handleOptionsCallback'],
2017-10-09 16:54:32 +02:00
'eval' => [
2015-01-30 17:44:24 +01:00
'tl_class' => 'w50',
'chosen' => true,
2017-10-09 16:54:32 +02:00
],
'toolkit' => [
'template_options' => [
2017-10-09 16:54:32 +02:00
'prefix' => 'leaflet_map_js',
],
],
2017-10-09 16:54:32 +02:00
'sql' => "varchar(64) NOT NULL default ''",
];