Let leaflet boot again.

This commit is contained in:
David Molineus
2016-10-04 14:55:25 +02:00
parent 5d8028eda5
commit 69e3ea8898
2 changed files with 8 additions and 8 deletions

View File

@@ -11,13 +11,12 @@
use Netzmacht\Contao\Leaflet\Boot; use Netzmacht\Contao\Leaflet\Boot;
use Netzmacht\Contao\Leaflet\ContaoAssets; use Netzmacht\Contao\Leaflet\ContaoAssets;
use Netzmacht\Contao\Leaflet\Frontend\Helper\InsertTagReplacer;
use Netzmacht\Contao\Leaflet\Frontend\ValueFilter; use Netzmacht\Contao\Leaflet\Frontend\ValueFilter;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\MapService; use Netzmacht\Contao\Leaflet\MapService;
use Netzmacht\Contao\Leaflet\ServiceContainer; use Netzmacht\Contao\Leaflet\ServiceContainer;
use Netzmacht\Contao\Toolkit\DependencyInjection\Services;
use Netzmacht\JavascriptBuilder\Builder; use Netzmacht\JavascriptBuilder\Builder;
use Netzmacht\JavascriptBuilder\Encoder;
use Netzmacht\JavascriptBuilder\Encoder\ChainEncoder; use Netzmacht\JavascriptBuilder\Encoder\ChainEncoder;
use Netzmacht\JavascriptBuilder\Encoder\JavascriptEncoder; use Netzmacht\JavascriptBuilder\Encoder\JavascriptEncoder;
use Netzmacht\JavascriptBuilder\Encoder\MultipleObjectsEncoder; use Netzmacht\JavascriptBuilder\Encoder\MultipleObjectsEncoder;
@@ -114,7 +113,7 @@ $container['leaflet.definition.builder'] = $container->share(function($container
}); });
$container['leaflet.frontend.value-filter'] = $container->share(function($container) { $container['leaflet.frontend.value-filter'] = $container->share(function($container) {
return new ValueFilter($container['toolkit.insert-tag-replacer']); return new ValueFilter($container[Services::INSERT_TAG_REPLACER]);
}); });
$container['leaflet.service-container'] = $container->share(function($container) { $container['leaflet.service-container'] = $container->share(function($container) {

View File

@@ -20,7 +20,8 @@ use Netzmacht\Contao\Leaflet\Frontend\InsertTag\LeafletInsertTagParser;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Mapper\Mapper; use Netzmacht\Contao\Leaflet\Mapper\Mapper;
use Netzmacht\Contao\Leaflet\Model\IconModel; use Netzmacht\Contao\Leaflet\Model\IconModel;
use Netzmacht\Contao\Toolkit\Event\InitializeSystemEvent; use Netzmacht\Contao\Toolkit\Boot\Event\InitializeSystemEvent;
use Netzmacht\Contao\Toolkit\DependencyInjection\Services;
use Netzmacht\LeafletPHP\Assets; use Netzmacht\LeafletPHP\Assets;
use Netzmacht\LeafletPHP\Definition\Type\ImageIcon; use Netzmacht\LeafletPHP\Definition\Type\ImageIcon;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -55,12 +56,12 @@ class BootSubscriber implements EventSubscriberInterface
*/ */
public function initializeInsertTagParser(InitializeSystemEvent $event) public function initializeInsertTagParser(InitializeSystemEvent $event)
{ {
$container = $event->getServiceContainer(); $container = $event->getContainer();
$debugMode = $container->getConfig()->get('debugMode'); $debugMode = $container->get(Services::CONFIG)->get('debugMode');
$mapService = $container->getService('leaflet.map.service'); $mapService = $container->get('leaflet.map.service');
$parser = new LeafletInsertTagParser($mapService, $debugMode); $parser = new LeafletInsertTagParser($mapService, $debugMode);
$container->getInsertTagReplacer()->registerParser($parser); $container->get(Services::INSERT_TAG_REPLACER)->registerParser($parser);
} }
/** /**