From c465b724f44c27251affe6a284fd1749b86d987d Mon Sep 17 00:00:00 2001 From: David Molineus Date: Tue, 17 Oct 2017 18:11:28 +0200 Subject: [PATCH] Convert array syntax and other minor code style adjustments. --- src/Backend/About.php | 16 +- src/Bundle/ContaoManager/Plugin.php | 2 +- .../NetzmachtContaoLeafletExtension.php | 2 +- src/Bundle/Resources/contao/config/config.php | 38 ++- .../Resources/contao/dca/tl_leaflet_layer.php | 2 +- .../Resources/contao/languages/de/leaflet.php | 4 +- .../Resources/contao/languages/de/modules.php | 4 +- .../contao/languages/de/tl_content.php | 4 +- .../languages/de/tl_leaflet_control.php | 4 +- .../contao/languages/de/tl_leaflet_icon.php | 4 +- .../contao/languages/de/tl_leaflet_layer.php | 4 +- .../contao/languages/de/tl_leaflet_map.php | 4 +- .../contao/languages/de/tl_leaflet_marker.php | 4 +- .../contao/languages/de/tl_leaflet_popup.php | 4 +- .../contao/languages/de/tl_leaflet_style.php | 4 +- .../contao/languages/de/tl_leaflet_vector.php | 4 +- .../contao/languages/de/tl_module.php | 4 +- .../Resources/contao/languages/en/modules.php | 8 +- .../languages/en/tl_leaflet_control.php | 4 +- .../contao/languages/en/tl_leaflet_map.php | 168 ++++++------ .../contao/languages/en/tl_leaflet_marker.php | 2 +- .../contao/languages/en/tl_leaflet_vector.php | 2 +- .../contao/templates/be_leaflet_about.html5 | 239 ++++++++++-------- .../contao/templates/be_leaflet_geocode.html5 | 12 +- .../contao/templates/ce_leaflet_map.html5 | 2 +- .../contao/templates/leaflet_map_html.html5 | 8 +- .../contao/templates/mod_leaflet_map.html5 | 2 +- src/Bundle/Resources/public/css/about.css | 3 +- src/Bundle/Resources/public/css/backend.css | 10 +- src/Bundle/Resources/public/js/backend.js | 2 +- src/Encoder/ContaoAssets.php | 2 +- src/Encoder/Subscriber/EncoderSubscriber.php | 2 +- src/Filter/BboxFilter.php | 2 +- src/Filter/DistanceFilter.php | 6 +- src/Frontend/DataController.php | 10 +- src/Frontend/RequestUrl.php | 6 +- src/Listener/Dca/ControlDcaListener.php | 8 +- src/Listener/Dca/LayerDcaListener.php | 14 +- src/Listener/Dca/LeafletDcaListener.php | 4 +- src/Listener/Dca/MapDcaListener.php | 4 +- src/Listener/Dca/MarkerDcaListener.php | 10 +- src/Listener/Dca/VectorDcaListener.php | 6 +- src/Listener/GeoJsonListener.php | 4 +- src/Listener/HashSubscriber.php | 12 +- src/Listener/LoadAssetsListener.php | 4 +- src/MapProvider.php | 6 +- src/Mapper/AbstractMapper.php | 6 +- src/Mapper/Control/LayersControlMapper.php | 4 +- src/Mapper/Control/LoadingControlMapper.php | 4 +- src/Mapper/DefinitionMapper.php | 6 +- src/Mapper/Layer/GroupLayerMapper.php | 6 +- src/Mapper/Layer/MarkerClusterLayerMapper.php | 6 +- src/Mapper/Layer/MarkersLayerMapper.php | 14 +- src/Mapper/Layer/ProviderLayerMapper.php | 6 +- src/Mapper/Layer/VectorsLayerMapper.php | 16 +- src/Mapper/MapMapper.php | 22 +- src/Mapper/OptionsBuilder.php | 7 +- src/Mapper/Style/FixedStyleMapper.php | 2 +- src/Mapper/Type/ImageIconMapper.php | 10 +- src/Mapper/UI/MarkerMapper.php | 8 +- src/Model/AbstractActiveModel.php | 6 +- src/Model/LayerModel.php | 8 +- src/Model/MarkerModel.php | 16 +- 63 files changed, 413 insertions(+), 404 deletions(-) diff --git a/src/Backend/About.php b/src/Backend/About.php index c969717..50c9e13 100644 --- a/src/Backend/About.php +++ b/src/Backend/About.php @@ -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( 'Visit packagist', $package['name'] - ) - ); + ), + ]; } } - return array($version, $deps); + return [$version, $deps]; } } diff --git a/src/Bundle/ContaoManager/Plugin.php b/src/Bundle/ContaoManager/Plugin.php index a9facf6..8033179 100644 --- a/src/Bundle/ContaoManager/Plugin.php +++ b/src/Bundle/ContaoManager/Plugin.php @@ -36,7 +36,7 @@ class Plugin implements BundlePluginInterface return [ BundleConfig::create(NetzmachtContaoLeafletBundle::class) ->setLoadAfter([ContaoCoreBundle::class, NetzmachtContaoToolkitBundle::class]) - ->setReplace(['leaflet']) + ->setReplace(['leaflet']), ]; } } diff --git a/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php b/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php index ef67a2e..2dc6a92 100644 --- a/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php +++ b/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php @@ -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 diff --git a/src/Bundle/Resources/contao/config/config.php b/src/Bundle/Resources/contao/config/config.php index 38abba6..a823af9 100644 --- a/src/Bundle/Resources/contao/config/config.php +++ b/src/Bundle/Resources/contao/config/config.php @@ -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', ]; diff --git a/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php b/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php index 3f2ff03..836b266 100644 --- a/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php +++ b/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php @@ -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', diff --git a/src/Bundle/Resources/contao/languages/de/leaflet.php b/src/Bundle/Resources/contao/languages/de/leaflet.php index 8bbaeb8..ede2d01 100644 --- a/src/Bundle/Resources/contao/languages/de/leaflet.php +++ b/src/Bundle/Resources/contao/languages/de/leaflet.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/modules.php b/src/Bundle/Resources/contao/languages/de/modules.php index 1e72d97..84f21aa 100644 --- a/src/Bundle/Resources/contao/languages/de/modules.php +++ b/src/Bundle/Resources/contao/languages/de/modules.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_content.php b/src/Bundle/Resources/contao/languages/de/tl_content.php index 7d8f63e..5681a37 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_content.php +++ b/src/Bundle/Resources/contao/languages/de/tl_content.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_control.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_control.php index 2b477aa..526a8dd 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_control.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_control.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_icon.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_icon.php index f25261d..85f126e 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_icon.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_icon.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_layer.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_layer.php index 044f407..0815d93 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_layer.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_layer.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_map.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_map.php index 65f5080..26c78e6 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_map.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_map.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_marker.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_marker.php index d98e0bc..a9ec43c 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_marker.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_marker.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_popup.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_popup.php index e7e0249..e3f782b 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_popup.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_popup.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_style.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_style.php index 32a1b0d..0602c3f 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_style.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_style.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_leaflet_vector.php b/src/Bundle/Resources/contao/languages/de/tl_leaflet_vector.php index 81a76ad..5d1424e 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_leaflet_vector.php +++ b/src/Bundle/Resources/contao/languages/de/tl_leaflet_vector.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/de/tl_module.php b/src/Bundle/Resources/contao/languages/de/tl_module.php index 4cbe8f3..2e4f5f4 100644 --- a/src/Bundle/Resources/contao/languages/de/tl_module.php +++ b/src/Bundle/Resources/contao/languages/de/tl_module.php @@ -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 * diff --git a/src/Bundle/Resources/contao/languages/en/modules.php b/src/Bundle/Resources/contao/languages/en/modules.php index 81c3839..f2b1520 100644 --- a/src/Bundle/Resources/contao/languages/en/modules.php +++ b/src/Bundle/Resources/contao/languages/en/modules.php @@ -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.'; diff --git a/src/Bundle/Resources/contao/languages/en/tl_leaflet_control.php b/src/Bundle/Resources/contao/languages/en/tl_leaflet_control.php index d831d2f..c295e58 100644 --- a/src/Bundle/Resources/contao/languages/en/tl_leaflet_control.php +++ b/src/Bundle/Resources/contao/languages/en/tl_leaflet_control.php @@ -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.'; diff --git a/src/Bundle/Resources/contao/languages/en/tl_leaflet_map.php b/src/Bundle/Resources/contao/languages/en/tl_leaflet_map.php index d11b6f5..e1cc78c 100644 --- a/src/Bundle/Resources/contao/languages/en/tl_leaflet_map.php +++ b/src/Bundle/Resources/contao/languages/en/tl_leaflet_map.php @@ -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 http://leafletjs.com/reference.html#map-options'; -$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 locationfound 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 description in the W3C spec.'; -$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 padding option is set. If 4 values are given paddingTopLeft and paddingBottomRight 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 http://leafletjs.com/reference.html#map-options'; +$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 locationfound 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 description in the W3C spec.'; +$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 padding option is set. If 4 values are given paddingTopLeft and paddingBottomRight 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.'; diff --git a/src/Bundle/Resources/contao/languages/en/tl_leaflet_marker.php b/src/Bundle/Resources/contao/languages/en/tl_leaflet_marker.php index b4bf310..03e0398 100644 --- a/src/Bundle/Resources/contao/languages/en/tl_leaflet_marker.php +++ b/src/Bundle/Resources/contao/languages/en/tl_leaflet_marker.php @@ -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'; diff --git a/src/Bundle/Resources/contao/languages/en/tl_leaflet_vector.php b/src/Bundle/Resources/contao/languages/en/tl_leaflet_vector.php index 0d57c68..5244899 100644 --- a/src/Bundle/Resources/contao/languages/en/tl_leaflet_vector.php +++ b/src/Bundle/Resources/contao/languages/en/tl_leaflet_vector.php @@ -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'; diff --git a/src/Bundle/Resources/contao/templates/be_leaflet_about.html5 b/src/Bundle/Resources/contao/templates/be_leaflet_about.html5 index c859416..dfa1178 100644 --- a/src/Bundle/Resources/contao/templates/be_leaflet_about.html5 +++ b/src/Bundle/Resources/contao/templates/be_leaflet_about.html5 @@ -1,125 +1,140 @@
-
-

headline; ?> version; ?>

-
- -
-

About

-
-

- 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. -

-

- This software ships with an visible attribution to netzmacht creative in the map attribution control. - If you want to remove this attribution, you have to purchase a commercial license. - For more details visit the project website. -

+
+

headline; ?> + version; ?> +

-
- > - -

- netzmacht
- David Molineus
-

-

- DAB Bank München
- IBAN: DE52701204008354237003
- BIC: DABBDEMMXXX -

-
- - - - -
-
-
-
-

Support Contao Leaflet

- -
-
-

Report issues

-

If you found a bug, got some troubles or have a feature request - feel free to open an issue.

-

Issue tracker

-
-
-

Contribute

-

There are many ways you can con­tribute. Translations, - docu­mentation or code contributions are welcome. +

+

About

+
+

+ 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. +

+

+ This software ships with an visible attribution to netzmacht creative in the map attribution + control. + If you want to remove this attribution, you have to purchase a commercial license. + For more details visit the project + website.

-

Contribute

-
-

Fund a feature

-

Contao Leaflet is not feature complete. Have a look at the list of planned feature and support them.

-

Planned features

+
+ > + +

+ netzmacht
+ David Molineus
+

+

+ DAB Bank München
+ IBAN: DE52701204008354237003
+ BIC: DABBDEMMXXX +

+
+ + + + +
-
-
-

Individual development

-

If you have special requirements you can hire me for an individual development.

-

Contact

+
+

Support Contao Leaflet

+ +
+
+

Report issues

+

If you found a bug, got some troubles or have a feature request - feel free to open an issue.

+

Issue + tracker

+
+
+

Contribute

+

There are many ways you can con­tribute. Translations, + docu­mentation or code contributions are welcome. +

+

Contribute +

+
+
+

Fund a feature

+

Contao Leaflet is not feature complete. Have a look at the list of planned feature and support + them.

+

Planned + features

+
-
-

Commercial license

-

If you want to remove the attribution in the attribution control, you can purchase a commercial license.

-

Purchase license

+
+ +
+

Individual development

+

If you have special requirements you can hire me for an individual development.

+

Contact

+
+
+

Commercial license

+

If you want to remove the attribution in the attribution control, you can purchase a commercial + license.

+

Purchase + license

+
-
-
-

Credits

- - - - - - - - libraries): ?> - - - libraries as $library): ?> - - - - - - - - - - - - - - - - - - - - - - - dependencies): ?> - - - dependencies as $dep): ?> - - - - - - - -
NameVersionLicenseHomepage
Libraries
Graphics
Farm Fresh-Web Icons3.9.2CC BY 3.0 USfatcow.com/free-icons
Web Blog Icons by SEM Labs3.9.2CC BY 4.0semlabs.co.uk
Dependencies
-
+
+

Credits

+ + + + + + + + libraries): ?> + + + + + libraries as $library): ?> + + + + + + + + + + + + + + + + + + + + + + + dependencies): ?> + + + + + dependencies as $dep): ?> + + + + + + + +
NameVersionLicenseHomepage
Libraries
Graphics
Farm Fresh-Web Icons3.9.2CC BY 3.0 USfatcow.com/free-icons
Web Blog Icons by SEM Labs3.9.2CC BY 4.0semlabs.co.uk
Dependencies
+
diff --git a/src/Bundle/Resources/contao/templates/be_leaflet_geocode.html5 b/src/Bundle/Resources/contao/templates/be_leaflet_geocode.html5 index 842d1f5..6375db0 100644 --- a/src/Bundle/Resources/contao/templates/be_leaflet_geocode.html5 +++ b/src/Bundle/Resources/contao/templates/be_leaflet_geocode.html5 @@ -10,21 +10,21 @@ L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); - var element = $('field; ?>'); + var element = $('field; ?>'); var geocoder = L.Control.geocoder({ defaultMarkGeocode: false, collapsed: false, placeholder: '' }).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(''); - 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}) diff --git a/src/Bundle/Resources/contao/templates/ce_leaflet_map.html5 b/src/Bundle/Resources/contao/templates/ce_leaflet_map.html5 index 61563ff..d62880d 100644 --- a/src/Bundle/Resources/contao/templates/ce_leaflet_map.html5 +++ b/src/Bundle/Resources/contao/templates/ce_leaflet_map.html5 @@ -9,5 +9,5 @@
-' . $this->javascript .''; ?> +' . $this->javascript . ''; ?> diff --git a/src/Bundle/Resources/contao/templates/leaflet_map_html.html5 b/src/Bundle/Resources/contao/templates/leaflet_map_html.html5 index 3be0929..160b248 100644 --- a/src/Bundle/Resources/contao/templates/leaflet_map_html.html5 +++ b/src/Bundle/Resources/contao/templates/leaflet_map_html.html5 @@ -1,6 +1,6 @@
+ L.contao.addMap('', function () { + + return {map: map, layers: layers, controls: controls, icons: icons}; + }()); diff --git a/src/Bundle/Resources/contao/templates/mod_leaflet_map.html5 b/src/Bundle/Resources/contao/templates/mod_leaflet_map.html5 index e0138dd..6c7ffbd 100644 --- a/src/Bundle/Resources/contao/templates/mod_leaflet_map.html5 +++ b/src/Bundle/Resources/contao/templates/mod_leaflet_map.html5 @@ -9,4 +9,4 @@
-' . $this->javascript .''; ?> +' . $this->javascript . ''; ?> diff --git a/src/Bundle/Resources/public/css/about.css b/src/Bundle/Resources/public/css/about.css index 0e71c71..87f8827 100644 --- a/src/Bundle/Resources/public/css/about.css +++ b/src/Bundle/Resources/public/css/about.css @@ -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 { diff --git a/src/Bundle/Resources/public/css/backend.css b/src/Bundle/Resources/public/css/backend.css index 36cc7b9..09d7686 100644 --- a/src/Bundle/Resources/public/css/backend.css +++ b/src/Bundle/Resources/public/css/backend.css @@ -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; } diff --git a/src/Bundle/Resources/public/js/backend.js b/src/Bundle/Resources/public/js/backend.js index 1e5f383..94c802d 100644 --- a/src/Bundle/Resources/public/js/backend.js +++ b/src/Bundle/Resources/public/js/backend.js @@ -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') { diff --git a/src/Encoder/ContaoAssets.php b/src/Encoder/ContaoAssets.php index e3e39cc..902b21d 100644 --- a/src/Encoder/ContaoAssets.php +++ b/src/Encoder/ContaoAssets.php @@ -44,7 +44,7 @@ class ContaoAssets implements Assets private $cache = [ 'stylesheets' => [], 'javascripts' => [], - 'map' => [] + 'map' => [], ]; /** diff --git a/src/Encoder/Subscriber/EncoderSubscriber.php b/src/Encoder/Subscriber/EncoderSubscriber.php index db11ad0..55fe1eb 100644 --- a/src/Encoder/Subscriber/EncoderSubscriber.php +++ b/src/Encoder/Subscriber/EncoderSubscriber.php @@ -34,7 +34,7 @@ class EncoderSubscriber implements EventSubscriberInterface public static function getSubscribedEvents() { return [ - EncodeValueEvent::NAME => [ + EncodeValueEvent::NAME => [ ['encodeIcons', 1000], ['loadLayer', 100], ], diff --git a/src/Filter/BboxFilter.php b/src/Filter/BboxFilter.php index d319abe..4b637e8 100644 --- a/src/Filter/BboxFilter.php +++ b/src/Filter/BboxFilter.php @@ -68,7 +68,7 @@ class BboxFilter implements Filter */ public function getValues() { - return array('bounds' => $this->bounds); + return ['bounds' => $this->bounds]; } /** diff --git a/src/Filter/DistanceFilter.php b/src/Filter/DistanceFilter.php index 590ce57..6c062e3 100644 --- a/src/Filter/DistanceFilter.php +++ b/src/Filter/DistanceFilter.php @@ -88,9 +88,9 @@ class DistanceFilter implements Filter */ public function getValues() { - return array( + return [ 'radius' => $this->radius, - 'center' => $this->center - ); + 'center' => $this->center, + ]; } } diff --git a/src/Frontend/DataController.php b/src/Frontend/DataController.php index 166f522..c5dd4cc 100644 --- a/src/Frontend/DataController.php +++ b/src/Frontend/DataController.php @@ -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]; } } diff --git a/src/Frontend/RequestUrl.php b/src/Frontend/RequestUrl.php index 4a6f038..8603a9d 100644 --- a/src/Frontend/RequestUrl.php +++ b/src/Frontend/RequestUrl.php @@ -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; diff --git a/src/Listener/Dca/ControlDcaListener.php b/src/Listener/Dca/ControlDcaListener.php index f9f33f4..b490b8f 100644 --- a/src/Listener/Dca/ControlDcaListener.php +++ b/src/Listener/Dca/ControlDcaListener.php @@ -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'], ] ); diff --git a/src/Listener/Dca/LayerDcaListener.php b/src/Listener/Dca/LayerDcaListener.php index d1ce1cd..23a2d6d 100644 --- a/src/Listener/Dca/LayerDcaListener.php +++ b/src/Listener/Dca/LayerDcaListener.php @@ -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'].'&mode=1&pid='.$row['id'] - .(!is_array($children['id']) ? '&id='.$children['id'] : '') + 'act=' . $children['mode'] . '&mode=1&pid=' . $row['id'] + . (!is_array($children['id']) ? '&id=' . $children['id'] : '') . '&rt=' . RequestToken::get() ); @@ -254,7 +254,7 @@ class LayerDcaListener extends AbstractListener 'act=%s&mode=2&pid=%s%s', $children['mode'], $row['id'], - !is_array($children['id']) ? '&id='.$children['id'] : '' + !is_array($children['id']) ? '&id=' . $children['id'] : '' ) . '&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) { diff --git a/src/Listener/Dca/LeafletDcaListener.php b/src/Listener/Dca/LeafletDcaListener.php index d9f5126..704538d 100644 --- a/src/Listener/Dca/LeafletDcaListener.php +++ b/src/Listener/Dca/LeafletDcaListener.php @@ -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) { diff --git a/src/Listener/Dca/MapDcaListener.php b/src/Listener/Dca/MapDcaListener.php index acc2c47..e6fa765 100644 --- a/src/Listener/Dca/MapDcaListener.php +++ b/src/Listener/Dca/MapDcaListener.php @@ -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); diff --git a/src/Listener/Dca/MarkerDcaListener.php b/src/Listener/Dca/MarkerDcaListener.php index 4fa565b..0ecb3f3 100644 --- a/src/Listener/Dca/MarkerDcaListener.php +++ b/src/Listener/Dca/MarkerDcaListener.php @@ -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); diff --git a/src/Listener/Dca/VectorDcaListener.php b/src/Listener/Dca/VectorDcaListener.php index a8aec5d..d9a99bd 100644 --- a/src/Listener/Dca/VectorDcaListener.php +++ b/src/Listener/Dca/VectorDcaListener.php @@ -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(); diff --git a/src/Listener/GeoJsonListener.php b/src/Listener/GeoJsonListener.php index c1f26f1..3719ea2 100644 --- a/src/Listener/GeoJsonListener.php +++ b/src/Listener/GeoJsonListener.php @@ -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; diff --git a/src/Listener/HashSubscriber.php b/src/Listener/HashSubscriber.php index bd4a9a8..ba375c0 100644 --- a/src/Listener/HashSubscriber.php +++ b/src/Listener/HashSubscriber.php @@ -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], + ], + ]; } /** diff --git a/src/Listener/LoadAssetsListener.php b/src/Listener/LoadAssetsListener.php index 652bf14..21c7a05 100644 --- a/src/Listener/LoadAssetsListener.php +++ b/src/Listener/LoadAssetsListener.php @@ -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); } } diff --git a/src/MapProvider.php b/src/MapProvider.php index 483ee32..2fd944d 100644 --- a/src/MapProvider.php +++ b/src/MapProvider.php @@ -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) { diff --git a/src/Mapper/AbstractMapper.php b/src/Mapper/AbstractMapper.php index 308418c..511da9d 100644 --- a/src/Mapper/AbstractMapper.php +++ b/src/Mapper/AbstractMapper.php @@ -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), + ]; } /** diff --git a/src/Mapper/Control/LayersControlMapper.php b/src/Mapper/Control/LayersControlMapper.php index 6ef2b0e..f9222be 100644 --- a/src/Mapper/Control/LayersControlMapper.php +++ b/src/Mapper/Control/LayersControlMapper.php @@ -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(); diff --git a/src/Mapper/Control/LoadingControlMapper.php b/src/Mapper/Control/LoadingControlMapper.php index f6a2986..8466a0e 100644 --- a/src/Mapper/Control/LoadingControlMapper.php +++ b/src/Mapper/Control/LoadingControlMapper.php @@ -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) { diff --git a/src/Mapper/DefinitionMapper.php b/src/Mapper/DefinitionMapper.php index e3e544f..331e4fe 100644 --- a/src/Mapper/DefinitionMapper.php +++ b/src/Mapper/DefinitionMapper.php @@ -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; } diff --git a/src/Mapper/Layer/GroupLayerMapper.php b/src/Mapper/Layer/GroupLayerMapper.php index 8292aa2..2c6d67e 100644 --- a/src/Mapper/Layer/GroupLayerMapper.php +++ b/src/Mapper/Layer/GroupLayerMapper.php @@ -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) { diff --git a/src/Mapper/Layer/MarkerClusterLayerMapper.php b/src/Mapper/Layer/MarkerClusterLayerMapper.php index b5ca318..f4a0e54 100644 --- a/src/Mapper/Layer/MarkerClusterLayerMapper.php +++ b/src/Mapper/Layer/MarkerClusterLayerMapper.php @@ -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) { diff --git a/src/Mapper/Layer/MarkersLayerMapper.php b/src/Mapper/Layer/MarkersLayerMapper.php index 5bea0ea..34d8652 100644 --- a/src/Mapper/Layer/MarkersLayerMapper.php +++ b/src/Mapper/Layer/MarkersLayerMapper.php @@ -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); diff --git a/src/Mapper/Layer/ProviderLayerMapper.php b/src/Mapper/Layer/ProviderLayerMapper.php index 7a98417..4b52a5d 100644 --- a/src/Mapper/Layer/ProviderLayerMapper.php +++ b/src/Mapper/Layer/ProviderLayerMapper.php @@ -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, + ]; } } diff --git a/src/Mapper/Layer/VectorsLayerMapper.php b/src/Mapper/Layer/VectorsLayerMapper.php index ab79f4f..879b6fc 100644 --- a/src/Mapper/Layer/VectorsLayerMapper.php +++ b/src/Mapper/Layer/VectorsLayerMapper.php @@ -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); diff --git a/src/Mapper/MapMapper.php b/src/Mapper/MapMapper.php index 05eb513..5ab4f04 100644 --- a/src/Mapper/MapMapper.php +++ b/src/Mapper/MapMapper.php @@ -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) { diff --git a/src/Mapper/OptionsBuilder.php b/src/Mapper/OptionsBuilder.php index 01522f4..c6b307b 100644 --- a/src/Mapper/OptionsBuilder.php +++ b/src/Mapper/OptionsBuilder.php @@ -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) { diff --git a/src/Mapper/Style/FixedStyleMapper.php b/src/Mapper/Style/FixedStyleMapper.php index 16ad970..5441374 100644 --- a/src/Mapper/Style/FixedStyleMapper.php +++ b/src/Mapper/Style/FixedStyleMapper.php @@ -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'); } } diff --git a/src/Mapper/Type/ImageIconMapper.php b/src/Mapper/Type/ImageIconMapper.php index 134b1e9..f312b13 100644 --- a/src/Mapper/Type/ImageIconMapper.php +++ b/src/Mapper/Type/ImageIconMapper.php @@ -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]); } } } diff --git a/src/Mapper/UI/MarkerMapper.php b/src/Mapper/UI/MarkerMapper.php index 20a37b7..ba2ff2b 100644 --- a/src/Mapper/UI/MarkerMapper.php +++ b/src/Mapper/UI/MarkerMapper.php @@ -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) { diff --git a/src/Model/AbstractActiveModel.php b/src/Model/AbstractActiveModel.php index a9aaf75..c1b39cf 100644 --- a/src/Model/AbstractActiveModel.php +++ b/src/Model/AbstractActiveModel.php @@ -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); } diff --git a/src/Model/LayerModel.php b/src/Model/LayerModel.php index 1d09d95..7164d09 100644 --- a/src/Model/LayerModel.php +++ b/src/Model/LayerModel.php @@ -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'; diff --git a/src/Model/MarkerModel.php b/src/Model/MarkerModel.php index 9a91110..860bdd2 100644 --- a/src/Model/MarkerModel.php +++ b/src/Model/MarkerModel.php @@ -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']); } }