<?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Mage
 * @package     Mage_GiftMessage
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
-->
<config>
    <modules>
        <Mage_GiftMessage>
            <version>0.7.6</version>
        </Mage_GiftMessage>
    </modules>
    <global>
        <blocks>
            <giftmessage><class>Mage_GiftMessage_Block</class></giftmessage>
        </blocks>
         <helpers>
            <giftmessage><class>Mage_GiftMessage_Helper</class></giftmessage>
        </helpers>
        <models>
            <giftmessage>
                <class>Mage_GiftMessage_Model</class>
                <resourceModel>giftmessage_mysql4</resourceModel>
            </giftmessage>
            <giftmessage_mysql4>
                <class>Mage_GiftMessage_Model_Mysql4</class>
                <entities>
                    <message>
                        <table>gift_message</table>
                    </message>
                </entities>
            </giftmessage_mysql4>
        </models>
        <resources>
            <giftmessage_setup>
                <setup>
                   <module>Mage_GiftMessage</module>
                   <class>Mage_GiftMessage_Model_Mysql4_Setup</class>
                </setup>
            </giftmessage_setup>
        </resources>
        <sales>
            <quote>
                <item>
                    <product_attributes>
                        <gift_message_available/>
                    </product_attributes>
                </item>
            </quote>
        </sales>
    </global>

    <default>
        <sales>
            <gift_messages>
                <allow_items>0</allow_items>
                <allow_order>0</allow_order>
            </gift_messages>
        </sales>
    </default>

    <adminhtml>
        <translate>
            <modules>
                <Mage_GiftMessage>
                    <files>
                        <default>Mage_GiftMessage.csv</default>
                    </files>
                </Mage_GiftMessage>
            </modules>
        </translate>
        <events>
            <sales_convert_quote_item_to_order_item>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventConvertQuoteItemToOrderItem</method>
                    </giftmessage>
                </observers>
            </sales_convert_quote_item_to_order_item>
            <sales_convert_quote_address_to_order>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventConvertQuoteAddressToOrder</method>
                    </giftmessage>
                </observers>
            </sales_convert_quote_address_to_order>
            <sales_convert_quote_to_order>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventConvertQuoteToOrder</method>
                    </giftmessage>
                </observers>
            </sales_convert_quote_to_order>
            <adminhtml_sales_order_create_create_order>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>checkoutEventCreateOrder</method>
                    </giftmessage>
                </observers>
            </adminhtml_sales_order_create_create_order>
            <sales_convert_order_to_quote>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventOrderToQuote</method>
                    </giftmessage>
                 </observers>
            </sales_convert_order_to_quote>
            <sales_convert_order_item_to_quote_item>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventOrderItemToQuoteItem</method>
                    </giftmessage>
                 </observers>
            </sales_convert_order_item_to_quote_item>
        </events>
        <layout>
            <updates>
                <giftmessage>
                    <file>giftmessage.xml</file>
                </giftmessage>
            </updates>
        </layout>
    </adminhtml>
    <frontend>
        <events>
            <sales_convert_quote_item_to_order_item>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventConvertQuoteItemToOrderItem</method>
                    </giftmessage>
                </observers>
            </sales_convert_quote_item_to_order_item>
            <sales_convert_quote_address_to_order>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventConvertQuoteAddressToOrder</method>
                    </giftmessage>
                </observers>
            </sales_convert_quote_address_to_order>
            <sales_convert_quote_to_order>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventConvertQuoteToOrder</method>
                    </giftmessage>
                </observers>
            </sales_convert_quote_to_order>
            <checkout_controller_onepage_save_shipping_method>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>checkoutEventCreateGiftMessage</method>
                    </giftmessage>
                </observers>
            </checkout_controller_onepage_save_shipping_method>
            <checkout_controller_multishipping_shipping_post>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>checkoutEventCreateGiftMessage</method>
                    </giftmessage>
                </observers>
            </checkout_controller_multishipping_shipping_post>
            <sales_convert_order_to_quote>
                <observers>
                    <giftmessage>
                        <type>model</type>
                        <class>giftmessage/observer</class>
                        <method>salesEventOrderToQuote</method>
                    </giftmessage>
                </observers>
            </sales_convert_order_to_quote>
        </events>
        <routers>
            <giftmessage>
                <use>standard</use>
                <args>
                    <module>Mage_GiftMessage</module>
                    <frontName>giftmessage</frontName>
                </args>
            </giftmessage>
        </routers>
        <translate>
            <modules>
                <Mage_GiftMessage>
                    <files>
                        <default>Mage_GiftMessage.csv</default>
                    </files>
                </Mage_GiftMessage>
            </modules>
        </translate>
        <layout>
            <updates>
                <giftmessage>
                    <file>giftmessage.xml</file>
                </giftmessage>
            </updates>
        </layout>
    </frontend>
</config>
