From 831436f6fe01336724b0b510a17650275b839805 Mon Sep 17 00:00:00 2001 From: Florian BLOUET Date: Fri, 28 Aug 2015 16:14:07 +0200 Subject: [PATCH] updated existing plugin interfaces, added basket actionbar plugin interface --- .../Core/Provider/PluginServiceProvider.php | 7 +++-- .../Plugin/ActionBarPluginInterface.php | 4 +-- .../Plugin/BasketActionBarPluginInterface.php | 30 +++++++++++++++++++ .../Plugin/WorkZonePluginInterface.php | 12 +++++++- templates/web/prod/WorkZone/Basket.html.twig | 13 ++++++++ 5 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 lib/Alchemy/Phrasea/Plugin/BasketActionBarPluginInterface.php diff --git a/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php index 5e758b549e..c1274435d6 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php @@ -43,6 +43,9 @@ class PluginServiceProvider implements ServiceProviderInterface $app['plugins.manager'] = $app->share(function (Application $app) { return new PluginManager($app['plugin.path'], $app['plugins.plugins-validator'], $app['conf']); }); + $app['plugin.workzone.basket.actionbar'] = $app->share(function () { + return new Pimple(); + }); $app['plugin.actionbar'] = $app->share(function () { return new Pimple(); }); @@ -50,7 +53,7 @@ class PluginServiceProvider implements ServiceProviderInterface return new Pimple(); }); - $app['plugin.locale.textdomains'] = new ArrayObject(); + $app['plugin.locale.textdomains'] = new \ArrayObject(); // Routes will be bound after all others // Add a new controller provider can be added as follows @@ -60,7 +63,7 @@ class PluginServiceProvider implements ServiceProviderInterface // Routes will be bound after all others // Add a new controller provider can be added as follows // $app['plugin.controller_providers'][] = array('/prefix', 'controller_provider_service_key'); - $app['plugin.controller_providers.api'] = new ArrayObject(); + $app['plugin.controller_providers.api'] = new \ArrayObject(); } public function boot(Application $app) diff --git a/lib/Alchemy/Phrasea/Plugin/ActionBarPluginInterface.php b/lib/Alchemy/Phrasea/Plugin/ActionBarPluginInterface.php index db7494a916..661a38d4b7 100644 --- a/lib/Alchemy/Phrasea/Plugin/ActionBarPluginInterface.php +++ b/lib/Alchemy/Phrasea/Plugin/ActionBarPluginInterface.php @@ -32,10 +32,10 @@ interface ActionBarPluginInterface /** * @return string */ - public function getPluginName(); + public function getPluginLocale(); /** * @return string */ - public function getPluginLocale(); + public function getPluginName(); } diff --git a/lib/Alchemy/Phrasea/Plugin/BasketActionBarPluginInterface.php b/lib/Alchemy/Phrasea/Plugin/BasketActionBarPluginInterface.php new file mode 100644 index 0000000000..2e01f097e0 --- /dev/null +++ b/lib/Alchemy/Phrasea/Plugin/BasketActionBarPluginInterface.php @@ -0,0 +1,30 @@ + + {% if app['plugin.workzone.basket.actionbar'].keys() is not empty %} + {% for pluginId in app['plugin.workzone.basket.actionbar'].keys() %} + {% for key,action in app['plugin.workzone.basket.actionbar'][pluginId].getBasketActionBar() %} + {% set label = action.label %} + + + + {% endfor %} + {% endfor %} + {% endif %} +
{{ 'Certaines donnees du panier ont change' | trans }} {{ 'rafraichir' | trans }}
{% if basket_length == 0 %}