{# Displays title and search form #} {% macro renderTitleAndButtons(pageTitle, buttons) %}
{% endmacro %} {# Render page scrollable data params: configTree - tree of current configuration form - form view of active group activeTabName - active tab name activeSubTabName - active subtab name routeName - route name for tabs switch routeParameters - additional route parameters #} {% macro renderScrollData(configTree, form, activeTabName = false, activeSubTabName = false, routeName = 'oro_config_configuration_system', routeParameters = {}) %} {% import _self as configMacros %} {{ configMacros.renderConfigurationScrollData({ configTree: configTree, form: form, content: {}, activeTabName: activeTabName, activeSubTabName: activeSubTabName, routeName: routeName, routeParameters: routeParameters }) }} {% endmacro %} {% macro renderConfigurationScrollData(data) %} {% import '@OroUI/macros.html.twig' as UI %} {% import _self as configMacros %} {% set content %}
{{ configMacros.renderTabContent(data.form, data.content) }}
{% endset %}
{% embed "@OroUI/content_sidebar.html.twig" with {options: { scrollbar: '[data-role="jstree-container"]' }} %} {% block header %}
{% endblock header %} {% block sidebar %} {% import '@OroUI/macros.html.twig' as UI %} {{ UI.renderJsTree({ 'label': null, 'treeOptions': { 'data' : data.configTree, 'viewGroup': 'configuration', 'nodeId': data.activeSubTabName, 'onSelectRoute': data.routeName, 'onSelectRouteParameters': data.routeParameters, 'view': 'oroconfig/js/app/views/configuration-tree-view' }, 'actionsOptions': { inlineActionsCount: 2, inlineActionsElement: '#system-configuration-jstree-inline-actions' } }) }} {% endblock sidebar %} {% block content %} {% autoescape %} {{ content }} {% endautoescape %} {% endblock content %} {% endembed %}
{% endmacro %} {# Renders tab form params: form - form view for active tab tree configuration #} {% macro renderTabContent(form, content) %} {% import _self as configMacros %} {% set content = content|default({}) %} {% set processForm = false %} {% if content.formErrors is not defined %} {% set content = content|merge({ formErrors: form_errors(form) }) %} {% endif %} {% if content.dataBlocks is not defined %} {% set content = content|merge({ dataBlocks: form_data_blocks(form) }) %} {% set processForm = true %} {% endif %} {% if content.hiddenData is not defined %} {% set content = content|merge({ hiddenData: form_rest(form) }) %} {% endif %} {% if processForm %} {% set content = oro_form_process(content, form) %} {% endif %}
{% if content.formErrors is defined and content.formErrors | length %} {% endif %} {% for scrollBlock in content.dataBlocks %}
{{ scrollBlock.title|trans }}
{% if scrollBlock.description is defined and scrollBlock.description != '' %}

{{ scrollBlock.description|trans }}

{% endif %} {% for subblock in scrollBlock.subblocks %} {% if subblock is iterable %} {{ configMacros.renderFieldset(subblock) }} {% else %} {{ subblock|raw }} {% endif %} {% endfor %}
{% endfor %}
{{ content.hiddenData|raw }}
{% endmacro %} {# Renders fieldset params: block.title - fieldset label block.description - fieldset description (optional) block.data - fields data block.tooltip - fieldset tooltip (optional) #} {% macro renderFieldset(block) %} {% import '@OroUI/macros.html.twig' as ui %} {% if block.data|filter(v => v != "")|length > 0 %}
{% if block.title is defined %}
{{ block.title|trans }} {% if block.tooltip is defined and block.tooltip != '' %} {% endif %}
{% endif %} {% if block.description is defined and block.description != '' %}
{% if block.descriptionStyle is defined and block.descriptionStyle != '' %}

{{ block.description|trans|oro_html_sanitize }}

{% else %}

{{ block.description|trans|oro_html_sanitize }}

{% endif %}
{% endif %}
{% for dataBlock in block.data %} {{ dataBlock|raw }} {% endfor %}
{% endif %} {% endmacro %}