mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Add Necessary templates for plugins handling
This commit is contained in:
@@ -433,6 +433,9 @@ class Application extends SilexApplication
|
|||||||
$twig->addExtension(new \Twig_Extension_Core());
|
$twig->addExtension(new \Twig_Extension_Core());
|
||||||
$twig->addExtension(new \Twig_Extension_Optimizer());
|
$twig->addExtension(new \Twig_Extension_Optimizer());
|
||||||
$twig->addExtension(new \Twig_Extension_Escaper());
|
$twig->addExtension(new \Twig_Extension_Escaper());
|
||||||
|
if ($app['debug']) {
|
||||||
|
$twig->addExtension(new \Twig_Extension_Debug());
|
||||||
|
}
|
||||||
|
|
||||||
// add filter trans
|
// add filter trans
|
||||||
$twig->addExtension(new TranslationExtension($app['translator']));
|
$twig->addExtension(new TranslationExtension($app['translator']));
|
||||||
|
|||||||
@@ -39,12 +39,15 @@ class PluginServiceProvider implements ServiceProviderInterface
|
|||||||
$app['plugins.manager'] = $app->share(function (Application $app) {
|
$app['plugins.manager'] = $app->share(function (Application $app) {
|
||||||
return new PluginManager($app['plugin.path'], $app['plugins.plugins-validator'], $app['conf']);
|
return new PluginManager($app['plugin.path'], $app['plugins.plugins-validator'], $app['conf']);
|
||||||
});
|
});
|
||||||
|
$app['plugin.workzone'] = $app->share(function () {
|
||||||
|
return new \Pimple();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(Application $app)
|
public function boot(Application $app)
|
||||||
{
|
{
|
||||||
$app['twig'] = $app->share(
|
$app['twig'] = $app->share(
|
||||||
$app->extend('twig', function ($twig, Application $app) {
|
$app->extend('twig', function (\Twig_Environment $twig) {
|
||||||
$function = new \Twig_SimpleFunction('plugin_asset', ['Alchemy\Phrasea\Plugin\Management\AssetsManager', 'twigPluginAsset']);
|
$function = new \Twig_SimpleFunction('plugin_asset', ['Alchemy\Phrasea\Plugin\Management\AssetsManager', 'twigPluginAsset']);
|
||||||
$twig->addFunction($function);
|
$twig->addFunction($function);
|
||||||
|
|
||||||
|
|||||||
2
templates/web/prod/WorkZone/plugin.html.twig
Normal file
2
templates/web/prod/WorkZone/plugin.html.twig
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<h3>{% block plugin_workzone_header_caption %}{{ plugin_id }}{% endblock plugin_workzone_header_caption %}</h3>
|
||||||
|
<div>{% block plugin_workzone_content %}{% endblock plugin_workzone_content %}</div>
|
||||||
@@ -157,6 +157,11 @@
|
|||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
<script src="{{ path('minifier', { 'f' : 'assets/fancytree/dist/jquery.fancytree-all.js'}) }}" type="text/javascript"></script>
|
<script src="{{ path('minifier', { 'f' : 'assets/fancytree/dist/jquery.fancytree-all.js'}) }}" type="text/javascript"></script>
|
||||||
{% include "common/templates.html.twig" %}
|
{% include "common/templates.html.twig" %}
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$("#plugins").accordion();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
@@ -183,6 +188,12 @@
|
|||||||
{% block tabs_panel %}
|
{% block tabs_panel %}
|
||||||
<div id="retractableButton"></div>
|
<div id="retractableButton"></div>
|
||||||
{% include 'prod/tab_headers.html.twig' %}
|
{% include 'prod/tab_headers.html.twig' %}
|
||||||
|
<div id="plugins" class="PNB" style="top:52px;">
|
||||||
|
{% set workzone_plugins = app['plugin.workzone'] %}
|
||||||
|
{% for plugin in workzone_plugins.keys() %}
|
||||||
|
{% include workzone_plugins[plugin].getWorkzoneTemplate() with {'app': app, 'plugin_id': plugin} only %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
<div id="baskets" class="PNB">
|
<div id="baskets" class="PNB">
|
||||||
{% import 'prod/WorkZone/Macros.html.twig' as WorkZoneMacros %}
|
{% import 'prod/WorkZone/Macros.html.twig' as WorkZoneMacros %}
|
||||||
{{WorkZoneMacros.make_bloc(app, WorkZone)}}
|
{{WorkZoneMacros.make_bloc(app, WorkZone)}}
|
||||||
|
|||||||
@@ -16,6 +16,13 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if app['plugin.workzone'].keys() is not empty %}
|
||||||
|
<li>
|
||||||
|
<a href="#plugins" class="WZplugins">
|
||||||
|
<img src="/skins/icons/disktt_0.gif" title="{{ 'phraseanet:: plugin.workzone' | trans }}"/>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
<li class="ui-tabs-selected ui-corner-top baskets">
|
<li class="ui-tabs-selected ui-corner-top baskets">
|
||||||
<a href="#baskets" class="WZbasketTab">
|
<a href="#baskets" class="WZbasketTab">
|
||||||
<div id="basket_menu_trigger">▼</div>
|
<div id="basket_menu_trigger">▼</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user