vendor/con4gis/maps/Resources/contao/dca/tl_c4g_maps.php line 23

Open in your IDE?
  1. <?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
  2. /**
  3.  * con4gis - the gis-kit
  4.  *
  5.  * @version   php 7
  6.  * @package   con4gis
  7.  * @author    con4gis contributors (see "authors.txt")
  8.  * @license   GNU/LGPL http://opensource.org/licenses/lgpl-3.0.html
  9.  * @copyright Küstenschmiede GmbH Software & Design 2011 - 2018
  10.  * @link      https://www.kuestenschmiede.de
  11.  */
  12. /**
  13.  * Table tl_c4g_maps
  14.  */
  15. $GLOBALS['TL_DCA']['tl_c4g_maps'] = array
  16. (
  17.     // Config
  18.     'config' => array
  19.     (
  20.         'label'                       => $GLOBALS['TL_LANG']['MOD']['c4g_maps'][0],
  21.         'dataContainer'               => 'Table',
  22.         'enableVersioning'            => true,
  23.         'onload_callback'             => array(
  24.             array('tl_c4g_maps''updateDCA')),
  25.         'onsubmit_callback'             => array(
  26.             array('\con4gis\CoreBundle\Resources\contao\classes\C4GAutomator''purgeApiCache')
  27.         ),
  28.         'sql'                         => array
  29.         (
  30.             'keys' => array
  31.             (
  32.                 'id' => 'primary',
  33.                 'pid' => 'index'
  34.             )
  35.         )
  36.     ),
  37.     // List
  38.     'list' => array
  39.     (
  40.         'sorting' => array
  41.         (
  42.             'mode'                    => 5,
  43.             'icon'                    => 'bundels/con4gisMapsBundle/images/core.png',
  44.             'fields'                  => array('name'),
  45.             'flag'                    => 1
  46.         ),
  47.         'label' => array
  48.         (
  49.             'fields'                  => array('name'),
  50.             'format'                  => '%s',
  51.             'label_callback'          => array('tl_c4g_maps','generateLabel')
  52.         ),
  53.         'global_operations' => array
  54.         (
  55. //            'update_db' => array
  56. //            (
  57. //                'label'               => &$GLOBALS['TL_LANG']['c4g_maps']['update_db'],
  58. //                'href'                => 'key=update_db',
  59. //                'class'               => 'navigation',
  60. //                'attributes'          => 'onclick="Backend.getScrollOffset();" accesskey="i"'
  61. //            ),
  62.             'all' => array
  63.             (
  64.                 'label'               => &$GLOBALS['TL_LANG']['MSC']['all'],
  65.                 'href'                => 'act=select',
  66.                 'class'               => 'header_edit_all',
  67.                 'attributes'          => 'onclick="Backend.getScrollOffset();" accesskey="e"'
  68.             )
  69.         ),
  70.         'operations' => array
  71.         (
  72.             'edit' => array
  73.             (
  74.                 'label'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['edit'],
  75.                 'href'                => 'act=edit',
  76.                 'icon'                => 'edit.gif'
  77.             ),
  78.             'copy' => array
  79.             (
  80.                 'label'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['copy'],
  81.                 'href'                => 'act=copy',
  82.                 'icon'                => 'copy.gif'
  83.             ),
  84.             'copyChilds' => array
  85.             (
  86.                 'label'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['copyChilds'],
  87.                 'href'                => 'act=paste&amp;mode=copy&amp;childs=1',
  88.                 'icon'                => 'copychilds.gif',
  89.                 'attributes'          => 'onclick="Backend.getScrollOffset();"',
  90.                 'button_callback'     => array('tl_c4g_maps''copyPageWithSubpages')
  91.             ),
  92.             'cut' => array
  93.             (
  94.                 'label'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cut'],
  95.                 'href'                => 'act=paste&amp;mode=cut',
  96.                 'icon'                => 'cut.gif',
  97.                 'attributes'          => 'onclick="Backend.getScrollOffset();"'
  98.             ),
  99.             'delete' => array
  100.             (
  101.                 'label'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['delete'],
  102.                 'href'                => 'act=delete',
  103.                 'icon'                => 'delete.gif',
  104.                 'attributes'          => 'onclick="if (!confirm(\'' $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'
  105.             ),
  106.             'toggle' => array
  107.             (
  108.                 'label'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['toggle'],
  109.                 'icon'                => 'visible.gif',
  110.                 'attributes'          => 'onclick="Backend.getScrollOffset(); return AjaxRequest.toggleVisibility(this, %s);"',
  111.                 'button_callback'     => array('tl_c4g_maps''toggleIcon')
  112.             ),
  113.             'show' => array
  114.             (
  115.                 'label'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['show'],
  116.                 'href'                => 'act=show',
  117.                 'icon'                => 'show.gif'
  118.             )
  119.         )
  120.     ),
  121.     // Palettes
  122.     'palettes' => array
  123.     (
  124.         '__selector__'                => array( 'is_map''profile','location_type''tab_source''show_locations''popup_extend''protect_element''use_specialprofile''cluster_locations'),
  125.         'default'                     => '{general_legend},name,profile,profile_mobile,published;'.
  126.                                          '{map_legend},is_map;'.
  127.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,cssClass,zoom_locations, hover_location,loc_minzoom,loc_maxzoom;'.
  128.                                          '{protection_legend:hide},protect_element;'.
  129.                                          '{expert_legend:hide},use_specialprofile;'.
  130.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  131.         'single'                      => '{general_legend},name,profile,profile_mobile,published;'.
  132.                                          '{map_legend},is_map;'.
  133.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,loc_geox,loc_geoy,locstyle,loc_only_in_parent,loc_label,tooltip, tooltip_length,enablePopup,showPopupOnActive,popup_info,routing_to,loc_linkurl,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,zoom_locations, hover_location,hide_when_in_tab,cssClass;'.
  134.                                          '{protection_legend:hide},protect_element;'.
  135.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  136.         'table'                      =>  '{general_legend},name,profile,profile_mobile,published;'.
  137.                                          '{map_legend},is_map;'.
  138.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,tab_source,tab_pid,tab_pid1,tab_labeldisplay,tab_tooltipdisplay,tab_directlink,tab_force_target_blank,tab_whereclause,tab_orderby,tab_filter_alias,locstyle,routing_to,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,cluster_locations,async_content,zoom_locations, hover_location,hide_when_in_tab,cssClass;'.
  139.                                          '{protection_legend:hide},protect_element;'.
  140.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  141.         'gpx'                        =>  '{general_legend},name,profile,profile_mobile,published;'.
  142.                                          '{map_legend},is_map;'.
  143.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,data_file,data_url,locstyle,loc_label,tooltip, tooltip_length,enablePopup,popup_info,popup_async,routing_to,loc_linkurl,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,zoom_locations, hover_location,hide_when_in_tab,cssClass;'.
  144.                                          '{protection_legend:hide},protect_element;'.
  145.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  146.         'kml'                        =>  '{general_legend},name,profile,profile_mobile,published;'.
  147.                                          '{map_legend},is_map;'.
  148.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,data_file,data_url,loc_label,tooltip, tooltip_length,enablePopup,popup_info,popup_async,routing_to,loc_linkurl,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,zoom_locations, hover_location,hide_when_in_tab,cssClass;'.
  149.                                          '{protection_legend:hide},protect_element;'.
  150.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  151.         'geojson'                    =>  '{general_legend},name,profile,profile_mobile,published;'.
  152.                                          '{map_legend},is_map;'.
  153.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,data_file,data_url,data_content,data_projection,locstyle,loc_label,tooltip, tooltip_length,enablePopup,popup_info,routing_to,loc_linkurl,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,zoom_locations, hover_location,hide_when_in_tab,cssClass;'.
  154.                                          '{protection_legend:hide},protect_element;'.
  155.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  156.         'osm'                        =>  '{general_legend},name,profile,profile_mobile,published;'.
  157.                                          '{map_legend},is_map;'.
  158.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,data_file,data_url,data_forcenodes,locstyle,loc_label,tooltip, tooltip_length,enablePopup,popupType,popup_info,routing_to,loc_linkurl,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,cluster_locations,zoom_locations, hover_location,hide_when_in_tab,cssClass;'.
  159.                                          '{protection_legend:hide},protect_element;'.
  160.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  161.         'overpass'                   =>  '{general_legend},name,profile,profile_mobile,published;'.
  162.                                          '{map_legend},is_map;'.
  163.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,ovp_request,ovp_bbox_limited,data_forcenodes,data_additionalgeometries,locstyle,loc_label,tooltip, tooltip_length,enablePopup,popupType,popup_info,routing_to,loc_linkurl,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,cluster_locations,zoom_locations, hover_location,hide_when_in_tab,cssClass;'.
  164.                                          '{protection_legend:hide},protect_element;'.
  165.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  166.         'link'                       =>  '{general_legend},name,profile,profile_mobile,published;'.
  167.                                          '{map_legend},is_map;'.
  168.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,link_id,hide_when_in_tab,cssClass;'.
  169.                                          '{protection_legend:hide},protect_element;'.
  170.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  171.         'c4gForum'                   =>  '{general_legend},name,profile,profile_mobile,published;'.
  172.                                          '{map_legend},is_map;'.
  173.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,forums,forum_jumpto,forum_reassign_layer,loc_label,tooltip, tooltip_length,enablePopup,popup_info,routing_to,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,hide_when_in_tab,cssClass;'.
  174.                                          '{protection_legend:hide},protect_element;'.
  175.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  176.         'startab'                    =>  '{general_legend},name,profile,profile_mobile,published;' .
  177.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,awesomeicon;'.
  178.                                          '{protection_legend:hide},protect_element;'.
  179.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  180.         'folder'                     =>  '{general_legend},name,profile,profile_mobile,published;'.
  181.                                          '{map_legend},is_map;'.
  182.                                          '{location_legend},location_type,data_layername,hide_child,data_hidelayer,data_folder,locstyle,loc_label,tooltip, tooltip_length,enablePopup,popup_info,routing_to,loc_linkurl,loc_onclick_zoomto,loc_minzoom,loc_maxzoom,hide_when_in_tab,cssClass;'.
  183.                                          '{protection_legend:hide},protect_element;'.
  184.                                          '{backend_legend:hide},be_optimize_checkboxes_limit;',
  185.     ),
  186.     // Subpalettes
  187.     'subpalettes' => array
  188.     (
  189.         'use_specialprofile'          => 'specialprofile, specialprofile_mobile, specialprofile_groups',
  190.         //'enablePopup'                 => 'popup_info,routing_to',
  191.         'protect_element'             => 'permitted_groups',
  192.         'popup_extend'                => 'forums',
  193.         'is_map'                      => '',  // is set in updateDCA
  194.         'cluster_locations'           => 'cluster_distance, cluster_fillcolor, cluster_fontcolor, cluster_zoom,cluster_popup'
  195.     ),
  196.     // Fields
  197.     'fields' => array
  198.     (
  199.         'id' => array
  200.         (
  201.             'sql'                     => "int(10) unsigned NOT NULL auto_increment"
  202.         ),
  203.         'pid' => array
  204.         (
  205.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  206.         ),
  207.         'sorting' => array
  208.         (
  209.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  210.         ),
  211.         'tstamp' => array
  212.         (
  213.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  214.         ),
  215.         'name' => array
  216.         (
  217.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['name'],
  218.             'exclude'                 => true,
  219.             'inputType'               => 'c4g_text',
  220.             'eval'                    => array('mandatory'=>true'maxlength'=>255 ),
  221.             'sql'                     => "varchar(100) NOT NULL default ''"
  222.         ),
  223.         'profile' => array
  224.         (
  225.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['profile'],
  226.             'exclude'                 => true,
  227.             'inputType'               => 'select',
  228.             'foreignKey'              => 'tl_c4g_map_profiles.name',
  229.             'eval'                    => array('tl_class'=>'w50',
  230.                                                'includeBlankOption'=>true'blankOptionLabel'=>&$GLOBALS['TL_LANG']['tl_c4g_maps']['default_profile'],
  231.                                                'submitOnChange' => true'alwaysSave' => true ),
  232.             'load_callback'           => array(array('tl_c4g_maps','getDefaultProfile')),
  233.             'relation'                => array('type'=>'belongsTo''load'=>'eager'),
  234.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  235.         ),
  236.         'profile_mobile' => array
  237.         (
  238.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['profile_mobile'],
  239.             'exclude'                 => true,
  240.             'inputType'               => 'select',
  241.             'foreignKey'              => 'tl_c4g_map_profiles.name',
  242.             'eval'                    => array('tl_class'=>'w50',
  243.                                                'includeBlankOption'=>true
  244.                                               ),
  245.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  246.         ),
  247.         'published' => array
  248.         (
  249.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['published'],
  250.             'exclude'                 => true,
  251.             'default'                 => true,
  252.             'inputType'               => 'checkbox',
  253.             'eval'                    => array('tl_class'=>'clr'),
  254.             'sql'                     => "char(1) NOT NULL default '1'"
  255.         ),
  256.         'is_map' => array
  257.         (
  258.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['is_map'],
  259.             'exclude'                 => true,
  260.             'default'                 => '',
  261.             'inputType'               => 'checkbox',
  262.             'eval'                    => array('submitOnChange' => true),
  263.             'sql'                     => "char(1) NOT NULL default ''"
  264.         ),
  265.         'width' => array
  266.         (
  267.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['width'],
  268.             'exclude'                 => true,
  269.             'inputType'               => 'inputUnit',
  270.             'options'                 => array('px''%''em''vh''vw''vmin''vmax''pt''pc''in''cm''mm'),
  271.             'eval'                    => array(
  272.                                             'rgxp'=>'digit_auto_inherit',
  273.                                             'tl_class'=>'long',
  274.                                             'includeBlankOption'=>true
  275.                                         ),
  276.             'sql'                     => "varchar(64) NOT NULL default ''"
  277.         ),
  278.         'height' => array
  279.         (
  280.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['height'],
  281.             'exclude'                 => true,
  282.             'inputType'               => 'inputUnit',
  283.             'options'                 => array('px''%''em''vh''vw''vmin''vmax''pt''pc''in''cm''mm'),
  284.             'eval'                    => array(
  285.                                             'rgxp'=>'digit_auto_inherit',
  286.                                             'tl_class'=>'long',
  287.                                             'includeBlankOption'=>true
  288.                                         ),
  289.             'sql'                     => "varchar(64) NOT NULL default ''"
  290.         ),
  291.         'margin' => array
  292.         (
  293.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['margin'],
  294.             'exclude'                 => true,
  295.             'inputType'               => 'trbl',
  296.             'options'                 => array('px''%''em''vh''vw''vmin''vmax''pt''pc''in''cm''mm'),
  297.             'eval'                    => array(
  298.                                             'rgxp'=>'digit_auto_inherit',
  299.                                             'includeBlankOption'=>true
  300.                                         ),
  301.             'sql'                     => "varchar(128) NOT NULL default ''"
  302.         ),
  303.         // 'auto_width' => array
  304.         // (
  305.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_width'],
  306.         //  'exclude'                 => true,
  307.         //  'default'                 => '',
  308.         //  'inputType'               => 'checkbox',
  309.         //  'eval'                    => array('submitOnChange' => true, 'tl_class'=>'w50' )
  310.         // ),
  311.         // 'auto_width_min' => array
  312.         // (
  313.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_width_min'],
  314.         //  'exclude'                 => true,
  315.         //  'inputType'               => 'c4g_text',
  316.         //     'default'                 => '0',
  317.         //  'eval'                    => array('rgxp'=>'digit', 'tl_class'=>'w50')
  318.         // ),
  319.         // 'auto_width_max' => array
  320.         // (
  321.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_width_max'],
  322.         //  'exclude'                 => true,
  323.         //  'inputType'               => 'c4g_text',
  324.         //     'default'                 => '0',
  325.         //  'eval'                    => array('rgxp'=>'digit', 'tl_class'=>'w50')
  326.         // ),
  327.         // 'auto_width_gap' => array
  328.         // (
  329.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_width_gap'],
  330.         //  'exclude'                 => true,
  331.         //  'inputType'               => 'c4g_text',
  332.         //     'default'                 => '0',
  333.         //  'eval'                    => array('rgxp'=>'digit', 'tl_class'=>'w50')
  334.         // ),
  335.         // 'auto_height' => array
  336.         // (
  337.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_height'],
  338.         //  'exclude'                 => true,
  339.         //  'default'                 => '',
  340.         //  'inputType'               => 'checkbox',
  341.         //  'eval'                    => array('submitOnChange' => true, 'tl_class'=>'w50' )
  342.         // ),
  343.         // 'auto_height_min' => array
  344.         // (
  345.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_height_min'],
  346.         //  'exclude'                 => true,
  347.         //  'inputType'               => 'c4g_text',
  348.         //     'default'                 => '0',
  349.         //  'eval'                    => array('rgxp'=>'digit', 'tl_class'=>'w50')
  350.         // ),
  351.         // 'auto_height_max' => array
  352.         // (
  353.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_height_max'],
  354.         //  'exclude'                 => true,
  355.         //  'inputType'               => 'c4g_text',
  356.         //     'default'                 => '0',
  357.         //  'eval'                    => array('rgxp'=>'digit', 'tl_class'=>'w50')
  358.         // ),
  359.         // 'auto_height_gap' => array
  360.         // (
  361.         //  'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['auto_height_gap'],
  362.         //  'exclude'                 => true,
  363.         //  'inputType'               => 'c4g_text',
  364.         //     'default'                 => '0',
  365.         //  'eval'                    => array('rgxp'=>'digit', 'tl_class'=>'w50')
  366.         // ),
  367.         'calc_extent' => array
  368.         (
  369.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['calc_extent'],
  370.             'exclude'                 => true,
  371.             'inputType'               => 'select',
  372.             'options'                 => array('LOCATIONS','CENTERZOOM'),
  373.             #'default'                 => 'LOCATIONS',
  374.             'reference'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['references'],
  375.             #'eval'                    => array('submitOnChange'=>true,'tl_class'=>'clr'),
  376.             'load_callback'           => array(array('tl_c4g_maps','setOldValue')),
  377.             'sql'                     => "varchar(10) NOT NULL default ''"
  378.         ),
  379.         'show_locations' => array
  380.         (
  381.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['show_locations'],
  382.             'exclude'                 => true,
  383.             'inputType'               => 'checkbox',
  384.             'default'                 => '0',
  385.             'eval'                    => array('submitOnChange'=>true,'tl_class'=>'clr'),
  386.             'load_callback'           => array(array('tl_c4g_maps','getOldValue')),
  387.             'sql'                     => "char(1) NOT NULL default '2'"
  388.         ),
  389.         'min_gap' => array
  390.         (
  391.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['min_gap'],
  392.             'exclude'                 => true,
  393.             'inputType'               => 'c4g_text',
  394.             'default'                 => '0',
  395.             'eval'                    => array('rgxp'=>'digit''tl_class'=>'clr'),
  396.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  397.         ),
  398.         'awesomeicon' => array
  399.         (
  400.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['awesomeicon'],
  401.             'exclude'                 => true,
  402.             'inputType'               => 'c4g_text',
  403.             'eval'                    => array('maxlength'=>20'tl_class'=>'clr'),
  404.             'sql'                     => "varchar(20) NOT NULL default ''"
  405.         ),
  406.         'center_geox' => array
  407.         (
  408.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['center_geox'],
  409.             'exclude'                 => true,
  410.             'inputType'               => 'c4g_text',
  411.             'eval'                    => array('maxlength'=>20'tl_class'=>'w50 wizard''require_input'=>true ),
  412.             'save_callback'           => array(array('tl_c4g_maps','setCenterLon')),
  413.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  414.             'sql'                     => "varchar(20) NOT NULL default ''"
  415.         ),
  416.         'center_geoy' => array
  417.         (
  418.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['center_geoy'],
  419.             'exclude'                 => true,
  420.             'inputType'               => 'c4g_text',
  421.             'eval'                    => array('maxlength'=>20'tl_class'=>'w50 wizard''require_input'=>true),
  422.             'save_callback'           => array(array('tl_c4g_maps','setCenterLat')),
  423.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  424.             'sql'                     => "varchar(20) NOT NULL default ''"
  425.         ),
  426.         'zoom' => array
  427.         (
  428.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['zoom'],
  429.             'exclude'                 => true,
  430.             'inputType'               => 'c4g_text',
  431.             'default'                 => '10',
  432.             'eval'                    => array('tl_class'=>'clr'),
  433.             'sql'                     => "varchar(20) NOT NULL default '10'"
  434.         ),
  435.         'geolocation' => array
  436.         (
  437.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['geolocation'],
  438.             'exclude'                 => true,
  439.             'default'                 => false,
  440.             'inputType'               => 'checkbox',
  441.             'eval'                    => array('submitOnChange' => true),
  442.             'sql'                     => "char(1) NOT NULL default ''"
  443.         ),
  444.         'geolocation_zoom' => array
  445.         (
  446.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['geolocation_zoom'],
  447.             'exclude'                 => true,
  448.             'inputType'               => 'c4g_text',
  449.             'default'                 => '16',
  450.             'eval'                    => array('rgxp'=>'digit''tl_class'=>'clr'),
  451.             'sql'                     => "int(10) unsigned NOT NULL default '16'"
  452.         ),
  453.         'hide_when_in_tab' => array
  454.         (
  455.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['hide_when_in_tab'],
  456.             'exclude'                 => true,
  457.             'default'                 => false,
  458.             'inputType'               => 'checkbox',
  459.             'sql'                     => "char(1) NOT NULL default ''"
  460.         ),
  461.         'restrict_area' => array
  462.         (
  463.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['restrict_area'],
  464.             'exclude'                 => true,
  465.             'default'                 => false,
  466.             'inputType'               => 'checkbox',
  467.             'eval'                    => array('submitOnChange' => true),
  468.             'sql'                     => "char(1) NOT NULL default ''"
  469.         ),
  470.         'restr_bottomleft_geox' => array
  471.         (
  472.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['restr_bottomleft_geox'],
  473.             'exclude'                 => true,
  474.             'inputType'               => 'c4g_text',
  475.             'eval'                    => array('maxlength'=>20'tl_class'=>'w50 wizard''require_input'=>true ),
  476.             'save_callback'           => array(array('tl_c4g_maps','setRestrLon')),
  477.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  478.             'sql'                     => "varchar(20) NOT NULL default ''"
  479.         ),
  480.         'restr_bottomleft_geoy' => array
  481.         (
  482.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['restr_bottomleft_geoy'],
  483.             'exclude'                 => true,
  484.             'inputType'               => 'c4g_text',
  485.             'eval'                    => array('maxlength'=>20'tl_class'=>'w50 wizard''require_input'=>true ),
  486.             'save_callback'           => array(array('tl_c4g_maps','setRestrLat')),
  487.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  488.             'sql'                     => "varchar(20) NOT NULL default ''"
  489.         ),
  490.         'restr_topright_geox' => array
  491.         (
  492.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['restr_topright_geox'],
  493.             'exclude'                 => true,
  494.             'inputType'               => 'c4g_text',
  495.             'eval'                    => array('maxlength'=>20'tl_class'=>'w50 wizard''require_input'=>true ),
  496.             'save_callback'           => array(array('tl_c4g_maps','setRestrLon')),
  497.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  498.             'sql'                     => "varchar(20) NOT NULL default ''"
  499.         ),
  500.         'restr_topright_geoy' => array
  501.         (
  502.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['restr_topright_geoy'],
  503.             'exclude'                 => true,
  504.             'inputType'               => 'c4g_text',
  505.             'eval'                    => array('maxlength'=>20'tl_class'=>'w50 wizard''require_input'=>true ),
  506.             'save_callback'           => array(array('tl_c4g_maps','setRestrLat')),
  507.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  508.             'sql'                     => "varchar(20) NOT NULL default ''"
  509.         ),
  510.         'include_sublocations' => array
  511.         (
  512.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['include_sublocations'],
  513.             'exclude'                 => true,
  514.             'default'                 => true,
  515.             'inputType'               => 'checkbox',
  516.             'sql'                     => "char(1) NOT NULL default '1'"
  517.         ),
  518.         'location_type' => array
  519.         (
  520.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['location_type'],
  521.             'exclude'                 => true,
  522.             'default'                 => 'none',
  523.             'inputType'               => 'radio',
  524.             'options_callback'        => array('tl_c4g_maps','getLocationTypes'),
  525.             'eval'                    => array('submitOnChange' => true),
  526.             'reference'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['references'],
  527.             'sql'                     => "char(10) NOT NULL default ''"
  528.         ),
  529.         'loc_geox' => array
  530.         (
  531.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_geox'],
  532.             'exclude'                 => true,
  533.             'inputType'               => 'c4g_text',
  534.             'eval'                    => array('mandatory'=>true'maxlength'=>20'tl_class'=>'w50 wizard' ),
  535.             'save_callback'           => array(array('tl_c4g_maps','setLocLon')),
  536.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  537.             'sql'                     => "varchar(20) NOT NULL default ''"
  538.         ),
  539.         'loc_geoy' => array
  540.         (
  541.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_geoy'],
  542.             'exclude'                 => true,
  543.             'inputType'               => 'c4g_text',
  544.             'eval'                    => array('mandatory'=>true'maxlength'=>20'tl_class'=>'w50 wizard'),
  545.             'save_callback'           => array(array('tl_c4g_maps','setLocLat')),
  546.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoPicker''getPickerLink')),
  547.             'sql'                     => "varchar(20) NOT NULL default ''"
  548.         ),
  549.         'locstyle' => array
  550.         (
  551.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['locstyle'],
  552.             'exclude'                 => true,
  553.             'inputType'               => 'select',
  554.             'options_callback'        => array('tl_c4g_maps','getLocStyles'),
  555.             'eval'                    => array('tl_class'=>'clr'),
  556.             'wizard' => array
  557.             (
  558.                 array('tl_c4g_maps''editLocationStyle')
  559.             ),
  560.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  561.         ),
  562.         'loc_only_in_parent' => array
  563.         (
  564.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_only_in_parent'],
  565.             'exclude'                 => true,
  566.             'default'                 => false,
  567.             'inputType'               => 'checkbox',
  568.             'sql'                     => "char(1) NOT NULL default ''"
  569.         ),
  570.         'loc_label' => array
  571.         (
  572.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_label'],
  573.             'exclude'                 => true,
  574.             'inputType'               => 'c4g_text',
  575.             'sql'                     => "varchar(100) NOT NULL default ''"
  576.         ),
  577.         'tooltip' => array
  578.         (
  579.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tooltip'],
  580.             'exclude'                 => true,
  581.             'inputType'               => 'c4g_text',
  582.             'eval'                    => array('tl_class'=>'long'),
  583.             'sql'                     => "varchar(100) NOT NULL default ''"
  584.         ),
  585.         'tooltip_length' => array
  586.         (
  587.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tooltip_length'],
  588.             'inputType'               => 'c4g_text',
  589.             'default'                 => '30',
  590.             'eval'                    => array('rgxp'=>'digit''tl_class'=>'clr'),
  591.             'sql'                     => "int(100) NOT NULL default '30'"
  592.         ),
  593.         'enablePopup' => array
  594.         (
  595.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['enablePopup'],
  596.             'exclude'                 => true,
  597.             'default'                 => true,
  598.             'inputType'               => 'checkbox',
  599.             'eval'                    => array('submitOnChange' => true),
  600.             'sql'                     => "char(1) NOT NULL default '1'"
  601.         ),
  602.         'popupType' => array
  603.         (
  604.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['popupType'],
  605.             'exclude'                 => true,
  606.             'default'                 => 'text',
  607.             'inputType'               => 'radio',
  608.             'options'                 => array('text','template','popup_info'),
  609.             'eval'                    => array('mandatory'=>true'submitOnChange' => true),
  610.             'reference'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['references']['popupType'],
  611.             'sql'                     => "char(10) NOT NULL default 'text'"
  612.         ),
  613.         'popupTemplate' => array
  614.         (
  615.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['popupTemplate'],
  616.             'exclude'                 => true,
  617.             'default'                 => 'popup_default',
  618.             'inputType'               => 'select',
  619.             'options_callback'        => array('tl_c4g_maps''getPopupTemplates'),
  620.             'eval'                    => array('mandatore'=>true'chosen'=>true),
  621.             'sql'                     => "varchar(64) NOT NULL default ''"
  622.         ),
  623.         'popup_info' => array
  624.         (
  625.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['popup_info'],
  626.             'exclude'                 => true,
  627.             'inputType'               => 'textarea',
  628.             'eval'                    => array('rte'=>'tinyMCE'),
  629.             'sql'                     => "text NULL"
  630.         ),
  631.         'popup_async' => array
  632.         (
  633.             //@Todo Asynchrone Abfrage (GPX,KML) reparieren und einblenden
  634.             #'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['popup_async'],
  635.             #'exclude'                 => true,
  636.             'default'                 => false,
  637.             #'inputType'               => 'checkbox',
  638.             'sql'                     => "char(1) NOT NULL default ''"
  639.         ),
  640.         'popup_extend' => array
  641.         (
  642.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['popup_extend'],
  643.             'exclude'                 => true,
  644.             'default'                 => false,
  645.             'inputType'               => 'checkbox',
  646.             'eval'                    => array('submitOnChange' => true),
  647.             'sql'                     => "char(1) NOT NULL default '0'"
  648.         ),
  649.         'routing_to' => array
  650.         (
  651.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['routing_to'],
  652.             'exclude'                 => true,
  653.             'default'                 => '',
  654.             'inputType'               => 'checkbox',
  655.             'sql'                     => "char(1) NOT NULL default ''"
  656.         ),
  657.         'loc_linkurl' => array
  658.         (
  659.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_linkurl'],
  660.             'exclude'                 => true,
  661.             'inputType'               => 'text',
  662.             'eval'                    => array('rgxp'=>'url''decodeEntities'=>true'maxlength'=>255'tl_class'=>'wizard'),
  663.             'wizard'                  => array(array('tl_c4g_maps''pickUrl')),
  664.             'sql'                     => "varchar(255) NOT NULL default ''"
  665.         ),
  666.         'loc_onclick_zoomto' => array
  667.         (
  668.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_onclick_zoomto'],
  669.             'exclude'                 => true,
  670.             'inputType'               => 'c4g_text',
  671.             'default'                 => '0',
  672.             'eval'                    => array('rgxp'=>'digit''tl_class'=>'clr'),
  673.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  674.         ),
  675.         'loc_minzoom' => array
  676.         (
  677.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_minzoom'],
  678.             'exclude'                 => true,
  679.             'inputType'               => 'c4g_text',
  680.             'default'                 => '0',
  681.             'eval'                    => array('rgxp'=>'digit''tl_class'=>'clr'),
  682.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  683.         ),
  684.         'loc_maxzoom' => array
  685.         (
  686.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['loc_maxzoom'],
  687.             'exclude'                 => true,
  688.             'inputType'               => 'c4g_text',
  689.             'default'                 => '0',
  690.             'eval'                    => array('rgxp'=>'digit''tl_class'=>'clr'),
  691.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  692.         ),
  693.         'tab_source' => array
  694.         (
  695.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_source'],
  696.             'exclude'                 => true,
  697.             'inputType'               => 'select',
  698.             'options_callback'        => array('tl_c4g_maps','getTabSources'),
  699.             'eval'                    => array('submitOnChange' => true),
  700.             'sql'                     => "varchar(100) NOT NULL default ''"
  701.         ),
  702.         'async_content' => array
  703.         (
  704.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['async_content'],
  705.             'exclude'                 => true,
  706.             'default'                 => false,
  707.             'inputType'               => 'checkbox',
  708.             'sql'                     => "char(1) NOT NULL default ''"
  709.         ),
  710.         'tab_pid' => array
  711.         (
  712.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_pid'],
  713.             'exclude'                 => true,
  714.             'inputType'               => 'select',
  715.             'options_callback'        => array('tl_c4g_maps','getTabParentList'),
  716.             'sql'                     => "int(10) unsigned NOT NULL default '0'",
  717.             'eval'                    =>  array('tl_class'=>'clr''chosen'=>true'includeBlankOption' => true)
  718.         ),
  719.         'tab_pid1' => array
  720.         (
  721.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_pid1'],
  722.             'exclude'                 => true,
  723.             'inputType'               => 'select',
  724.             'options_callback'        => array('tl_c4g_maps','getTabParentList1'),
  725.             'sql'                     => "int(10) unsigned NOT NULL default '0'",
  726.             'eval'                    => array('tl_class'=>'clr''chosen'=>true'includeBlankOption' => true)
  727.         ),
  728. //        'tab_tag' => array
  729. //        (
  730. //            'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_tag'],
  731. //            'exclude'                 => true,
  732. //            'inputType'               => 'select',
  733. //            'options_callback'        => array('tl_c4g_maps','getTabTag'),
  734. //            'sql'                     => "char(10) unsigned NOT NULL default ''",
  735. //            'eval'                    => array('tl_class'=>'clr', 'chosen'=>true, 'includeBlankOption' => true)
  736. //        ),
  737.         'tab_labeldisplay' => array
  738.         (
  739.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_labeldisplay'],
  740.             'exclude'                 => true,
  741.             'inputType'               => 'select',
  742.             'options'                 => array('OFF','1ST','1ST_MORE','1ST_COUNT','ALL'),
  743.             'default'                 => '1ST_MORE',
  744.             'reference'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['references'],
  745.             'sql'                     => "char(10) NOT NULL default '1ST_MORE'"
  746.         ),
  747.         'tab_tooltipdisplay' => array
  748.         (
  749.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_tooltipdisplay'],
  750.             'exclude'                 => true,
  751.             'inputType'               => 'select',
  752.             'options'                 => array('OFF','1ST','1ST_MORE','1ST_COUNT','ALL'),
  753.             'default'                 => '1ST_MORE',
  754.             'reference'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['references'],
  755.             'sql'                     => "char(10) NOT NULL default '1ST_MORE'"
  756.         ),
  757.         'tab_directlink' => array
  758.         (
  759.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_directlink'],
  760.             'exclude'                 => true,
  761.             'default'                 => '',
  762.             'inputType'               => 'checkbox',
  763.             'sql'                     => "char(1) NOT NULL default ''"
  764.         ),
  765.         'tab_force_target_blank' => array
  766.         (
  767.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_force_target_blank'],
  768.             'exclude'                 => true,
  769.             'default'                 => '',
  770.             'inputType'               => 'checkbox',
  771.             'sql'                     => "char(1) NOT NULL default ''"
  772.         ),
  773.         'tab_whereclause' => array
  774.         (
  775.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_whereclause'],
  776.             'exclude'                 => true,
  777.             'inputType'               => 'textarea',
  778.             'eval'                    => array('decodeEntities'=>true), // -> hier werden die HTML Entities deaktiviert
  779.             'sql'                     => "text NULL"
  780.         ),
  781.         'tab_orderby' => array
  782.         (
  783.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_orderby'],
  784.             'exclude'                 => true,
  785.             'inputType'               => 'text',
  786.             'eval'                    => array('maxlength'=>128),
  787.             'sql'                     => "varchar(128) NOT NULL default ''"
  788.         ),
  789.         'tab_filter_alias' => array
  790.         (
  791.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['tab_filter_alias'],
  792.             'exclude'                 => true,
  793.             'default'                 => '',
  794.             'inputType'               => 'checkbox',
  795.             'sql'                     => "char(1) NOT NULL default ''"
  796.         ),
  797.         'data_file' => array
  798.         (
  799.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_file'],
  800.             'exclude'                 => true,
  801.             'inputType'               => 'fileTree',
  802.             'eval'                    => array( 'trailingSlash' => false'files' => true'fieldType' => 'radio' ),
  803.             'sql'                     => "binary(16) NULL"
  804.         ),
  805.         'data_folder' => array
  806.         (
  807.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_folder'],
  808.             'exclude'                 => true,
  809.             'inputType'               => 'fileTree',
  810.             'eval'                    => array( 'trailingSlash' => false'files' => false'fieldType' => 'radio' ),
  811.             'sql'                     => "binary(16) NULL"
  812.         ),
  813.         'data_url' => array
  814.         (
  815.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_url'],
  816.             'exclude'                 => true,
  817.             'inputType'               => 'text',
  818.             'eval'                    => array('rgxp'=>'url''decodeEntities'=>true'maxlength'=>255'tl_class'=>'wizard'),
  819.             'wizard'                  => array(array('tl_c4g_maps''pickUrl')),
  820.             'sql'                     => "varchar(255) NOT NULL default ''"
  821.         ),
  822.         'data_content' => array
  823.         (
  824.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_content'],
  825.             'exclude'                 => true,
  826.             'inputType'               => 'textarea',
  827.             'eval'                    => array('tl_class'=>'wizard''preserve_tags'=>true),
  828.             // 'save_callback'           => array(array('tl_c4g_maps','setLocData')),
  829.             'wizard'                  => array(array('con4gis\MapsBundle\Resources\contao\classes\GeoEditor''getEditorLink')),
  830.             'sql'                     => "text NULL"
  831.         ),
  832.         'data_projection' => array
  833.         (
  834.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_projection'],
  835.             'exclude'                 => true,
  836.             'inputType'               => 'select',
  837.             'options'                 => array('MERC','WGS84'),
  838.             'default'                 => 'MERC',
  839.             'reference'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['references'],
  840.             'sql'                     => "char(5) NOT NULL default ''"
  841.         ),
  842.         'data_forcenodes' => array
  843.         (
  844.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_forcenodes'],
  845.             'exclude'                 => true,
  846.             'default'                 => true,
  847.             'inputType'               => 'checkbox',
  848.             'sql'                     => "char(1) NOT NULL default '1'"
  849.         ),
  850.         'data_additionalgeometries' => array
  851.         (
  852.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_additionalgeometries'],
  853.             'exclude'                 => true,
  854.             'default'                 => false,
  855.             'inputType'               => 'checkbox',
  856.             'sql'                     => "char(1) NOT NULL default ''"
  857.         ),
  858.         'data_layername' => array
  859.         (
  860.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_layername'],
  861.             'exclude'                 => true,
  862.             'inputType'               => 'text',
  863.             'eval'                    => array('maxlength'=>254),
  864.             'sql'                     => "varchar(254) NOT NULL default ''"
  865.         ),
  866.         'data_hidelayer' => array
  867.         (
  868.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['data_hidelayer'],
  869.             'exclude'                 => true,
  870.             'default'                 => false,
  871.             'inputType'               => 'checkbox',
  872.             'sql'                     => "char(1) NOT NULL default ''"
  873.         ),
  874.         'hide_child' => array
  875.         (
  876.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['hide_child'],
  877.             'exclude'                 => true,
  878.             'default'                 => false,
  879.             'inputType'               => 'checkbox',
  880.             'sql'                     => "char(1) NOT NULL default ''"
  881.         ),
  882.         'showPopupOnActive' => array
  883.         (
  884.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['showPopupOnActive'],
  885.             'exclude'                 => true,
  886.             'default'                 => false,
  887.             'inputType'               => 'checkbox',
  888.             'sql'                     => "char(1) NOT NULL default ''"
  889.         ),
  890.         'forums' => array
  891.         (
  892.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['forums'],
  893.             'exclude'                 => true,
  894.             'inputType'               => 'checkbox',
  895.             'options_callback'        => array('tl_c4g_maps','getMapForums'),
  896.             'eval'                    => array('mandatory'=>false'multiple'=>true),
  897.             'sql'                     => "blob NULL"
  898.         ),
  899.         'forum_jumpto' => array
  900.         (
  901.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['forum_jumpto'],
  902.             'exclude'                 => true,
  903.             'inputType'               => 'pageTree',
  904.             'eval'                    => array('fieldType'=>'radio'),
  905.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  906.         ),
  907.         'forum_reassign_layer' => array
  908.         (
  909.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['forum_reassign_layer'],
  910.             'exclude'                 => true,
  911.             'inputType'               => 'select',
  912.             'options'                 => array('NO','THREAD'),
  913.             'default'                 => 'NO',
  914.             'reference'               => &$GLOBALS['TL_LANG']['tl_c4g_maps']['references'],
  915.             'sql'                     => "char(10) NOT NULL default 'NO'"
  916.         ),
  917.         'ovp_request' => array
  918.         (
  919.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['ovp_request'],
  920.             'exclude'                 => true,
  921.             'inputType'               => 'textarea',
  922.             'eval'                    => array('allowHtml'=>true'preserveTags'=>true),
  923.             'sql'                     => "text NULL"
  924.         ),
  925.         'ovp_bbox_limited' => array
  926.         (
  927.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['ovp_bbox_limited'],
  928.             'exclude'                 => true,
  929.             'default'                 => true,
  930.             'inputType'               => 'checkbox',
  931.             'sql'                     => "char(1) NOT NULL default '1'"
  932.         ),
  933.         'link_id' => array
  934.         (
  935.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['link_id'],
  936.             'exclude'                 => true,
  937.             'inputType'               => 'select',
  938.             'options_callback'        => array('tl_c4g_maps''get_link_items'),
  939.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  940.         ),
  941.         'protect_element' => array
  942.         (
  943.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['protect_element'],
  944.             'exclude'                 => true,
  945.             'default'                 => false,
  946.             'inputType'               => 'checkbox',
  947.             'eval'                    => array('submitOnChange' => true),
  948.             'sql'                     => "char(1) NOT NULL default ''"
  949.         ),
  950.         'permitted_groups' => array
  951.         (
  952.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['permitted_groups'],
  953.             'exclude'                 => true,
  954.             'inputType'               => 'checkbox',
  955.             'foreignKey'              => 'tl_member_group.name',
  956.             'eval'                    => array('mandatory'=>false'multiple'=>true),
  957.             'sql'                     => "blob NULL"
  958.         ),
  959.         'use_specialprofile' => array
  960.         (
  961.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['use_specialprofile'],
  962.             'exclude'                 => true,
  963.             'default'                 => false,
  964.             'inputType'               => 'checkbox',
  965.             'eval'                    => array('submitOnChange' => true),
  966.             'sql'                     => "char(1) NOT NULL default ''"
  967.         ),
  968.         'specialprofile' => array
  969.         (
  970.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['specialprofile'],
  971.             'exclude'                 => true,
  972.             'inputType'               => 'select',
  973.             'foreignKey'              => 'tl_c4g_map_profiles.name',
  974.             'eval'                    => array('tl_class'=>'w50''submitOnChange' => true'alwaysSave' => true ),
  975.             'load_callback'           => array(array('tl_c4g_maps','getDefaultProfile')),
  976.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  977.         ),
  978.         'specialprofile_mobile' => array
  979.         (
  980.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['specialprofile_mobile'],
  981.             'exclude'                 => true,
  982.             'inputType'               => 'select',
  983.             'foreignKey'              => 'tl_c4g_map_profiles.name',
  984.             'eval'                    => array('tl_class'=>'w50',
  985.                                                'includeBlankOption'=>true),
  986.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  987.         ),
  988.         'specialprofile_groups' => array
  989.         (
  990.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['specialprofile_groups'],
  991.             'exclude'                 => true,
  992.             'inputType'               => 'checkbox',
  993.             'foreignKey'              => 'tl_member_group.name',
  994.             'eval'                    => array('tl_class'=>'clr''mandatory'=>false'multiple'=>true),
  995.             'sql'                     => "blob NULL"
  996.         ),
  997.         'cluster_locations' => array
  998.         (
  999.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cluster_locations'],
  1000.             'exclude'                 => true,
  1001.             'default'                 => false,
  1002.             'inputType'               => 'checkbox',
  1003.             'eval'                    => array('submitOnChange' => true),
  1004.             'sql'                     => "char(1) NOT NULL default ''"
  1005.         ),
  1006.         'cluster_distance' => array
  1007.         (
  1008.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cluster_distance'],
  1009.             'exclude'                 => true,
  1010.             'inputType'               => 'text',
  1011.             'eval'                    => array('maxlength'=>100),
  1012.             'sql'                     => "varchar(100) NOT NULL default ''"
  1013.         ),
  1014.         'cluster_fillcolor' => array
  1015.         (
  1016.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cluster_fillcolor'],
  1017.             'inputType'               => 'text',
  1018.             'default'                 => '4975A8',
  1019.             'eval'                    => array('maxlength'=>6'isHexColor'=>true'colorpicker'=>true'decodeEntities'=>true'tl_class'=>'w50 wizard''mandatory'=>true),
  1020.             'sql'                     => "varchar(6) NOT NULL default '4975A8'"
  1021.         ),
  1022.         'cluster_fontcolor' => array
  1023.         (
  1024.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cluster_fontcolor'],
  1025.             'default'                 => 'ffffff',
  1026.             'inputType'               => 'text',
  1027.             'eval'                    => array('maxlength'=>6'isHexColor'=>true'colorpicker'=>true'decodeEntities'=>true'tl_class'=>'w50 wizard'),
  1028.             'sql'                     => "varchar(6) NOT NULL default 'ffffff'"
  1029.         ),'cluster_zoom' => array
  1030.         (
  1031.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cluster_zoom'],
  1032.             'default'                 => '17',
  1033.             'exclude'                 => true,
  1034.             'inputType'               => 'c4g_text',
  1035.             'eval'                    => array('rgxp'=>'digit''tl_class'=>'clr'),
  1036.             'sql'                     => "int(10) unsigned NOT NULL default '17'"
  1037.         ),'cluster_popup' => array
  1038.         (
  1039.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cluster_popup'],
  1040.             'exclude'                 => true,
  1041.             'default'                 => false,
  1042.             'inputType'               => 'checkbox',
  1043.             'sql'                     => "char(1) NOT NULL default ''"
  1044.         ),
  1045.         'zoom_locations' => array
  1046.         (
  1047.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['zoom_locations'],
  1048.             'exclude'                 => true,
  1049.             'default'                 => false,
  1050.             'inputType'               => 'checkbox',
  1051.             'sql'                     => "char(1) NOT NULL default ''"
  1052.         ),
  1053.         'hover_location' => array
  1054.         (
  1055.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['hover_location'],
  1056.             'exclude'                 => true,
  1057.             'default'                 => false,
  1058.             'eval'                    => array('submitOnChange' => true),
  1059.             'inputType'               => 'checkbox',
  1060.             'sql'                     => "char(1) NOT NULL default ''"
  1061.         ),
  1062.         'hover_style' => array
  1063.         (
  1064.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['hover_style'],
  1065.             'exclude'                 => true,
  1066.             'inputType'               => 'select',
  1067.             'options_callback'        => array('tl_c4g_maps','getLocStyles'),
  1068.             'eval'                    => array('tl_class'=>'clr'),
  1069.             'wizard' => array
  1070.             (
  1071.                 array('tl_c4g_maps''editLocationStyle')
  1072.             ),
  1073.             'sql'                     => "int(10) unsigned NOT NULL default '0'"
  1074.         ),
  1075.         'be_optimize_checkboxes_limit' => array
  1076.         (
  1077.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['be_optimize_checkboxes_limit'],
  1078.             'exclude'                 => true,
  1079.             'inputType'               => 'text',
  1080.             'default'                 => '10',
  1081.             'eval'                    => array('rgxp'=>'digit''submitOnChange' => true),
  1082.             'sql'                     => "int(10) unsigned NOT NULL default '10'"
  1083.         ),
  1084.         'cssClass' => array
  1085.         (
  1086.             'label'                   => &$GLOBALS['TL_LANG']['tl_c4g_maps']['cssClass'],
  1087.             'exclude'                 => true,
  1088.             'inputType'               => 'text',
  1089.             'eval'                    => array('tl_class'=>'w50 clr'),
  1090.             'sql'                     => "varchar(255) NOT NULL default ''"
  1091.         ),
  1092.     )
  1093. );
  1094. /**
  1095.  * Class tl_c4g_maps
  1096.  */
  1097. class tl_c4g_maps extends Backend
  1098. {
  1099.     /**
  1100.      * value of first source table
  1101.      */
  1102.     protected $firstTabSource null;
  1103.     /**
  1104.      * Import BackendUser object
  1105.      */
  1106.     public function __construct()
  1107.     {
  1108.         parent::__construct();
  1109.         $this->import('BackendUser''User');
  1110.     }
  1111.     /**
  1112.      * Return the copy page with subpages button
  1113.      * @param array
  1114.      * @param string
  1115.      * @param string
  1116.      * @param string
  1117.      * @param string
  1118.      * @param string
  1119.      * @param string
  1120.      * @return string
  1121.      */
  1122.     public function copyPageWithSubpages($row$href$label$title$icon$attributes$table)
  1123.     {
  1124.         $objSubpages $this->Database->prepare("SELECT id FROM tl_c4g_maps WHERE pid=?")
  1125.                                       ->limit(1)
  1126.                                       ->execute($row['id']);
  1127.         if ($objSubpages->numRows 0) {
  1128.             return '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon$label).'</a> ';
  1129.         } else {
  1130.             return $this->generateImage(preg_replace('/\.gif$/i''_.gif'$icon)).' ';
  1131.         }
  1132.     }
  1133.     /**
  1134.      * Return all Location Styles for current Maps Profile as array
  1135.      * @param object
  1136.      * @return array
  1137.      */
  1138.     public function getLocStyles(DataContainer $dc)
  1139.     {
  1140.         $profile $this->Database->prepare("SELECT locstyles FROM tl_c4g_map_profiles WHERE id=?")->execute($dc->activeRecord->profile);
  1141.         $ids deserialize($profile->locstyles,true);
  1142.         if (count($ids)>0) {
  1143.             $locStyles $this->Database->prepare("SELECT id,name FROM tl_c4g_map_locstyles WHERE id IN (".implode(',',$ids).") ORDER BY name")->execute();
  1144.         } else {
  1145.             $locStyles $this->Database->prepare("SELECT id,name FROM tl_c4g_map_locstyles ORDER BY name")->execute();
  1146.         }
  1147.         while ($locStyles->next()) {
  1148.             $return[$locStyles->id] = $locStyles->name;
  1149.         }
  1150.         return $return;
  1151.     }
  1152.     /**
  1153.      * Return all available Sources for Maps
  1154.      * @param object
  1155.      * @return array
  1156.      */
  1157.     public function getTabSources(DataContainer $dc)
  1158.     {
  1159.         $return = array();
  1160.         foreach ($GLOBALS['con4gis']['maps']['sourcetable'] as $key=>$sourcetable) {
  1161.             if (!isset($this->firstTabSource)) {
  1162.                 $this->firstTabSource $key;
  1163.             }
  1164.             if (!$GLOBALS['TL_LANG']['c4g_maps']['sourcetable'][$key]['name'] && !$GLOBALS['con4gis']['maps']['sourcetable'][$key]['name']) {
  1165.                 $return[$key] = $key;
  1166.             } else {
  1167.                 if ($GLOBALS['con4gis']['maps']['sourcetable'][$key]['name']) {
  1168.                     $return[$key] = $GLOBALS['con4gis']['maps']['sourcetable'][$key]['name'];
  1169.                 } else {
  1170.                     $return[$key] = $GLOBALS['TL_LANG']['c4g_maps']['sourcetable'][$key]['name'];
  1171.                 }
  1172.             }
  1173.         }
  1174.         return $return;
  1175.     }
  1176.     /**
  1177.      * Return all available locations types
  1178.      * @param object
  1179.      * @return array
  1180.      */
  1181.     public function getLocationTypes(DataContainer $dc)
  1182.     {
  1183.         $return = array('none','single','table','gpx','kml','geojson','osm','folder','overpass','link''startab');
  1184.         if ($GLOBALS['con4gis']['forum']['installed']) {
  1185.             $return[] = 'c4gForum';
  1186.         }
  1187.         if (isset($GLOBALS['c4g_locationtypes']) && is_array($GLOBALS['c4g_locationtypes']))
  1188.         {
  1189.             $return array_merge($return$GLOBALS['c4g_locationtypes']);
  1190.         }
  1191.         return $return;
  1192.     }
  1193.     /**
  1194.      * Return all available map enabled forums
  1195.      * @param object
  1196.      * @return array
  1197.      */
  1198.     public function getMapForums(DataContainer $dc)
  1199.     {
  1200.         $forumHelper = new \con4gis\ForumBundle\Resources\contao\classes\C4GForumHelper($this->Database);
  1201.         $forums $forumHelper->getMapForums();
  1202.         foreach ($forums AS $forum) {
  1203.             $return[$forum['id']] = $forum['name'];
  1204.         }
  1205.         return $return;
  1206.     }
  1207.     /**
  1208.      * Return all entries in the parent table for the selection
  1209.      * @param object
  1210.      * @return array
  1211.      */
  1212.     public function getTabParentList(DataContainer $dc)
  1213.     {
  1214.         if ($dc->activeRecord->tab_source<>'') {
  1215.             $tabsource $dc->activeRecord->tab_source;
  1216.         } else {
  1217.             $tabsource $this->firstTabSource;
  1218.         }
  1219.         $source $GLOBALS['con4gis']['maps']['sourcetable'][$tabsource];
  1220.         $ptable explode(','$source['ptable']);
  1221.         $ptable_option explode(','$source['ptable_option']);
  1222.         if (is_array($source) && $ptable && $ptable_option) {
  1223.             if (($ptable[0]) && ($ptable_option[0])) {
  1224.                 $obj $this->Database->prepare(
  1225.                     "SELECT id, ".$ptable_option[0]." FROM ".$ptable[0])->execute();
  1226.                 while ($obj->next()) {
  1227.                     $name $ptable_option[0];
  1228.                     $return[$obj->id] = $obj->$name;
  1229.                 }
  1230.                 return $return;
  1231.             }
  1232.         }
  1233.     }
  1234.     /**
  1235.      * Return all entries in the parent table for the selection
  1236.      * @param object
  1237.      * @return array
  1238.      */
  1239.     public function getTabParentList1(DataContainer $dc)
  1240.     {
  1241.         if ($dc->activeRecord->tab_source<>'') {
  1242.             $tabsource $dc->activeRecord->tab_source;
  1243.         } else {
  1244.             $tabsource $this->firstTabSource;
  1245.         }
  1246.         $source $GLOBALS['con4gis']['maps']['sourcetable'][$tabsource];
  1247.         if($GLOBALS['BE_FFL']['tag'])
  1248.         {
  1249.             $source $GLOBALS['con4gis']['maps']['sourcetable'][$tabsource.'_with_tags'];
  1250.         }
  1251.         $ptable explode(','$source['ptable']);
  1252.         $ctable explode(','$source['ctable']);
  1253.         $ctable_option explode(','$source['ctable_option']);
  1254.         $ptable_option explode(','$source['ptable_option']);
  1255.         $ptype $source['ptype'];
  1256.         $sqlwhere $source['ctable_where'];
  1257.         if (is_array($source) && $ptable && $ptable_option) {
  1258.             if (($ptable[1]) && ($ptable_option[1])) {
  1259.                 if($ptype == 'tag')
  1260.                 {
  1261.                     $obj $this->Database->prepare(
  1262.                         "SELECT id, ".$ptable_option[1]." FROM ".$ptable[1]." WHERE ".$sqlwhere[1])->execute();
  1263.                 }
  1264.                 else
  1265.                 {
  1266.                     $obj $this->Database->prepare(
  1267.                         "SELECT id, ".$ptable_option[1]." FROM ".$ptable[1])->execute();
  1268.                 }
  1269.                 while ($obj->next()) {
  1270.                     $name $ptable_option[1];
  1271.                     $return[$obj->id] = $obj->$name;
  1272.                 }
  1273.                 $return array_unique($return);
  1274.                 return $return;
  1275.             }
  1276.             else if (($ctable[0]) && ($ctable_option[0])) {
  1277.                 if($ptype == 'tag')
  1278.                 {
  1279.                     $obj $this->Database->prepare(
  1280.                         "SELECT id, ".$ctable_option[0]." FROM ".$ctable[0]." WHERE ".$sqlwhere)->execute();
  1281.                 }
  1282.                 else
  1283.                 {
  1284.                     $obj $this->Database->prepare(
  1285.                         "SELECT id, ".$ctable_option[0]." FROM ".$ctable[0])->execute();
  1286.                 }
  1287.                 while ($obj->next()) {
  1288.                     $name $ctable_option[0];
  1289.                     $return[$obj->id] = $obj->$name;
  1290.                 }
  1291.                 $return array_unique($return);
  1292.                 return $return;
  1293.             }
  1294.         }
  1295.     }
  1296. //    public function getTabTag(DataContainer $dc)
  1297. //    {
  1298. //        if ($dc->activeRecord->tab_source<>'') {
  1299. //            $tabsource = $dc->activeRecord->tab_source;
  1300. //        } else {
  1301. //            $tabsource = $this->firstTabSource;
  1302. //        }
  1303. //        $id = $dc->activeRecord->tab_pid;
  1304. //        $objEvent = $this->Database->prepare("SELECT * FROM tl_calendar_events WHERE pid = ?")->execute($id);
  1305. //        $stringSQL = "SELECT DISTINCT tag FROM tl_tag WHERE from_table = ?";
  1306. //        while($objEvent->next())
  1307. //        {
  1308. //            if(substr($stringSQL,-1)=='?')
  1309. //            {
  1310. //                $stringSQL .= " AND tid = ".$objEvent->id;
  1311. //            }
  1312. //            else
  1313. //            {
  1314. //                $stringSQL .= " OR tid = ".$objEvent->id;
  1315. //            }
  1316. //
  1317. //        }
  1318. //
  1319. //        $obj = $this->Database->prepare($stringSQL)->execute($tabsource,$dc->activeRecord->id);
  1320. //        while ($obj->next()) {
  1321. //
  1322. //            $return[$obj->tag] = $obj->tag;
  1323. //        }
  1324. //        return $return;
  1325. //
  1326. //    }
  1327.     /**
  1328.      * Recursively step through map item tree
  1329.      */
  1330.     private function getMapItemTree($tree$return$pid,$level)
  1331.     {
  1332.         if (array_key_exists($pid$tree)) {
  1333.             foreach ($tree[$pid] AS $key=>$item) {
  1334.                 $return[$key] = str_repeat('+',$level).$item;
  1335.                 if (array_key_exists($key$tree)) {
  1336.                     $return $this->getMapItemTree($tree$return$key$level+1);
  1337.                 }
  1338.             }
  1339.         }
  1340.         return $return;
  1341.     }
  1342.     /**
  1343.      * Return all map items ready to be linked
  1344.      * @param object
  1345.      * @return array
  1346.      */
  1347.     public function get_link_items(DataContainer $dc)
  1348.     {
  1349.         $maps $this->Database->prepare "SELECT id,pid,name FROM tl_c4g_maps WHERE published=1 AND location_type<>'link' ORDER BY pid,sorting" )->execute ();
  1350.         if ($maps->numRows 0) {
  1351.             while ( $maps->next () ) {
  1352.                 $tree [$maps->pid][$maps->id] = $maps->name;
  1353.             }
  1354.         }
  1355.         return $this->getMapItemTree($tree,array(),0,0);
  1356.     }
  1357.     /**
  1358.      * Generate the icons to be used
  1359.      */
  1360.     public function generateLabel($row$label$dc_table$folderAttribute)
  1361.     {
  1362.         $image 'bundles/con4gismaps/images/be-icons/';
  1363.         if ($row['is_map']) {
  1364.             if ($row['location_type']<>'none') {
  1365.                 $image .= 'map_location';
  1366.             } else {
  1367.                 $image .= 'map';
  1368.             }
  1369.         } elseif ($row['location_type']=='link') {
  1370.             $image .= 'link';
  1371.         } elseif ($row['location_type']<>'none') {
  1372.             $image .= 'location';
  1373.         } else {
  1374.             $image .= 'mapfolder';
  1375.         }
  1376.         if (!$row['published']) {
  1377.             $image .= '_1';
  1378.         }
  1379.         $image .= '.png';
  1380.         return $this->generateImage($image''$folderAttribute) . ' ' $label;
  1381.     }
  1382.     /**
  1383.      * Update the palette information that depend on other values
  1384.      */
  1385.     public function updateDCA(DataContainer $dc)
  1386.     {
  1387.         if (!$dc->id) return;
  1388.         $objMap $this->Database->prepare("SELECT is_map, show_locations, hover_location, restrict_area, geolocation, be_optimize_checkboxes_limit, popupType FROM tl_c4g_maps WHERE id=?")
  1389.             ->limit(1)
  1390.             ->execute($dc->id);
  1391.         if ($objMap->numRows 0) {
  1392.             if($objMap->show_locations == '1') {
  1393.                 $calcExtentFields 'min_gap,';
  1394.             }
  1395.             if($objMap->hover_location == '1') {
  1396.                 $hover_style 'hover_style';
  1397.                 foreach ($GLOBALS['TL_DCA']['tl_c4g_maps']['palettes'] as $paletteKey=>$paletteString)
  1398.                 {
  1399.                     if (!is_array($paletteString) && strpos($paletteString"hover_location")!==false)
  1400.                     {
  1401.                         $GLOBALS['TL_DCA']['tl_c4g_maps']['palettes'][$paletteKey] = str_replace("hover_location""hover_location,hover_style"$paletteString);
  1402.                     }
  1403.                 }
  1404.             }
  1405.             if ($objMap->geolocation) {
  1406.                 $geolocationFields 'geolocation_zoom,';
  1407.             } else {
  1408.                 $geolocationFields '';
  1409.             }
  1410.             if ($objMap->restrict_area) {
  1411.                 $restrictAreaFields 'restr_bottomleft_geox,restr_bottomleft_geoy,restr_topright_geox,restr_topright_geoy,';
  1412.             } else {
  1413.                 $restrictAreaFields '';
  1414.             }
  1415.             if ($objMap->popupType == "template")
  1416.             {
  1417.                 // we have to use this, because of current table naming with underscores
  1418.                 foreach ($GLOBALS['TL_DCA']['tl_c4g_maps']['palettes'] as $paletteKey=>$paletteString)
  1419.                 {
  1420.                     if (!is_array($paletteString) && strpos($paletteString"popup_info")!==false)
  1421.                     {
  1422.                         $GLOBALS['TL_DCA']['tl_c4g_maps']['palettes'][$paletteKey] = str_replace("popup_info""popupTemplate"$paletteString);
  1423.                     }
  1424.                 }
  1425.             }
  1426.             if ($objMap->popupType == "popup_info")
  1427.             {
  1428.                 // we have to use this, because of current table naming with underscores
  1429.                 foreach ($GLOBALS['TL_DCA']['tl_c4g_maps']['palettes'] as $paletteKey=>$paletteString)
  1430.                 {
  1431.                     if (!is_array($paletteString) && strpos($paletteString"popup_info")!==false)
  1432.                     {
  1433.                         $GLOBALS['TL_DCA']['tl_c4g_maps']['palettes'][$paletteKey] = str_replace("popup_info"""$paletteString);
  1434.                        # $GLOBALS['TL_DCA']['tl_c4g_maps']['palettes'][$paletteKey] = str_replace("hover_location", "hover_location,hover_style", $paletteString);
  1435.                     }
  1436.                 }
  1437.             }
  1438.             $GLOBALS['TL_DCA']['tl_c4g_maps']['subpalettes']['is_map'] =
  1439.                 'width,height,margin,show_locations,'.$calcExtentFields.'center_geox,center_geoy,zoom,geolocation,'.$geolocationFields.'restrict_area,'.$restrictAreaFields.',include_sublocations';
  1440.             if ($GLOBALS['con4gis']['forum']['installed']) {
  1441.                 $GLOBALS['TL_DCA']['tl_c4g_maps']['palettes']['overpass'] = str_replace('popup_info,routing_to''popup_info,popup_extend,routing_to'$GLOBALS['TL_DCA']['tl_c4g_maps']['palettes']['overpass']);
  1442.                 $GLOBALS['TL_DCA']['tl_c4g_maps']['palettes']['osm'] = str_replace('popup_info,routing_to''popup_info,popup_extend,routing_to'$GLOBALS['TL_DCA']['tl_c4g_maps']['palettes']['osm']);
  1443.             }
  1444.             // convert checkboxes to chosenfields, if there are to many locationstyles
  1445.             if (intval($objMap->be_optimize_checkboxes_limit) > 0) {
  1446.                 // subforums-options
  1447.                 if ($GLOBALS['con4gis']['forum']['installed']) {
  1448.                     $objForumCount $this->Database->prepare("SELECT COUNT(id) AS entry_count FROM tl_c4g_forum WHERE enable_maps = 1")->execute();
  1449.                     if ($objForumCount->numRows 0) {
  1450.                         if (intval($objForumCount->entry_count) > intval($objMap->be_optimize_checkboxes_limit)) {
  1451.                             $GLOBALS['TL_DCA']['tl_c4g_maps']['fields']['forums']['inputType'] = 'select';
  1452.                             $GLOBALS['TL_DCA']['tl_c4g_maps']['fields']['forums']['eval']['chosen'] = true;
  1453.                         }
  1454.                     }
  1455.                 }
  1456.             }
  1457.         }
  1458.     }
  1459.     /**
  1460.      * determine the default profile
  1461.      */
  1462.     public function getDefaultProfile($varValueDataContainer $dc)
  1463.     {
  1464.         if (!$varValue) {
  1465.             if ($dc->activeRecord->pid) {
  1466.                 // take default profile from parent entry
  1467.                 $objParent $this->Database->prepare("SELECT profile FROM tl_c4g_maps WHERE id=?")
  1468.                     ->limit(1)->execute($dc->activeRecord->pid);
  1469.                 if ($objParent->numRows 0) {
  1470.                     $varValue $objParent->profile;
  1471.                 }
  1472.             }
  1473.             if (!$varValue) {
  1474.                 // get default profile
  1475.                 $objProfile $this->Database->prepare("SELECT id FROM tl_c4g_map_profiles WHERE is_default=1")
  1476.                     ->limit(1)->execute();
  1477.                 if ($objProfile->numRows 0) {
  1478.                     $varValue $objProfile->id;
  1479.                 }
  1480.             }
  1481.         }
  1482.         return $varValue;
  1483.     }
  1484.     public function getOldValue($varValueDataContainer $dc)
  1485.     {
  1486.         if($varValue == '2'){
  1487.             if ($dc->activeRecord->calc_extent == "LOCATIONS") {
  1488.                 $varValue 1;
  1489.             } else {
  1490.                 $varValue 0;
  1491.             }
  1492.         }
  1493.         return $varValue;
  1494.     }
  1495.     public function setOldValue($varValueDataContainer $dc)
  1496.     {
  1497.         if($dc->activeRecord->show_locations == '1'){
  1498.             $varValue "LOCATIONS";
  1499.             $dc->activeRecord->calc_extent "LOCATIONS";
  1500.         }
  1501.         else if($dc->activeRecord->show_locations == ''){
  1502.             $varValue "CENTERZOOM";
  1503.             $dc->activeRecord->calc_extent "CENTERZOOM";
  1504.         }
  1505.         return $varValue;
  1506.     }
  1507.     /**
  1508.      * Validate Center Lon
  1509.      */
  1510.     public function setCenterLon($varValueDataContainer $dc)
  1511.     {
  1512.         if ($dc->activeRecord->calc_extent == 'CENTERZOOM') {
  1513.             if (!\con4gis\MapsBundle\Resources\contao\classes\Utils::validateLon($varValue)) {
  1514.                 throw new Exception($GLOBALS['TL_LANG']['c4g_maps']['geox_invalid']);
  1515.             }
  1516.         }
  1517.         return $varValue;
  1518.     }
  1519.     /**
  1520.      * Validate Center Lat
  1521.      */
  1522.     public function setCenterLat($varValueDataContainer $dc)
  1523.     {
  1524.         if ($dc->activeRecord->calc_extent == 'CENTERZOOM') {
  1525.             if (!\con4gis\MapsBundle\Resources\contao\classes\Utils::validateLat($varValue)) {
  1526.                 throw new Exception($GLOBALS['TL_LANG']['c4g_maps']['geoy_invalid']);
  1527.             }
  1528.         }
  1529.         return $varValue;
  1530.     }
  1531.     /**
  1532.      * Validate restricted Lon
  1533.      */
  1534.     public function setRestrLon($varValueDataContainer $dc)
  1535.     {
  1536.         if ($dc->activeRecord->restrict_area) {
  1537.             if (!\con4gis\MapsBundle\Resources\contao\classes\Utils::validateLon($varValue)) {
  1538.                 throw new Exception($GLOBALS['TL_LANG']['c4g_maps']['geox_invalid']);
  1539.             }
  1540.         }
  1541.         return $varValue;
  1542.     }
  1543.     /**
  1544.      * Validate restricted Lat
  1545.      */
  1546.     public function setRestrLat($varValueDataContainer $dc)
  1547.     {
  1548.         if ($dc->activeRecord->restrict_area) {
  1549.             if (!\con4gis\MapsBundle\Resources\contao\classes\Utils::validateLat($varValue)) {
  1550.                 throw new Exception($GLOBALS['TL_LANG']['c4g_maps']['geoy_invalid']);
  1551.             }
  1552.         }
  1553.         return $varValue;
  1554.     }
  1555.     /**
  1556.      * Validate Location Lon
  1557.      */
  1558.     public function setLocLon($varValueDataContainer $dc)
  1559.     {
  1560.         if (!\con4gis\MapsBundle\Resources\contao\classes\Utils::validateLon($varValue)) {
  1561.             throw new Exception($GLOBALS['TL_LANG']['c4g_maps']['geox_invalid']);
  1562.         }
  1563.         return $varValue;
  1564.     }
  1565.     /**
  1566.      * Validate Location Lat
  1567.      */
  1568.     public function setLocLat($varValueDataContainer $dc)
  1569.     {
  1570.         if (!\con4gis\MapsBundle\Resources\contao\classes\Utils::validateLat($varValue)) {
  1571.             throw new Exception($GLOBALS['TL_LANG']['c4g_maps']['geoy_invalid']);
  1572.         }
  1573.         return $varValue;
  1574.     }
  1575.     
  1576.     /**
  1577.      * Return the "toggle visibility" button
  1578.      */
  1579.     public function toggleIcon($row$href$label$title$icon$attributes)
  1580.     {
  1581.         if (strlen($this->Input->get('tid'))) {
  1582.             $this->toggleVisibility($this->Input->get('tid'), ($this->Input->get('state') == 1));
  1583.             $this->redirect($this->getReferer());
  1584.         }
  1585.         // Check permissions AFTER checking the tid, so hacking attempts are logged
  1586.         if (!$this->User->isAdmin && !$this->User->hasAccess('tl_c4g_maps::published''alexf')) {
  1587.             return '';
  1588.         }
  1589.         $href .= '&amp;tid='.$row['id'].'&amp;state='.($row['published'] ? '' 1);
  1590.         if (!$row['published']) {
  1591.             $icon 'invisible.gif';
  1592.         }
  1593.         \con4gis\CoreBundle\Resources\contao\classes\C4GAutomator::purgeApiCache();
  1594.         return '<a href="'.$this->addToUrl($href).'" title="'.specialchars($title).'"'.$attributes.'>'.\Image::getHtml($icon$label).'</a> ';
  1595.     }
  1596.     /**
  1597.      * Disable/enable an element
  1598.      * @param integer
  1599.      * @param boolean
  1600.      */
  1601.     public function toggleVisibility($intId$blnVisible)
  1602.     {
  1603.         // Check permissions to publish
  1604.         if (!$this->User->isAdmin && !$this->User->hasAccess('tl_c4g_maps::published''alexf')) {
  1605.             //ToDo loggerService
  1606.             $this->log('Not enough permissions to publish/unpublish con4gis\MapsBundle\Resources\contao\classes\Utils ID "'.$intId.'"''tl_c4g_maps toggleVisibility'TL_ERROR);
  1607.             $this->redirect('contao/main.php?act=error');
  1608.         }
  1609.         $this->createInitialVersion('tl_c4g_maps'$intId);
  1610.         #$this->Versions->initialize('tl_c4g_maps', $intId);
  1611.         $objVersions = new Versions('tl_c4g_maps'$intId);
  1612.         $objVersions->initialize();
  1613.         // Trigger the save_callback
  1614.         if (is_array($GLOBALS['TL_DCA']['tl_c4g_maps']['fields']['published']['save_callback'])) {
  1615.             foreach ($GLOBALS['TL_DCA']['tl_c4g_maps']['fields']['published']['save_callback'] as $callback) {
  1616.                 $str_class $callback[0];
  1617.                 $str_function $callback[1];
  1618.                 if ($str_class && $str_function) {
  1619.                     $this->import($str_class);
  1620.                     $blnVisible $this->$str_class->$str_function($blnVisible$this);
  1621.                 }
  1622.             }
  1623.         }
  1624.         // Update the database
  1625.         $this->Database->prepare("UPDATE tl_c4g_maps SET tstamp="time() .", published='" . ($blnVisible '') . "' WHERE id=?")
  1626.                        ->execute($intId);
  1627.         $this->createNewVersion('tl_c4g_maps'$intId);
  1628.         #x$this->Versions->create('tl_c4g_maps', $intId);
  1629.     }
  1630.     /**
  1631.      * Return the page pick wizard for the linkUrl
  1632.      * @param DataContainer $dc
  1633.      */
  1634.     public function pickUrl(DataContainer $dc)
  1635.     {
  1636.         return ' <a href="contao/page.php?do='.Input::get('do').'&amp;table='.$dc->table.'&amp;field='.$dc->field.'&amp;value='.str_replace(array('{{link_url::''}}'), ''$dc->value).'" title="'.specialchars($GLOBALS['TL_LANG']['MSC']['pagepicker']).'" onclick="Backend.getScrollOffset();Backend.openModalSelector({\'width\':765,\'title\':\''.specialchars(str_replace("'""\\'"$GLOBALS['TL_LANG']['MOD']['page'][0])).'\',\'url\':this.href,\'id\':\''.$dc->field.'\',\'tag\':\'ctrl_'.$dc->field . ((Input::get('act') == 'editAll') ? '_' $dc->id '').'\',\'self\':this});return false">' $this->generateImage('pickpage.gif'$GLOBALS['TL_LANG']['MSC']['pagepicker'], 'style="vertical-align:top;cursor:pointer"') . '</a>';
  1637.     }
  1638.     //editLocationType
  1639.     /**
  1640.         * Return the edit location style wizard
  1641.         * @param \DataContainer
  1642.         * @return string
  1643.         */
  1644.        public function editLocationStyle(DataContainer $dc)
  1645.        {
  1646.            return ($dc->value 1) ? '' ' <a href="contao/main.php?do=c4g_map_locstyles&amp;act=edit&amp;id=' $dc->value '&amp;popup=1&amp;nb=1&amp;rt=' REQUEST_TOKEN '" title="' sprintf(specialchars($GLOBALS['TL_LANG']['tl_c4g_maps']['editalias'][1]), $dc->value) . '" style="padding-left:3px" onclick="Backend.openModalIframe({\'width\':768,\'title\':\'' specialchars(str_replace("'""\\'"sprintf($GLOBALS['TL_LANG']['tl_c4g_maps']['editalias'][1], $dc->value))) . '\',\'url\':this.href});return false">' Image::getHtml('alias.gif'$GLOBALS['TL_LANG']['tl_c4g_maps']['editalias'][0], 'style="vertical-align:top"') . '</a>';
  1647.        }
  1648.     /**
  1649.      * Return all navigation templates as array
  1650.      *
  1651.      * @return array
  1652.      */
  1653.     public function getPopupTemplates()
  1654.     {
  1655.         return $this->getTemplateGroup('popup_');
  1656.     }
  1657. }