Add more controls.

This commit is contained in:
David Molineus
2015-01-05 14:58:37 +01:00
parent be9060795d
commit c00d08c872
8 changed files with 173 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ $GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\ProviderL
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ZoomControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ScaleControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\LayersControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\AttributionControlMapper';
/*
* Leaflet encoders.

View File

@@ -62,6 +62,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['toggle'],
'icon' => 'visible.gif',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => \Netzmacht\Contao\DevTools\Dca::createToggleIconCallback(
'tl_leaflet_control',
'active'
)
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['show'],
@@ -89,6 +99,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
),
'scale extends default' => array(
'config' => array('maxWidth', 'metric', 'imperial', 'updateWhenIdle')
),
'attribution extends default' => array(
'config' => array('attributions', 'prefix')
)
),
@@ -225,7 +238,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\Control', 'getLayers'),
'eval' => array(
'style' => 'width: 200px',
'style' => 'width: 300px',
'chosen' => true,
'includeBlankOption' => true
),
@@ -279,5 +292,21 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'prefix' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['prefix'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'attributions' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['attributions'],
'exclude' => true,
'inputType' => 'listWizard',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'clr', 'allowHtml' => true),
'sql' => "mediumblob NULL"
),
),
);

View File

@@ -32,7 +32,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
(
'layers' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'],
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['layersBtn'],
'href' => 'table=tl_leaflet_layer',
'icon' => 'system/modules/leaflet/assets/img/layers.png',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'

View File

@@ -6,8 +6,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_map']['zoom_legend'] = 'Center and zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['controls_legend'] = 'Control widgets';
$GLOBALS['TL_LANG']['tl_leaflet_map']['expert_legend'] = 'Expert settings';
$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'][0] = 'Manage layers';
$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'][1] = 'Manage leaflet layers';
$GLOBALS['TL_LANG']['tl_leaflet_map']['layersBtn'][0] = 'Manage layers';
$GLOBALS['TL_LANG']['tl_leaflet_map']['layersBtn'][1] = 'Manage leaflet layers';
$GLOBALS['TL_LANG']['tl_leaflet_map']['new'][0] = 'Create map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['new'][1] = 'Create new map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['edit'][0] = 'Edit map';
@@ -61,6 +61,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_map']['options'][0] = 'Extra options'
$GLOBALS['TL_LANG']['tl_leaflet_map']['options'][1] = 'Add extra map options as valid json. See <a href="http://leafletjs.com/reference.html#map-options">http://leafletjs.com/reference.html#map-options</a>';
$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustZoomExtra'][0] = 'Adjust extra zoom settings';
$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustZoomExtra'][1] = 'Enable if you want to adjust minimum and maximum zoom as well';
$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'][0] = 'Default layers';
$GLOBALS['TL_LANG']['tl_leaflet_map']['layers'][1] = 'Inital visible layers of the map. For optional layers use the layers control.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'][''][0] = 'Disable';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomValues'][''][1] = 'Disable zoom function.';