{% block toolbar %}
{% set menus = { 'export': [ { 'class':'TOOL_disktt_btn', 'icon':'/assets/common/images/icons/disktt_history.png', 'label':'action : exporter' | trans }, { 'class':'TOOL_print_btn', 'icon':'/assets/common/images/icons/print_history.png', 'label':'action : print' | trans } ], 'edit': [], 'push': [], 'tools': [], 'delete': [] } %} {# menu "edit" #} {% set m = [] %} {% if acl.has_right(constant('\\ACL::CANMODIFRECORD')) %} {% set m = m|merge([ { 'class':'TOOL_ppen_btn', 'icon':'/assets/common/images/icons/ppen_history.png', 'label':'action : editer' | trans } ]) %} {% endif %} {% if acl.has_right(constant('\\\ACL::CHGSTATUS')) %} {% set m = m|merge([ { 'class':'TOOL_chgstatus_btn', 'icon':'/assets/common/images/icons/chgstatus_history.png', 'label':'action : status' | trans } ]) %} {% endif %} {% if acl.has_right(constant('\\ACL::CANDELETERECORD')) and acl.has_right(constant('\\ACL::CANADDRECORD')) %} {% set m = m|merge([ { 'class':'TOOL_chgcoll_btn', 'icon':'/assets/common/images/icons/chgcoll_history.png', 'label':'action : collection' | trans } ]) %} {% endif %} {% set menus = menus|merge({'edit' : m}) %} {# menu "push" #} {% set m = [] %} {% if acl.has_right(constant('\\ACL::CANPUSH')) %} {% set m = m|merge([ { 'class':'TOOL_sharebasket_btn', 'fa_icon': 'fa-share', 'i_class': 'share_sent', 'label':'Share' | trans }, { 'class':'TOOL_pushdoc_btn', 'fa_icon':'fa-gift', 'i_class': 'push_rec', 'label':'action : push' | trans } ]) %} {% endif %} {% if acl.has_right(constant('\\ACL::BAS_CHUPUB')) %} {% set m = m|merge([ { 'class':'TOOL_publish_btn', 'icon':'/assets/common/images/icons/rss16.png', 'label':'action : publier' | trans } ]) %} {% endif %} {% set menus = menus|merge({'push' : m}) %} {# menu "tools" #} {% if acl.has_right(constant('\\ACL::IMGTOOLS')) %} {% set menus = menus|merge({'tools' : [ { 'class':'TOOL_imgtools_btn', 'icon':'/assets/common/images/icons/imgtools_history.png', 'label':'action : outils' | trans } ]}) %} {% endif %} {# menu "delete" #} {% if acl.has_right(constant('\\ACL::CANDELETERECORD')) %} {% set menus = menus|merge({'delete' : [ { 'class':'TOOL_trash_btn', 'icon':'/assets/common/images/icons/delete.png', 'label':'action : supprimer' | trans } ]}) %} {% endif %} {# add plugins entries #} {% if plugins.actionbar is not empty %} {% for plugin in plugins.actionbar %} {% for k, menu in plugin.getActionBar() %} {% if k != '_context_' %} {% set m = menus[k]|default([]) %} {% for action in menu %} {% set m = m|merge([{ 'class':action.classes|default(''), 'icon':plugin_asset(plugin.PluginName, action.icon), 'label':action.label|trans({}, plugin.PluginLocale) }]) %} {% endfor %} {% set menus = menus|merge({(k) : m}) %} {% endif %} {% endfor %} {% endfor %} {% endif %} {# print #} {% for menu_entries in menus %} {% if menu_entries|length > 0 %}
{% set menu_entry = menu_entries[0] %} {% set menu_entries = menu_entries|slice(1) %} {% if menu_entries|length > 0 %} {% endif %}
{% endif %} {% endfor %} {% endblock %} {% block toolbarJS %} {% if plugins.actionbar is not empty %} {% for pluginId, plugin in plugins.actionbar %} {% if plugin.getActionBarTemplate is defined %} {% set template = plugin.getActionBarTemplate() %} {% if template %} {% include template with {'app': app, 'plugin_id': pluginId, 'plugin': plugin} only %} {% endif %} {% endif %} {% endfor %} {% endif %} {% endblock %}