From a3ac7262f0b81696ce60596647b39b34fb4c1b5d Mon Sep 17 00:00:00 2001 From: David Molineus Date: Thu, 5 Oct 2017 16:31:15 +0200 Subject: [PATCH] Add plugin and bundle. --- composer.json | 9 +++---- src/ContaoManager/Plugin.php | 40 ++++++++++++++++++++++++++++ src/NetzmachtContaoLeafletBundle.php | 26 ++++++++++++++++++ 3 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 src/ContaoManager/Plugin.php create mode 100644 src/NetzmachtContaoLeafletBundle.php diff --git a/composer.json b/composer.json index a785563..69b8194 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,8 @@ "doctrine/cache": "^1.0" }, "require-dev": { - "phpcq/all-tasks": "^1.2" + "phpcq/all-tasks": "^1.2", + "contao/manager-plugin": "^2.1" }, "autoload": { "psr-4": { @@ -51,12 +52,8 @@ "dev-develop": "2.1.x-dev", "dev-release/3.0.0": "3.0.x-dev" }, + "contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\ContaoManager\\Plugin", "contao": { - "sources": { - "module": "system/modules/leaflet", - "assets/maps": "assets/leaflet/maps", - "assets/js": "assets/leaflet/js" - }, "transifex": { "project": "contao-leaflet-maps", "prefix": "core-", diff --git a/src/ContaoManager/Plugin.php b/src/ContaoManager/Plugin.php new file mode 100644 index 0000000..c9985b7 --- /dev/null +++ b/src/ContaoManager/Plugin.php @@ -0,0 +1,40 @@ + + * @copyright 2016-2017 netzmacht David Molineus. All rights reserved. + * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE + * @filesource + */ + +namespace Netzmacht\Contao\Leaflet\ContaoManager; + +use Contao\CoreBundle\ContaoCoreBundle; +use Contao\ManagerPlugin\Bundle\BundlePluginInterface; +use Contao\ManagerPlugin\Bundle\Config\BundleConfig; +use Contao\ManagerPlugin\Bundle\Parser\ParserInterface; +use Netzmacht\Contao\Leaflet\NetzmachtContaoLeafletBundle; +use Netzmacht\Contao\Toolkit\NetzmachtContaoToolkitBundle; + +/** + * Contao manager plugin. + * + * @package Netzmacht\Contao\Leaflet\ContaoManager + */ +class Plugin implements BundlePluginInterface +{ + /** + * {@inheritdoc} + */ + public function getBundles(ParserInterface $parser) + { + return [ + BundleConfig::create(NetzmachtContaoLeafletBundle::class) + ->setLoadAfter([ContaoCoreBundle::class, NetzmachtContaoToolkitBundle::class]) + ->setReplace(['leaflet']) + ]; + } +} diff --git a/src/NetzmachtContaoLeafletBundle.php b/src/NetzmachtContaoLeafletBundle.php new file mode 100644 index 0000000..e9ffbb4 --- /dev/null +++ b/src/NetzmachtContaoLeafletBundle.php @@ -0,0 +1,26 @@ + + * @copyright 2016-2017 netzmacht David Molineus. All rights reserved. + * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE + * @filesource + */ + +declare(strict_types=1); + +namespace Netzmacht\Contao\Leaflet; + +use Symfony\Component\HttpKernel\Bundle\Bundle; + +/** + * Class NetzmachtContaoLeafletBundle. + * + * @package Netzmacht\Contao\Leaflet + */ +class NetzmachtContaoLeafletBundle extends Bundle +{ +}