<?xml version="1.0" encoding="UTF-8" ?>

<config xmlns="http://thelia.net/schema/dic/config"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">

    <services>

        <!--  URL maganement -->

        <!--  The assets manager -->
        <service id="assetic.asset.manager" class="Thelia\Core\Template\Assets\AsseticAssetManager" >
            <argument>%kernel.debug%</argument>
        </service>

        <!-- Smarty parser plugins -->

        <service id="smarty.plugin.assets" class="Thelia\Core\Template\Smarty\Plugins\Assets" >
            <tag name="thelia.parser.register_plugin"/>

            <argument type="service" id="assetic.asset.manager" />
        </service>

        <service id="smarty.plugin.theliasyntax" class="Thelia\Core\Template\Smarty\Plugins\TheliaSyntax" >
            <tag name="thelia.parser.register_plugin"/>
        </service>

        <service id="smarty.plugin.format" class="Thelia\Core\Template\Smarty\Plugins\Format" scope="request">
            <argument type="service" id="request"/>
            <tag name="thelia.parser.register_plugin"/>
        </service>

        <service id="smarty.plugin.thelialoop" class="Thelia\Core\Template\Smarty\Plugins\TheliaLoop" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="service_container" />
            <call method="setLoopList">
                <argument>%thelia.parser.loops%</argument>
            </call>
        </service>

        <service id="smarty.plugin.cartpostage" class="Thelia\Core\Template\Smarty\Plugins\CartPostage" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="service_container" />
        </service>

        <service id="smarty.plugin.type" class="Thelia\Core\Template\Smarty\Plugins\Type" scope="request">
            <tag name="thelia.parser.register_plugin"/>
        </service>

        <service id="smart.plugin.form" class="Thelia\Core\Template\Smarty\Plugins\Form" scope="request">
            <tag name="thelia.parser.register_plugin"/>

            <argument type="service" id="request"/>
            <argument type="service" id="thelia.parser.context"/>

            <call method="setFormDefinition">
                <argument>%thelia.parser.forms%</argument>
            </call>
        </service>

        <service id="smarty.plugin.translation" class="Thelia\Core\Template\Smarty\Plugins\Translation" >
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="thelia.translator" />
        </service>

        <service id="smarty.plugin.module" class="Thelia\Core\Template\Smarty\Plugins\Module" scope="request">
            <argument>%kernel.debug%</argument>
            <argument type="service" id="request"/>
            <tag name="thelia.parser.register_plugin"/>
        </service>

        <service id="smarty.url.module" class="Thelia\Core\Template\Smarty\Plugins\UrlGenerator" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="request"/>
        </service>

        <service id="smarty.plugin.security" class="Thelia\Core\Template\Smarty\Plugins\Security" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="request" />
            <argument type="service" id="thelia.securityContext" />
        </service>

        <service id="smarty.plugin.dataAccess" class="Thelia\Core\Template\Smarty\Plugins\DataAccessFunctions" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="request" />
            <argument type="service" id="thelia.securityContext" />
            <argument type="service" id="thelia.taxEngine" />
            <argument type="service" id="thelia.parser.context"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="smarty.plugin.adminUtilities" class="Thelia\Core\Template\Smarty\Plugins\AdminUtilities" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="thelia.securityContext" />
        </service>

        <service id="smarty.plugin.flashMessage" class="Thelia\Core\Template\Smarty\Plugins\FlashMessage" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="request" />
        </service>

        <service id="smarty.plugin.esi" class="Thelia\Core\Template\Smarty\Plugins\Esi" scope="request">
            <tag name="thelia.parser.register_plugin"/>
            <argument type="service" id="fragment.renderer.esi" />
            <argument type="service" id="request" />
        </service>

    </services>

</config>
