mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #3073 from jygaulier/PHRAS-2628_toolbar-plugin_4.1
PHRAS-2628 #comment merge toolbar-plugin_4.1
This commit is contained in:
@@ -20,6 +20,8 @@ use Alchemy\Phrasea\Model\Repositories\FeedRepository;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\Finder\SplFileInfo;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
// use Alchemy\Phrasea\Plugin\ActionBarPluginInterface;
|
||||
|
||||
|
||||
class RootController extends Controller
|
||||
{
|
||||
@@ -85,6 +87,22 @@ class RootController extends Controller
|
||||
/** @var \Closure $filter */
|
||||
$filter = $this->app['plugin.filter_by_authorization'];
|
||||
|
||||
/* prepare work to extend whole taskbar... later
|
||||
$menus = [
|
||||
'push' => ['native'=>true, 'n'=>0],
|
||||
'tools' => ['native'=>true, 'n'=>0],
|
||||
];
|
||||
/ ** @var ActionBarPluginInterface $plugin * /
|
||||
foreach($filter('actionbar') as $kplugin=>$plugin) {
|
||||
foreach($plugin->getActionBar() as $kmenu=>$menu) {
|
||||
if(!array_key_exists($kmenu, $menus)) {
|
||||
$menus[$kmenu] = ['native'=>false, 'n'=>0];
|
||||
}
|
||||
$menus[$kmenu]['n']++;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$plugins = [
|
||||
'workzone' => $filter('workzone'),
|
||||
'actionbar' => $filter('actionbar'),
|
||||
|
@@ -166,9 +166,7 @@
|
||||
{% if action.icon %}
|
||||
<img src="{{ plugin_asset(plugin.PluginName, action.icon) }}" height="16" width="16" class="btn-image"/>
|
||||
{% endif %}
|
||||
|
||||
{% set label = action.label %}
|
||||
{% trans from plugin.PluginLocale %}label{% endtrans %}
|
||||
{{ action.label|trans({}, plugin.PluginLocale) }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
@@ -201,9 +199,7 @@
|
||||
{% if action.icon %}
|
||||
<img src="{{ plugin_asset(plugin.PluginName, action.icon) }}" height="16" width="16" class="btn-image"/>
|
||||
{% endif %}
|
||||
|
||||
{% set label = action.label %}
|
||||
{% trans from plugin.PluginLocale %}label{% endtrans %}
|
||||
{{ action.label|trans({}, plugin.PluginLocale) }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
@@ -237,9 +233,7 @@
|
||||
<img src="{{ plugin_asset(plugin.PluginName, action.icon) }}"
|
||||
height="16" width="16" class="btn-image"/>
|
||||
{% endif %}
|
||||
|
||||
{% set label = action.label %}
|
||||
{% trans from plugin.PluginLocale %}label{% endtrans %}
|
||||
{{ action.label|trans({}, plugin.PluginLocale) }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
@@ -260,8 +254,7 @@
|
||||
{% if action.icon %}
|
||||
<img src="{{ plugin_asset(plugin.PluginName, action.icon) }}" height="16" width="16"/>
|
||||
{% endif %}
|
||||
{% set label = action.label %}
|
||||
{% trans from plugin.PluginLocale %}label{% endtrans %}
|
||||
{{ action.label|trans({}, plugin.PluginLocale) }}
|
||||
</a>
|
||||
</button>
|
||||
{% if not (loop.last and loop.parent.loop.last) %}
|
||||
@@ -275,8 +268,7 @@
|
||||
{% if action.icon %}
|
||||
<img src="{{ plugin_asset(plugin.PluginName, action.icon) }}" height="16" width="16" class="btn-image"/>
|
||||
{% endif %}
|
||||
{% set label = action.label %}
|
||||
{% trans from plugin.PluginLocale %}label{% endtrans %}
|
||||
{{ action.label|trans({}, plugin.PluginLocale) }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
@@ -311,3 +303,11 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block toolbarJS %}
|
||||
{% if plugins.actionbar is not empty %}
|
||||
{% for plugin in plugins.actionbar %}
|
||||
{{ (plugin.JS|default(''))|raw }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user