mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-29 03:24:37 +01:00
Rewrite frontend components to work with toolkit v2.
This commit is contained in:
1
module/config/autoload.ini
Normal file
1
module/config/autoload.ini
Normal file
@@ -0,0 +1 @@
|
||||
requires[] = 'toolkit'
|
||||
@@ -56,13 +56,13 @@ array_insert(
|
||||
/*
|
||||
* Content elements.
|
||||
*/
|
||||
$GLOBALS['TL_CTE']['includes']['leaflet'] = 'Netzmacht\Contao\Leaflet\Frontend\MapElement';
|
||||
$GLOBALS['TL_CTE']['includes']['leaflet'] = 'Netzmacht\Contao\Toolkit\Component\ContentElement\ContentElementDecorator';
|
||||
|
||||
|
||||
/*
|
||||
* Frontend modules
|
||||
*/
|
||||
$GLOBALS['FE_MOD']['includes']['leaflet'] = 'Netzmacht\Contao\Leaflet\Frontend\MapModule';
|
||||
$GLOBALS['FE_MOD']['includes']['leaflet'] = 'Netzmacht\Contao\Toolkit\Component\Module\ModuleDecorator';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,9 +9,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Netzmacht\Contao\Leaflet\Alias\UnderscoreFilter;
|
||||
use Netzmacht\Contao\Leaflet\Boot;
|
||||
use Netzmacht\Contao\Leaflet\ContaoAssets;
|
||||
use Netzmacht\Contao\Leaflet\Frontend\MapElement;
|
||||
use Netzmacht\Contao\Leaflet\Frontend\MapModule;
|
||||
use Netzmacht\Contao\Leaflet\Frontend\ValueFilter;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\Contao\Leaflet\MapService;
|
||||
@@ -180,3 +183,27 @@ $container['leaflet.dca.control-callbacks'] = $container->share(
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
$container[Services::CONTENT_ELEMENTS_MAP]['leaflet'] = function ($model, $column, ContainerInterface $container) {
|
||||
return new MapElement(
|
||||
$model,
|
||||
$container->get(Services::TEMPLATE_FACTORY),
|
||||
$container->get(Services::TRANSLATOR),
|
||||
$container->get('leaflet.map.service'),
|
||||
$container->get(Services::INPUT),
|
||||
$container->get(Services::CONFIG),
|
||||
$column
|
||||
);
|
||||
};
|
||||
|
||||
$container[Services::MODULES_MAP]['leaflet'] = function ($model, $column, ContainerInterface $container) {
|
||||
return new MapModule(
|
||||
$model,
|
||||
$container->get(Services::TEMPLATE_FACTORY),
|
||||
$container->get(Services::TRANSLATOR),
|
||||
$container->get('leaflet.map.service'),
|
||||
$container->get(Services::INPUT),
|
||||
$container->get(Services::CONFIG),
|
||||
$column
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user