{# Prepares options for channel form and initialize page component params: form - Symfony\Component\Form\FormView entitiesMetadata - array of entities metadata #} {% macro initializeChannelForm(form, entitiesMetadata, customerIdentity) %} {% set options = { channelTypeEl: '#' ~ form.channelType.vars.id, channelEntitiesEl: '#' ~ form.entities.vars.id, customerIdentity: customerIdentity, entitiesMetadata: entitiesMetadata, fields: { name: '#' ~ form.name.vars.id, channelType: '#' ~ form.channelType.vars.id, tokenEl: '#' ~ form._token.vars.id } } %}
{% endmacro %} {# Renders and initialize entity list compoenent in view mode params: channel - Oro\Bundle\ChannelBundle\Entity\Channel #} {% macro inializeEntitiesViewComponent(channel) %} {% set containerIdentifier = 'entities-list-view' %}
{% endmacro %} {# Renders channel property for entities that aware of it. Check wheter view of channel is allowed then renders link to channel view page. params: entity - entity instanse of Oro\Bundle\ChannelBundle\Model\ChannelAwareInterface params - set of params required for render(e.g. label etc..) #} {% macro renderChannelProperty(entity, params = {}) %} {% import '@OroUI/macros.html.twig' as UI %} {% set label = params.label is defined ? params.label : oro_entity_config_value('Oro\\Bundle\\ChannelBundle\\Entity\\Channel', 'label') %} {{ UI.renderHtmlProperty(label|trans, UI.entityViewLink(entity.dataChannel, entity.dataChannel ? entity.dataChannel.name : null, 'oro_channel_view')) }} {% endmacro %}