Convert array syntax and other minor code style adjustments.

This commit is contained in:
David Molineus
2017-10-17 18:11:28 +02:00
parent 6ded7441d9
commit c465b724f4
63 changed files with 413 additions and 404 deletions

View File

@@ -48,10 +48,10 @@ class About
return array_map(
function ($library) {
$library = array_merge(
array(
[
'homepage' => null,
'version' => null,
),
],
$library
);
@@ -86,30 +86,30 @@ class About
$lockFile = TL_ROOT . '/composer.lock';
if (!file_exists($extFile) || !file_exists($lockFile)) {
return array();
return [];
}
$extension = json_decode(file_get_contents($extFile), true);
$installed = json_decode(file_get_contents($lockFile), true);
$deps = array();
$deps = [];
$version = null;
foreach ($installed['packages'] as $package) {
if ($package['name'] === 'netzmacht/contao-leaflet-maps') {
$version = $package['version'];
} elseif (isset($extension['require'][$package['name']])) {
$deps[] = array(
$deps[] = [
'name' => $package['name'],
'version' => $package['version'],
'license' => !empty($package['license']) ? implode(', ', $package['license']) : '',
'homepage' => sprintf(
'<a href="https://packagist.org/packages/%s" target="_blank">Visit packagist</a>',
$package['name']
)
);
),
];
}
}
return array($version, $deps);
return [$version, $deps];
}
}

View File

@@ -36,7 +36,7 @@ class Plugin implements BundlePluginInterface
return [
BundleConfig::create(NetzmachtContaoLeafletBundle::class)
->setLoadAfter([ContaoCoreBundle::class, NetzmachtContaoToolkitBundle::class])
->setReplace(['leaflet'])
->setReplace(['leaflet']),
];
}
}

View File

@@ -33,7 +33,7 @@ class NetzmachtContaoLeafletExtension extends Extension
{
$loader = new YamlFileLoader(
$container,
new FileLocator(dirname(__DIR__) .'/Resources/config')
new FileLocator(dirname(__DIR__) . '/Resources/config')
);
// Common config, services and listeners

View File

@@ -17,42 +17,36 @@
array_insert(
$GLOBALS['BE_MOD'],
1,
array(
'leaflet' => array
(
'leaflet_map' => array
(
'tables' => array
(
[
'leaflet' => [
'leaflet_map' => [
'tables' => [
'tl_leaflet_map',
'tl_leaflet_control',
),
],
'icon' => 'bundles/netzmachtcontaoleaflet/img/map.png',
'stylesheet' => 'bundles/netzmachtcontaoleaflet/css/backend.css',
),
'leaflet_layer' => array
(
'tables' => array
(
],
'leaflet_layer' => [
'tables' => [
'tl_leaflet_layer',
'tl_leaflet_marker',
'tl_leaflet_vector',
'tl_leaflet_icon',
'tl_leaflet_style',
'tl_leaflet_popup',
),
],
'icon' => 'bundles/netzmachtcontaoleaflet/img/layers.png',
'stylesheet' => 'bundles/netzmachtcontaoleaflet/css/backend.css',
'javascript' => 'bundles/netzmachtcontaoleaflet/js/backend.js'
),
'leaflet_about' => array
(
'javascript' => 'bundles/netzmachtcontaoleaflet/js/backend.js',
],
'leaflet_about' => [
'callback' => Netzmacht\Contao\Leaflet\Backend\About::class,
'icon' => 'bundles/netzmachtcontaoleaflet/img/about.png',
'stylesheet' => 'bundles/netzmachtcontaoleaflet/css/about.css',
)
)
)
],
],
]
);
/*
@@ -74,5 +68,5 @@ $GLOBALS['TL_MODELS']['tl_leaflet_vector'] = \Netzmacht\Contao\Leaflet\Model\Ve
$GLOBALS['TL_HOOKS']['initializeSystem'][] = [
'netzmacht.contao_leaflet.listeners.register_libraries',
'onInitializeSystem'
'onInitializeSystem',
];

View File

@@ -861,7 +861,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
],
'sql' => 'mediumtext NULL',
],
'file' => [
'file' => [
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['file'],
'exclude' => true,
'inputType' => 'fileTree',

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -3,8 +3,8 @@
* Translations are managed using Transifex. To create a new translation
* or to help to maintain an existing one, please register at transifex.com.
*
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
* @link http://help.transifex.com/intro/translating.html
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
*
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*

View File

@@ -25,8 +25,8 @@ $GLOBALS['TL_LANG']['MOD']['tl_leaflet_icon'] = 'Icons';
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_marker'] = 'Markers';
$GLOBALS['TL_LANG']['MOD']['tl_leaflet_control'] = 'Controls';
$GLOBALS['TL_LANG']['FMD']['leaflet'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['FMD']['leaflet'][1] = 'Integrate leaflet map as frontend module.';
$GLOBALS['TL_LANG']['FMD']['leaflet'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['FMD']['leaflet'][1] = 'Integrate leaflet map as frontend module.';
$GLOBALS['TL_LANG']['CTE']['leaflet'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['CTE']['leaflet'][1] = 'Integrate leaflet map as content element.';
$GLOBALS['TL_LANG']['CTE']['leaflet'][0] = 'Leaflet Map';
$GLOBALS['TL_LANG']['CTE']['leaflet'][1] = 'Integrate leaflet map as content element.';

View File

@@ -99,5 +99,5 @@ $GLOBALS['TL_LANG']['tl_leaflet_control']['topright'][1] = 'Top right of the
$GLOBALS['TL_LANG']['tl_leaflet_control']['base'][0] = 'Base layer';
$GLOBALS['TL_LANG']['tl_leaflet_control']['base'][1] = 'Base layers will be switched with radio buttons. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation';
$GLOBALS['TL_LANG']['tl_leaflet_control']['overlay'][0] = 'Overlay';
$GLOBALS['TL_LANG']['tl_leaflet_control']['overlay'][1] = 'Overlays will be switched with checkboxes.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['overlay'][0] = 'Overlay';
$GLOBALS['TL_LANG']['tl_leaflet_control']['overlay'][1] = 'Overlays will be switched with checkboxes.';

View File

@@ -18,91 +18,91 @@ $GLOBALS['TL_LANG']['tl_leaflet_map']['layers_legend'] = 'Default layers';
$GLOBALS['TL_LANG']['tl_leaflet_map']['expert_legend'] = 'Expert settings';
$GLOBALS['TL_LANG']['tl_leaflet_map']['behaviour_legend'] = 'Behaviour';
$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';
$GLOBALS['TL_LANG']['tl_leaflet_map']['edit'][1] = 'Edit map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['copy'][0] = 'Copy map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['copy'][1] = 'Copy map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['controls'][0] = 'Manage controls';
$GLOBALS['TL_LANG']['tl_leaflet_map']['controls'][1] = 'Manage controls of map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'][0] = 'Delete map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'][1] = 'Delete map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['show'][0] = 'Show details';
$GLOBALS['TL_LANG']['tl_leaflet_map']['show'][1] = 'Show map ID %s details';
$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';
$GLOBALS['TL_LANG']['tl_leaflet_map']['edit'][1] = 'Edit map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['copy'][0] = 'Copy map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['copy'][1] = 'Copy map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['controls'][0] = 'Manage controls';
$GLOBALS['TL_LANG']['tl_leaflet_map']['controls'][1] = 'Manage controls of map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'][0] = 'Delete map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['delete'][1] = 'Delete map ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_map']['show'][0] = 'Show details';
$GLOBALS['TL_LANG']['tl_leaflet_map']['show'][1] = 'Show map ID %s details';
$GLOBALS['TL_LANG']['tl_leaflet_map']['title'][0] = 'Title';
$GLOBALS['TL_LANG']['tl_leaflet_map']['title'][1] = 'Title of the map.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'][0] = 'Alias';
$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'][1] = 'Alias of the map.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['center'][0] = 'Center';
$GLOBALS['TL_LANG']['tl_leaflet_map']['center'][1] = 'Initial geographical center of the map. Comma separated coordinates.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dragging'][0] = 'Dragging';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dragging'][1] = 'Whether the map be draggable with mouse/touch or not.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['touchZoom'][0] = 'Touch zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['touchZoom'][1] = 'Whether the map can be zoomed by touch-dragging with two fingers.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['scrollWheelZoom'][0] = 'Scroll wheel zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['scrollWheelZoom'][1] = 'Whether the map can be zoomed by using the mouse wheel.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'][0] = 'Double click zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'][1] = 'Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boxZoom'][0] = 'Box zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boxZoom'][1] = 'Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['tap'][0] = 'Instant taps';
$GLOBALS['TL_LANG']['tl_leaflet_map']['tap'][1] = 'Enables mobile hacks for supporting instant taps.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['trackResize'][0] = 'Track window resize';
$GLOBALS['TL_LANG']['tl_leaflet_map']['trackResize'][1] = 'Whether the map automatically handles browser window resize to update itself.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['closeOnClick'][0] = 'Close popup on click';
$GLOBALS['TL_LANG']['tl_leaflet_map']['closeOnClick'][1] = 'Disable if you don\'t want popups to close when user clicks the map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboard'][0] = 'Keyboard navigation';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboard'][1] = 'Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardPanOffset'][0] = 'Keyboard pan offset';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardPanOffset'][1] = 'Amount of pixels to pan when pressing an arrow key.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardZoomOffset'][0] = 'Keyboard zoom offset';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardZoomOffset'][1] = 'Number of zoom levels to change when pressing + or - key.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'][0] = 'Zoom level';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'][1] = 'Initial map zoom.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'][0] = 'Minimum zoom level';
$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'][1] = 'Minimum zoom level of the map. Overrides any minZoom set on map layers.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'][0] = 'Maximum zoom level';
$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'][1] = 'Maximum zoom level of the map. This overrides any maxZoom set on map layers.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'][0] = 'Zoom snap';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'][1] = 'Forces the map\'s zoom level to always be a multiple of the number. Default is 1.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'][0] = 'Zoom delta';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'][1] = 'Controls how much the map\'s zoom level will change after zoom in or zoom out.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'][0] = 'Add default zoom control';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'][1] = 'Whether the zoom control is added to the map by default.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['bounceAtZoomLimits'][0] = 'Bounce at zoom limits';
$GLOBALS['TL_LANG']['tl_leaflet_map']['bounceAtZoomLimits'][1] = 'Disable if you don\'t want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming';
$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']['adjustBounds'][0] = 'Adjust bounds';
$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBounds'][1] = 'If enabled the map will fit into bounds of data layers which are marked to affect the map bounds.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locate'][0] = 'Locate user position';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locate'][1] = 'Initial map zoom.Tries to locate the user using the Geolocation API.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateWatch'][0] = 'Watch continuously';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateWatch'][1] = 'If true, starts continous watching of location changes ';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateSetView'][0] = 'Update map center';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateSetView'][1] = 'If enabled, automatically sets the map view to the user location. Otherwise only the <em>locationfound</em> event is triggered.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaxZoom'][0] = 'Locate max zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaxZoom'][1] = 'Max zoom when setting updating map view.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateTimeout'][0] = 'Locate timeout';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateTimeout'][1] = 'Number of milliseconds to wait for a response from geolocation.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['enableHighAccuracy'][0] = 'High accuracy';
$GLOBALS['TL_LANG']['tl_leaflet_map']['enableHighAccuracy'][1] = 'Enables high accuracy, see <a href="http://dev.w3.org/geo/api/spec-source.html#high-accuracy" target="_blank">description in the W3C spec</a>.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaximumAge'][0] = 'Locate maximum age';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaximumAge'][1] = 'Maximum age of detected location in milliseconds. Use cached value if time has not passed.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dynamicLoad'][0] = 'Load data dynamically in bounds';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dynamicLoad'][1] = 'If enabled the map requests data from the layers for the current bounds only and make a new request if bounds has changed.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boundsPadding'][0] = 'Bounds padding';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boundsPadding'][1] = 'Padding being used then applying bounds. Use comma separated values. If 2 values are given the <em>padding</em> option is set. If 4 values are given <em>paddingTopLeft</em> and <em>paddingBottomRight</em> is set.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cache'][0] = 'Enable cache';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cache'][1] = 'If enabled the generated map javascript is cached.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cacheLifeTime'][0] = 'Cache lifetime';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cacheLifeTime'][1] = 'Indicates how long a cache entry is valid in seconds.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['title'][0] = 'Title';
$GLOBALS['TL_LANG']['tl_leaflet_map']['title'][1] = 'Title of the map.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'][0] = 'Alias';
$GLOBALS['TL_LANG']['tl_leaflet_map']['alias'][1] = 'Alias of the map.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['center'][0] = 'Center';
$GLOBALS['TL_LANG']['tl_leaflet_map']['center'][1] = 'Initial geographical center of the map. Comma separated coordinates.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dragging'][0] = 'Dragging';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dragging'][1] = 'Whether the map be draggable with mouse/touch or not.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['touchZoom'][0] = 'Touch zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['touchZoom'][1] = 'Whether the map can be zoomed by touch-dragging with two fingers.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['scrollWheelZoom'][0] = 'Scroll wheel zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['scrollWheelZoom'][1] = 'Whether the map can be zoomed by using the mouse wheel.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'][0] = 'Double click zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['doubleClickZoom'][1] = 'Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boxZoom'][0] = 'Box zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boxZoom'][1] = 'Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['tap'][0] = 'Instant taps';
$GLOBALS['TL_LANG']['tl_leaflet_map']['tap'][1] = 'Enables mobile hacks for supporting instant taps.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['trackResize'][0] = 'Track window resize';
$GLOBALS['TL_LANG']['tl_leaflet_map']['trackResize'][1] = 'Whether the map automatically handles browser window resize to update itself.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['closeOnClick'][0] = 'Close popup on click';
$GLOBALS['TL_LANG']['tl_leaflet_map']['closeOnClick'][1] = 'Disable if you don\'t want popups to close when user clicks the map';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboard'][0] = 'Keyboard navigation';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboard'][1] = 'Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardPanOffset'][0] = 'Keyboard pan offset';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardPanOffset'][1] = 'Amount of pixels to pan when pressing an arrow key.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardZoomOffset'][0] = 'Keyboard zoom offset';
$GLOBALS['TL_LANG']['tl_leaflet_map']['keyboardZoomOffset'][1] = 'Number of zoom levels to change when pressing + or - key.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'][0] = 'Zoom level';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoom'][1] = 'Initial map zoom.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'][0] = 'Minimum zoom level';
$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'][1] = 'Minimum zoom level of the map. Overrides any minZoom set on map layers.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'][0] = 'Maximum zoom level';
$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'][1] = 'Maximum zoom level of the map. This overrides any maxZoom set on map layers.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'][0] = 'Zoom snap';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'][1] = 'Forces the map\'s zoom level to always be a multiple of the number. Default is 1.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'][0] = 'Zoom delta';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'][1] = 'Controls how much the map\'s zoom level will change after zoom in or zoom out.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'][0] = 'Add default zoom control';
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'][1] = 'Whether the zoom control is added to the map by default.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['bounceAtZoomLimits'][0] = 'Bounce at zoom limits';
$GLOBALS['TL_LANG']['tl_leaflet_map']['bounceAtZoomLimits'][1] = 'Disable if you don\'t want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming';
$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']['adjustBounds'][0] = 'Adjust bounds';
$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBounds'][1] = 'If enabled the map will fit into bounds of data layers which are marked to affect the map bounds.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locate'][0] = 'Locate user position';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locate'][1] = 'Initial map zoom.Tries to locate the user using the Geolocation API.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateWatch'][0] = 'Watch continuously';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateWatch'][1] = 'If true, starts continous watching of location changes ';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateSetView'][0] = 'Update map center';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateSetView'][1] = 'If enabled, automatically sets the map view to the user location. Otherwise only the <em>locationfound</em> event is triggered.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaxZoom'][0] = 'Locate max zoom';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaxZoom'][1] = 'Max zoom when setting updating map view.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateTimeout'][0] = 'Locate timeout';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateTimeout'][1] = 'Number of milliseconds to wait for a response from geolocation.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['enableHighAccuracy'][0] = 'High accuracy';
$GLOBALS['TL_LANG']['tl_leaflet_map']['enableHighAccuracy'][1] = 'Enables high accuracy, see <a href="http://dev.w3.org/geo/api/spec-source.html#high-accuracy" target="_blank">description in the W3C spec</a>.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaximumAge'][0] = 'Locate maximum age';
$GLOBALS['TL_LANG']['tl_leaflet_map']['locateMaximumAge'][1] = 'Maximum age of detected location in milliseconds. Use cached value if time has not passed.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dynamicLoad'][0] = 'Load data dynamically in bounds';
$GLOBALS['TL_LANG']['tl_leaflet_map']['dynamicLoad'][1] = 'If enabled the map requests data from the layers for the current bounds only and make a new request if bounds has changed.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boundsPadding'][0] = 'Bounds padding';
$GLOBALS['TL_LANG']['tl_leaflet_map']['boundsPadding'][1] = 'Padding being used then applying bounds. Use comma separated values. If 2 values are given the <em>padding</em> option is set. If 4 values are given <em>paddingTopLeft</em> and <em>paddingBottomRight</em> is set.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cache'][0] = 'Enable cache';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cache'][1] = 'If enabled the generated map javascript is cached.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cacheLifeTime'][0] = 'Cache lifetime';
$GLOBALS['TL_LANG']['tl_leaflet_map']['cacheLifeTime'][1] = 'Indicates how long a cache entry is valid in seconds.';
$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBoundsOptions']['load'][0] = 'At map initialization';
$GLOBALS['TL_LANG']['tl_leaflet_map']['adjustBoundsOptions']['load'][1] = 'Calculate bounds when the map is initialized. All static and already loaded deferred featured are included.';

View File

@@ -14,7 +14,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_marker']['title_legend'] = 'Title and type';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['content_legend'] = 'Content';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['config_legend'] = 'Configuration';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['active_legend'] = 'Activation';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['expert_legend'] = 'Expert settings';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['expert_legend'] = 'Expert settings';
$GLOBALS['TL_LANG']['tl_leaflet_marker']['new'][0] = 'Create marker';

View File

@@ -15,7 +15,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_vector']['active_legend'] = 'Activation';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['config_legend'] = 'Configuration';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['data_legend'] = 'Vector data';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['popup_legend'] = 'Popup';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['expert_legend'] = 'Expert settings';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['expert_legend'] = 'Expert settings';
$GLOBALS['TL_LANG']['tl_leaflet_vector']['new'][0] = 'Create vector';

View File

@@ -1,125 +1,140 @@
<div class="netzmacht-leaflet-credits">
<div class="header">
<h1 class="sub_headline"><?php echo $this->headline; ?> <small><?php echo $this->version; ?></small></h1>
</div>
<div class="tl_box block row">
<h2>About</h2>
<div class="left">
<p>
The Leaflet maps integration for Contao CMS is an Open Source Software license under the LGPL 3.0.
This extension is only exists because of great other Open Source Software which it heavenly depends on.
</p>
<p>
This software ships with an visible attribution to <em>netzmacht creative</em> in the map attribution control.
If you want to remove this attribution, you have to purchase a commercial license.
For more details visit the <a href="https://netzmacht.de/contao-leaflet" target="_blank">project website</a>.
</p>
<div class="header">
<h1 class="sub_headline"><?php echo $this->headline; ?>
<small><?php echo $this->version; ?></small>
</h1>
</div>
<div class="right">
<a href="http://www.netzmacht.de" <?php echo LINK_NEW_WINDOW; ?>>
<img src="bundles/netzmachtcontaoleaflet/img/logo.png"></a>
<p>
<strong class="company">netzmacht </strong><br>
David Molineus<br>
</p>
<p>
DAB Bank München<br>
IBAN: DE52701204008354237003<br>
BIC: DABBDEMMXXX
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YWMA95YS3FT6U">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
<div class="tl_box">
<h2>Support Contao Leaflet</h2>
<div class="row">
<div class="col">
<h3>Report issues</h3>
<p>If you found a bug, got some troubles or have a feature request - feel free to open an issue.</p>
<p><a href="http://github.com/netzmacht/contao-leaflet-maps/issues" class="btn" target="_blank">Issue tracker</a> </p>
</div>
<div class="col">
<h3>Contribute</h3>
<p>There are many ways you can con&shy;tribute. Translations,
docu&shy;mentation or code contributions are welcome.
<div class="tl_box block row">
<h2>About</h2>
<div class="left">
<p>
The Leaflet maps integration for Contao CMS is an Open Source Software license under the LGPL 3.0.
This extension is only exists because of great other Open Source Software which it heavenly depends on.
</p>
<p>
This software ships with an visible attribution to <em>netzmacht creative</em> in the map attribution
control.
If you want to remove this attribution, you have to purchase a commercial license.
For more details visit the <a href="https://netzmacht.de/contao-leaflet" target="_blank">project
website</a>.
</p>
<p><a href="https://netzmacht/contao-leaflet/contribute.html" class="btn" target="_blank">Contribute</a> </p>
</div>
<div class="col">
<h3>Fund a feature</h3>
<p>Contao Leaflet is not feature complete. Have a look at the list of planned feature and support them.</p>
<p><a href="https://netzmacht/contao-leaflet/planned-features.html" class="btn" target="_blank">Planned features</a> </p>
<div class="right">
<a href="http://www.netzmacht.de" <?php echo LINK_NEW_WINDOW; ?>>
<img src="bundles/netzmachtcontaoleaflet/img/logo.png"></a>
<p>
<strong class="company">netzmacht </strong><br>
David Molineus<br>
</p>
<p>
DAB Bank München<br>
IBAN: DE52701204008354237003<br>
BIC: DABBDEMMXXX
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YWMA95YS3FT6U">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_SM.gif" border="0"
name="submit" alt="PayPal The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
<div class="row">
<div class="col">
<h3>Individual development</h3>
<p>If you have special requirements you can hire me for an individual development.</p>
<p><a href="https://netzmacht/contao-leaflet/contact.html" class="btn" target="_blank">Contact</a> </p>
<div class="tl_box">
<h2>Support Contao Leaflet</h2>
<div class="row">
<div class="col">
<h3>Report issues</h3>
<p>If you found a bug, got some troubles or have a feature request - feel free to open an issue.</p>
<p><a href="http://github.com/netzmacht/contao-leaflet-maps/issues" class="btn" target="_blank">Issue
tracker</a></p>
</div>
<div class="col">
<h3>Contribute</h3>
<p>There are many ways you can con&shy;tribute. Translations,
docu&shy;mentation or code contributions are welcome.
</p>
<p><a href="https://netzmacht/contao-leaflet/contribute.html" class="btn" target="_blank">Contribute</a>
</p>
</div>
<div class="col">
<h3>Fund a feature</h3>
<p>Contao Leaflet is not feature complete. Have a look at the list of planned feature and support
them.</p>
<p><a href="https://netzmacht/contao-leaflet/planned-features.html" class="btn" target="_blank">Planned
features</a></p>
</div>
</div>
<div class="col">
<h3>Commercial license</h3>
<p>If you want to remove the attribution in the attribution control, you can purchase a commercial license.</p>
<p><a href="https://netzmacht/contao-leaflet/commercial-license.html" class="btn" target="_blank">Purchase license</a> </p>
<div class="row">
<div class="col">
<h3>Individual development</h3>
<p>If you have special requirements you can hire me for an individual development.</p>
<p><a href="https://netzmacht/contao-leaflet/contact.html" class="btn" target="_blank">Contact</a></p>
</div>
<div class="col">
<h3>Commercial license</h3>
<p>If you want to remove the attribution in the attribution control, you can purchase a commercial
license.</p>
<p><a href="https://netzmacht/contao-leaflet/commercial-license.html" class="btn" target="_blank">Purchase
license</a></p>
</div>
</div>
</div>
</div>
<div class="tl_box">
<h2>Credits</h2>
<table class="tl_listing">
<tr>
<th>Name</th>
<th>Version</th>
<th>License</th>
<th>Homepage</th>
</tr>
<?php if ($this->libraries): ?>
<tr><th colspan="4" class="subtitle">Libraries</th> </tr>
<?php endif; ?>
<?php foreach ($this->libraries as $library): ?>
<tr>
<td><?php echo $library['name']; ?></td>
<td><?php echo $library['version']; ?></td>
<td><?php echo $library['license']; ?></td>
<td><?php echo $library['homepage']; ?></td>
</tr>
<?php endforeach; ?>
<tr>
<th class="subtitle" colspan="4">Graphics</th>
</tr>
<tr>
<td>Farm Fresh-Web Icons</td>
<td>3.9.2</td>
<td><a href="http://creativecommons.org/licenses/by/3.0/us/" target="_blank">CC BY 3.0 US</a></td>
<td><a href="http://www.fatcow.com/free-icons" target="_blank">fatcow.com/free-icons</a></td>
</tr>
<tr>
<td>Web Blog Icons by SEM Labs</td>
<td>3.9.2</td>
<td><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank">CC BY 4.0</a></td>
<td><a href="http://semlabs.co.uk/" target="_blank">semlabs.co.uk</a></td>
</tr>
<?php if ($this->dependencies): ?>
<tr><th colspan="4" class="subtitle">Dependencies</th> </tr>
<?php endif; ?>
<?php foreach ($this->dependencies as $dep): ?>
<tr>
<td><?php echo $dep['name']; ?></td>
<td><?php echo $dep['version']; ?></td>
<td><?php echo $dep['license']; ?></td>
<td><?php echo $dep['homepage']; ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="tl_box">
<h2>Credits</h2>
<table class="tl_listing">
<tr>
<th>Name</th>
<th>Version</th>
<th>License</th>
<th>Homepage</th>
</tr>
<?php if ($this->libraries): ?>
<tr>
<th colspan="4" class="subtitle">Libraries</th>
</tr>
<?php endif; ?>
<?php foreach ($this->libraries as $library): ?>
<tr>
<td><?php echo $library['name']; ?></td>
<td><?php echo $library['version']; ?></td>
<td><?php echo $library['license']; ?></td>
<td><?php echo $library['homepage']; ?></td>
</tr>
<?php endforeach; ?>
<tr>
<th class="subtitle" colspan="4">Graphics</th>
</tr>
<tr>
<td>Farm Fresh-Web Icons</td>
<td>3.9.2</td>
<td><a href="http://creativecommons.org/licenses/by/3.0/us/" target="_blank">CC BY 3.0 US</a></td>
<td><a href="http://www.fatcow.com/free-icons" target="_blank">fatcow.com/free-icons</a></td>
</tr>
<tr>
<td>Web Blog Icons by SEM Labs</td>
<td>3.9.2</td>
<td><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank">CC BY 4.0</a></td>
<td><a href="http://semlabs.co.uk/" target="_blank">semlabs.co.uk</a></td>
</tr>
<?php if ($this->dependencies): ?>
<tr>
<th colspan="4" class="subtitle">Dependencies</th>
</tr>
<?php endif; ?>
<?php foreach ($this->dependencies as $dep): ?>
<tr>
<td><?php echo $dep['name']; ?></td>
<td><?php echo $dep['version']; ?></td>
<td><?php echo $dep['license']; ?></td>
<td><?php echo $dep['homepage']; ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>

View File

@@ -10,21 +10,21 @@
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var element = $('<?php echo $this->field; ?>');
var element = $('<?php echo $this->field; ?>');
var geocoder = L.Control.geocoder({
defaultMarkGeocode: false,
collapsed: false,
placeholder: '<?php echo $GLOBALS['TL_LANG']['leaflet']['searchPosition']; ?>'
}).addTo(map);
geocoder.on('markgeocode', function(event) {
geocoder.on('markgeocode', function (event) {
var container = document.createElement('div');
var link = document.createElement('button');
var result = event.geocode;
var link = document.createElement('button');
var result = event.geocode;
link.set('style', 'margin-left: 10px;');
link.appendText('<?php echo $GLOBALS['TL_LANG']['leaflet']['applyPosition']; ?>');
link.addEvent('click', function(e) {
link.addEvent('click', function (e) {
e.stop();
element.set('value', result.center.lat + ',' + result.center.lng);
@@ -37,7 +37,7 @@
map.removeLayer(this._geocodeMarker);
}
map.fitBounds(result.bbox, { padding: [0, 70]});
map.fitBounds(result.bbox, {padding: [0, 70]});
map.panTo(result.center);
this._geocodeMarker = new L.Marker(result.center, {draggable: true})

View File

@@ -9,5 +9,5 @@
</div>
<!-- indexer::continue -->
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript .'</script>'; ?>
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript . '</script>'; ?>

View File

@@ -1,6 +1,6 @@
<div id="<?php echo $mapId; ?>" style="<?php echo $style; ?>"></div>
<script>
L.contao.addMap('<?php echo $mapId; ?>', function() {
<?php echo $javascript; ?>
return { map: map, layers: layers, controls: controls, icons: icons };
}());</script>
L.contao.addMap('<?php echo $mapId; ?>', function () {
<?php echo $javascript; ?>
return {map: map, layers: layers, controls: controls, icons: icons};
}());</script>

View File

@@ -9,4 +9,4 @@
</div>
<!-- indexer::continue -->
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript .'</script>'; ?>
<?php $GLOBALS['TL_BODY'][] = '<script>' . $this->javascript . '</script>'; ?>

View File

@@ -3,7 +3,6 @@
padding: 15px;
}
.netzmacht-leaflet-credits a {
color: #669A00;
}
@@ -17,7 +16,7 @@
.netzmacht-leaflet-credits h1 {
color: #fff;
font-size: 1.4em;
text-shadow: 0 -1px 1px rgba(0,0,0,0.35);
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.35);
}
.netzmacht-leaflet-credits .row:after {

View File

@@ -1,9 +1,9 @@
.tl_listing_container.tree_view ul > li.tl_file {
.tl_listing_container.tree_view ul > li.tl_file {
background: url('./../img/fol-placeholder.gif') no-repeat 6px 4px;
}
.tl_listing_container.tree_view ul > li.tl_file > div {
.tl_listing_container.tree_view ul > li.tl_file > div {
line-height: 18px;
}
@@ -11,15 +11,15 @@
padding-left: 26px;
}
.tl_listing_container.tree_view ul > li.parent > ul {
.tl_listing_container.tree_view ul > li.parent > ul {
padding-left: 20px;
}
.tl_listing_container.tree_view ul > li > .tl_left > a {
.tl_listing_container.tree_view ul > li > .tl_left > a {
margin-left: -20px;
}
.tl_listing_container.tree_view ul[class="level_1"] li.tl_file > .tl_left {
.tl_listing_container.tree_view ul[class="level_1"] li.tl_file > .tl_left {
padding-left: 20px !important;
}

View File

@@ -30,7 +30,7 @@ var ContaoLeafletAjaxRequest = {
published = (image.get('data-state') == 1),
div = el.getParent('div'),
index, next, icon, icond, pa;
img = div.getParent('li').getFirst('.tl_left img.list-icon');
img = div.getParent('li').getFirst('.tl_left img.list-icon');
// Change the icon
if (img !== null && img.nodeName.toLowerCase() == 'img') {

View File

@@ -44,7 +44,7 @@ class ContaoAssets implements Assets
private $cache = [
'stylesheets' => [],
'javascripts' => [],
'map' => []
'map' => [],
];
/**

View File

@@ -34,7 +34,7 @@ class EncoderSubscriber implements EventSubscriberInterface
public static function getSubscribedEvents()
{
return [
EncodeValueEvent::NAME => [
EncodeValueEvent::NAME => [
['encodeIcons', 1000],
['loadLayer', 100],
],

View File

@@ -68,7 +68,7 @@ class BboxFilter implements Filter
*/
public function getValues()
{
return array('bounds' => $this->bounds);
return ['bounds' => $this->bounds];
}
/**

View File

@@ -88,9 +88,9 @@ class DistanceFilter implements Filter
*/
public function getValues()
{
return array(
return [
'radius' => $this->radius,
'center' => $this->center
);
'center' => $this->center,
];
}
}

View File

@@ -28,13 +28,13 @@ class DataController
*
* @var array
*/
private $input = array(
private $input = [
'format' => 'geojson',
'type' => 'layer',
'id' => null,
'filter' => null,
'values' => null
);
'values' => null,
];
/**
* Debug mode.
@@ -140,9 +140,9 @@ class DataController
default:
$error = true;
return array($data, $error);
return [$data, $error];
}
return array($data, $error);
return [$data, $error];
}
}

View File

@@ -57,12 +57,12 @@ class RequestUrl implements \JsonSerializable
*/
public static function create($dataId, $type = null, $format = null, Request $request = null)
{
$params = array(
$params = [
'for' => $request ? $request->getMapIdentifier() : null,
'type' => $type != 'layer' ? $type : null,
'id' => $dataId,
'format' => $format != 'geojson' ? $format : null
);
'format' => $format != 'geojson' ? $format : null,
];
$hash = base64_encode(implode(',', $params));
$query = 'leaflet=' . $hash;

View File

@@ -110,7 +110,7 @@ class ControlDcaListener extends AbstractListener
*/
public function getZoomControls()
{
$collection = ControlModel::findBy('type', 'zoom', array('order' => 'title'));
$collection = ControlModel::findBy('type', 'zoom', ['order' => 'title']);
return OptionsBuilder::fromCollection($collection, 'title')->getOptions();
}
@@ -166,7 +166,7 @@ class ControlDcaListener extends AbstractListener
'lid' => $layer['layer'],
'cid' => $dataContainer->id,
'mode' => $layer['mode'],
'sorting' => $sorting
'sorting' => $sorting,
];
$this->connection->insert('tl_leaflet_control_layer', $data);
@@ -177,10 +177,10 @@ class ControlDcaListener extends AbstractListener
[
'tstamp' => time(),
'sorting' => $sorting,
'mode' => $layer['mode']
'mode' => $layer['mode'],
],
[
'id' => $values[$layer['layer']]['id']
'id' => $values[$layer['layer']]['id'],
]
);

View File

@@ -52,7 +52,7 @@ class LayerDcaListener extends AbstractListener
* @var Connection
*/
private $connection;
/**
* Tile providers configuration.
*
@@ -149,7 +149,7 @@ class LayerDcaListener extends AbstractListener
return $this->tileProviders[$dataContainer->activeRecord->tile_provider]['variants'];
}
return array();
return [];
}
/**
@@ -233,8 +233,8 @@ class LayerDcaListener extends AbstractListener
public function getPasteButtons($dataContainer, $row, $table, $whatever, $children)
{
$pasteAfterUrl = \Controller::addToUrl(
'act='.$children['mode'].'&amp;mode=1&amp;pid='.$row['id']
.(!is_array($children['id']) ? '&amp;id='.$children['id'] : '')
'act=' . $children['mode'] . '&amp;mode=1&amp;pid=' . $row['id']
. (!is_array($children['id']) ? '&amp;id=' . $children['id'] : '')
. '&amp;rt=' . RequestToken::get()
);
@@ -254,7 +254,7 @@ class LayerDcaListener extends AbstractListener
'act=%s&amp;mode=2&amp;pid=%s%s',
$children['mode'],
$row['id'],
!is_array($children['id']) ? '&amp;id='.$children['id'] : ''
!is_array($children['id']) ? '&amp;id=' . $children['id'] : ''
) . '&amp;rt=' . RequestToken::get()
);
@@ -365,7 +365,7 @@ class LayerDcaListener extends AbstractListener
*/
public function getBoundsModes($dataContainer)
{
$options = array();
$options = [];
if ($dataContainer->activeRecord && !empty($this->layers[$dataContainer->activeRecord->type]['boundsMode'])) {
foreach ($this->layers[$dataContainer->activeRecord->type]['boundsMode'] as $mode => $enabled) {
@@ -413,7 +413,7 @@ class LayerDcaListener extends AbstractListener
*/
public function getIcons()
{
$collection = IconModel::findAll(array('order' => 'title'));
$collection = IconModel::findAll(['order' => 'title']);
$builder = OptionsBuilder::fromCollection(
$collection,
function ($model) {

View File

@@ -100,8 +100,8 @@ class LeafletDcaListener
*/
public function getLayers()
{
$options = array();
$collection = LayerModel::findBy('pid', '0', array('order' => 'title'));
$options = [];
$collection = LayerModel::findBy('pid', '0', ['order' => 'title']);
if ($collection) {
foreach ($collection as $model) {

View File

@@ -90,7 +90,7 @@ class MapDcaListener extends AbstractListener
public function saveLayerRelations($layerId, $dataContainer)
{
$new = array_filter(StringUtil::deserialize($layerId, true));
$values = array();
$values = [];
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting');
$statement->bindValue('mid', $dataContainer->id);
@@ -108,7 +108,7 @@ class MapDcaListener extends AbstractListener
'tstamp' => time(),
'lid' => $layerId,
'mid' => $dataContainer->id,
'sorting' => $sorting
'sorting' => $sorting,
];
$this->connection->insert('tl_leaflet_map_layer', $data);

View File

@@ -71,7 +71,7 @@ class MarkerDcaListener
*/
public function getIcons()
{
$collection = IconModel::findAll(array('order' => 'title'));
$collection = IconModel::findAll(['order' => 'title']);
$builder = OptionsBuilder::fromCollection(
$collection,
function ($model) {
@@ -89,7 +89,7 @@ class MarkerDcaListener
*/
public function getPopups()
{
$collection = PopupModel::findAll(array('order' => 'title'));
$collection = PopupModel::findAll(['order' => 'title']);
$builder = OptionsBuilder::fromCollection($collection, 'title');
return $builder->getOptions();
@@ -105,11 +105,11 @@ class MarkerDcaListener
*/
public function saveCoordinates($value, $dataContainer)
{
$combined = array(
$combined = [
'latitude' => null,
'longitude' => null,
'altitude' => null
);
'altitude' => null,
];
$values = trimsplit(',', $value);
$keys = array_keys($combined);

View File

@@ -86,7 +86,7 @@ class VectorDcaListener extends AbstractListener
*/
public function getStyles()
{
$collection = StyleModel::findAll(array('order' => 'title'));
$collection = StyleModel::findAll(['order' => 'title']);
return OptionsBuilder::fromCollection($collection, 'title')->getOptions();
}
@@ -98,7 +98,7 @@ class VectorDcaListener extends AbstractListener
*/
public function getIcons()
{
$collection = IconModel::findAll(array('order' => 'title'));
$collection = IconModel::findAll(['order' => 'title']);
$builder = OptionsBuilder::fromCollection(
$collection,
function ($model) {
@@ -116,7 +116,7 @@ class VectorDcaListener extends AbstractListener
*/
public function getPopups()
{
$collection = PopupModel::findAll(array('order' => 'title'));
$collection = PopupModel::findAll(['order' => 'title']);
$builder = OptionsBuilder::fromCollection($collection, 'title');
return $builder->getOptions();

View File

@@ -123,7 +123,7 @@ final class GeoJsonListener
public function enrichCircle(GeoJsonObject $feature, LeafletDefinition $definition)
{
if ($definition instanceof Circle && !$definition instanceof CircleMarker && $feature instanceof Feature) {
$feature->setProperty('arguments', array($definition->getLatLng(), $definition->getRadius()));
$feature->setProperty('arguments', [$definition->getLatLng(), $definition->getRadius()]);
}
}
@@ -186,7 +186,7 @@ final class GeoJsonListener
if ($collection) {
$value = $collection->fetchEach('path');
} else {
$value = array();
$value = [];
}
break;

View File

@@ -27,12 +27,12 @@ class HashSubscriber implements EventSubscriberInterface
*/
public static function getSubscribedEvents()
{
return array(
GetHashEvent::NAME => array(
array('getModelHash'),
array('getFallback', -100)
)
);
return [
GetHashEvent::NAME => [
['getModelHash'],
['getFallback', -100],
],
];
}
/**

View File

@@ -127,12 +127,12 @@ class LoadAssetsListener
$assets = $this->libraries[$library];
if (!empty($assets['css'])) {
list ($source, $type) = (array)$assets['css'];
list ($source, $type) = (array) $assets['css'];
$this->assets->addStylesheet($source, $type ?: Assets::TYPE_FILE);
}
if (!empty($assets['javascript'])) {
list ($source, $type) = (array)$assets['javascript'];
list ($source, $type) = (array) $assets['javascript'];
$this->assets->addJavascript($source, $type ?: Assets::TYPE_FILE);
}
}

View File

@@ -201,8 +201,8 @@ class MapProvider
$this->cache->save(
$cacheKey,
[
'assets' => $this->assets->toArray(),
'javascript' => $buffer
'assets' => $this->assets->toArray(),
'javascript' => $buffer,
],
(int) $model->cacheLifeTime
);
@@ -279,7 +279,7 @@ class MapProvider
throw new \RuntimeException('Bad request. Could not resolve query params');
}
$data = array_combine(array('for', 'type', 'id', 'format', 'filter', 'values'), $data);
$data = array_combine(['for', 'type', 'id', 'format', 'filter', 'values'], $data);
$data = array_filter($data);
if (empty($data['for']) || $data['for'] != $identifier) {

View File

@@ -156,9 +156,9 @@ abstract class AbstractMapper implements Mapper
Request $request = null,
$elementId = null
) {
return array(
$this->getElementId($model, $elementId)
);
return [
$this->getElementId($model, $elementId),
];
}
/**

View File

@@ -49,8 +49,8 @@ class LayersControlMapper extends AbstractControlMapper
$elementId = null
) {
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
$arguments[1] = array();
$arguments[2] = array();
$arguments[1] = [];
$arguments[2] = [];
/** @var ControlModel $model */
$collection = $model->findActiveLayers();

View File

@@ -80,8 +80,8 @@ class LoadingControlMapper extends AbstractControlMapper
if ($definition instanceof LoadingControl && !$definition->isSeparate() && $model->zoomControl) {
// Only assign if zoom control is activated and part of the map.
$control = ControlModel::findOneBy(
array('active=1', 'type=?', 'pid=?', 'id=?'),
array('zoom', $model->pid, $model->zoomControl)
['active=1', 'type=?', 'pid=?', 'id=?'],
['zoom', $model->pid, $model->zoomControl]
);
if ($control) {

View File

@@ -34,7 +34,7 @@ class DefinitionMapper
*
* @var Mapper[][]
*/
private $mappers = array();
private $mappers = [];
/**
* The event dispatcher.
@@ -48,7 +48,7 @@ class DefinitionMapper
*
* @var array
*/
private $mapped = array();
private $mapped = [];
/**
* Construct.
@@ -84,7 +84,7 @@ class DefinitionMapper
*/
public function reset()
{
$this->mapped = array();
$this->mapped = [];
return $this;
}

View File

@@ -62,9 +62,9 @@ class GroupLayerMapper extends AbstractLayerMapper
}
$collection = LayerModel::findBy(
array('pid=?', 'active=1'),
array($model->id),
array('order' => 'sorting')
['pid=?', 'active=1'],
[$model->id],
['order' => 'sorting']
);
if ($collection) {

View File

@@ -108,9 +108,9 @@ class MarkerClusterLayerMapper extends AbstractLayerMapper
}
$collection = LayerModel::findBy(
array('pid=?', 'active=1'),
array($model->id),
array('order' => 'sorting')
['pid=?', 'active=1'],
[$model->id],
['order' => 'sorting']
);
if ($collection) {

View File

@@ -71,18 +71,18 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
$layer->setOption('boundsMode', $model->boundsMode);
}
return array(
return [
$this->getElementId($model, $elementId),
RequestUrl::create($model->id, null, null, $request),
array(),
$layer
);
[],
$layer,
];
}
return array(
return [
$this->getElementId($model, $elementId),
RequestUrl::create($model->id, null, null, $request)
);
RequestUrl::create($model->id, null, null, $request),
];
}
return parent::buildConstructArguments($model, $mapper, $request, $elementId);

View File

@@ -92,10 +92,10 @@ class ProviderLayerMapper extends AbstractLayerMapper
Request $request = null,
$elementId = null
) {
return array(
return [
$model->alias ?: ('layer_' . $model->id),
$model->tile_provider,
$model->tile_provider_variant ?: null
);
$model->tile_provider_variant ?: null,
];
}
}

View File

@@ -61,7 +61,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
$elementId = null
) {
if ($model->deferred) {
$options = array();
$options = [];
if ($model->pointToLayer) {
$options['pointToLayer'] = new Expression($model->pointToLayer);
@@ -79,18 +79,18 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
$layer = new GeoJson($this->getElementId($model, $elementId));
$layer->setOptions($options);
return array(
return [
$this->getElementId($model, $elementId),
RequestUrl::create($model->id, null, null, $request),
array(),
$layer
);
[],
$layer,
];
}
return array(
return [
$this->getElementId($model, $elementId),
RequestUrl::create($model->id, null, null, $request)
);
RequestUrl::create($model->id, null, null, $request),
];
}
return parent::buildConstructArguments($model, $mapper, $request, $elementId);

View File

@@ -50,8 +50,8 @@ class MapMapper extends AbstractMapper
->addOptions('center', 'zoom', 'zoomControl')
->addOptions('dragging', 'touchZoom', 'scrollWheelZoom', 'doubleClickZoom', 'boxZoom', 'tap', 'keyboard')
->addOptions('trackResize', 'closeOnClick', 'bounceAtZoomLimits')
->addConditionalOptions('adjustZoomExtra', array('minZoom', 'maxZoom', 'zoomSnap', 'zoomDelta'))
->addConditionalOptions('keyboard', array('keyboardPanOffset', 'keyboardZoomOffset'));
->addConditionalOptions('adjustZoomExtra', ['minZoom', 'maxZoom', 'zoomSnap', 'zoomDelta'])
->addConditionalOptions('keyboard', ['keyboardPanOffset', 'keyboardZoomOffset']);
}
/**
@@ -82,10 +82,10 @@ class MapMapper extends AbstractMapper
Request $request = null,
$elementId = null
) {
return array(
return [
$this->getElementId($model, $elementId),
$this->getElementId($model, $elementId)
);
$this->getElementId($model, $elementId),
];
}
/**
@@ -121,7 +121,7 @@ class MapMapper extends AbstractMapper
*/
private function buildControls(Map $map, MapModel $model, DefinitionMapper $mapper, Request $request = null)
{
$collection = ControlModel::findActiveBy('pid', $model->id, array('order' => 'sorting'));
$collection = ControlModel::findActiveBy('pid', $model->id, ['order' => 'sorting']);
if (!$collection) {
return;
@@ -207,13 +207,13 @@ class MapMapper extends AbstractMapper
private function buildLocate(Map $map, MapModel $model)
{
if ($model->locate) {
$options = array();
$options = [];
$mapping = array(
$mapping = [
'setView' => 'locateSetView',
'watch' => 'locateWatch',
'enableHighAccuracy' => 'enableHighAccuracy',
);
];
foreach ($mapping as $option => $property) {
if ($model->$property) {
@@ -221,11 +221,11 @@ class MapMapper extends AbstractMapper
}
}
$mapping = array(
$mapping = [
'maxZoom' => 'locateMaxZoom',
'timeout' => 'locateTimeout',
'maximumAge' => 'locateMaximumAge',
);
];
foreach ($mapping as $option => $property) {
if ($model->$property) {

View File

@@ -9,6 +9,7 @@
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
namespace Netzmacht\Contao\Leaflet\Mapper;
use Contao\Model;
@@ -30,14 +31,14 @@ class OptionsBuilder
*
* @var array
*/
private $options = array();
private $options = [];
/**
* Conditional option mapping.
*
* @var array
*/
private $conditional = array();
private $conditional = [];
/**
* Add a option mapping.
@@ -253,7 +254,7 @@ class OptionsBuilder
*/
private static function getDefaultOption($option, $definition)
{
$keys = array('has', 'is', 'get');
$keys = ['has', 'is', 'get'];
$suffix = ucfirst($option);
foreach ($keys as $key) {

View File

@@ -48,7 +48,7 @@ class FixedStyleMapper extends AbstractStyleMapper
->addConditionalOption('lineCap')
->addConditionalOption('lineJoin')
->addConditionalOption('dashArray')
->addConditionalOptions('fill', array('fillColor', 'fillOpacity'))
->addConditionalOptions('fill', ['fillColor', 'fillOpacity'])
->addOption('fill');
}
}

View File

@@ -95,14 +95,14 @@ class ImageIconMapper extends AbstractIconMapper
$definition->setIconUrl($file->path);
$file = new \File($file->path);
$definition->setIconSize(array($file->width, $file->height));
$definition->setIconSize([$file->width, $file->height]);
if (!$model->iconAnchor) {
$definition->setIconAnchor(array($file->width / 2, $file->height));
$definition->setIconAnchor([($file->width / 2), $file->height]);
}
if (!$model->popupAnchor) {
$definition->setPopupAnchor(array(0, 8 - $file->height));
$definition->setPopupAnchor([0, (8 - $file->height)]);
}
}
}
@@ -137,10 +137,10 @@ class ImageIconMapper extends AbstractIconMapper
$definition->setShadowUrl($file->path);
$file = new \File($file->path);
$definition->setShadowSize(array($file->width, $file->height));
$definition->setShadowSize([$file->width, $file->height]);
if (!$model->shadowAnchor) {
$definition->setShadowAnchor(array($file->width / 2, $file->height));
$definition->setShadowAnchor([($file->width / 2), $file->height]);
}
}
}

View File

@@ -75,7 +75,7 @@ class MarkerMapper extends AbstractMapper
$elementId = null
) {
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
$arguments[] = array($model->latitude, $model->longitude, $model->altitude ?: null) ?: null;
$arguments[] = [$model->latitude, $model->longitude, $model->altitude ?: null] ?: null;
return $arguments;
}
@@ -124,9 +124,9 @@ class MarkerMapper extends AbstractMapper
if ($model->customIcon) {
$iconModel = IconModel::findBy(
array('id=?', 'active=1'),
array($model->icon),
array('return' => 'Model')
['id=?', 'active=1'],
[$model->icon],
['return' => 'Model']
);
if ($iconModel) {

View File

@@ -29,7 +29,7 @@ abstract class AbstractActiveModel extends \Model
*
* @return \Model|null
*/
public static function findActiveByPK($modelId, $options = array())
public static function findActiveByPK($modelId, $options = [])
{
return static::findOneBy('active=1 AND id', $modelId, $options);
}
@@ -43,7 +43,7 @@ abstract class AbstractActiveModel extends \Model
*
* @return Collection|null
*/
public static function findActiveBy($column, $value, $options = array())
public static function findActiveBy($column, $value, $options = [])
{
if (is_array($column)) {
$column[] = 'active=1';
@@ -61,7 +61,7 @@ abstract class AbstractActiveModel extends \Model
*
* @return Collection|null
*/
public static function findActives($options = array())
public static function findActives($options = [])
{
return static::findBy('active', '1', $options);
}

View File

@@ -42,18 +42,18 @@ class LayerModel extends AbstractActiveModel
*
* @return Collection|null
*/
public static function findMultipleByTypes(array $types, $options = array())
public static function findMultipleByTypes(array $types, $options = [])
{
if (empty($types)) {
return null;
}
$options['column'] = array(
$options['column'] = [
sprintf(
'type IN (%s)',
substr(str_repeat('?,', count($types)), 0, -1)
)
);
),
];
$options['value'] = $types;
$options['return'] = 'Collection';

View File

@@ -41,7 +41,7 @@ class MarkerModel extends AbstractActiveModel
public static function findByFilter($pid, Filter $filter = null)
{
if (!$filter) {
return static::findActiveBy('pid', $pid, array('order' => 'sorting'));
return static::findActiveBy('pid', $pid, ['order' => 'sorting']);
}
switch ($filter->getName()) {
@@ -63,23 +63,23 @@ class MarkerModel extends AbstractActiveModel
*/
public static function findByBBoxFilter($pid, BboxFilter $filter)
{
$columns = array(
$columns = [
'active=1',
'pid=?',
'latitude > ? AND latitude < ?',
'longitude > ? AND longitude < ?'
);
'longitude > ? AND longitude < ?',
];
/** @var LatLngBounds $bounds */
$bounds = $filter->getValues()['bounds'];
$values = array(
$values = [
$pid,
$bounds->getSouthWest()->getLatitude(),
$bounds->getNorthEast()->getLatitude(),
$bounds->getSouthWest()->getLongitude(),
$bounds->getNorthEast()->getLongitude()
);
$bounds->getNorthEast()->getLongitude(),
];
return static::findBy($columns, $values, array('order' => 'sorting'));
return static::findBy($columns, $values, ['order' => 'sorting']);
}
}