<?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    design
 * @package     default_iphone
 * @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)
 */

-->
<layout version="0.1.0">

    <customer_account>
        <reference name="customer_account_navigation">
            <action method="addLink" translate="label" module="downloadable"><name>downloadable_products</name><path>downloadable/customer/products</path><label>My Downloadable Products</label></action>
        </reference>
    </customer_account>

    <downloadable_customer_products>
        <update handle="customer_account"/>
        <reference name="content">
            <block type="downloadable/customer_products_list" name="downloadable_customer_products_list" template="downloadable/customer/products/list.phtml" />
        </reference>
        <reference name="root">
            <action method="setHeaderTitle" translate="title" module="downloadable"><title>My Downloadable Products</title></action>
        </reference>
    </downloadable_customer_products>

    <checkout_cart_index>
        <reference name="checkout.cart">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/cart/item/default.phtml</template></action>
        </reference>
    </checkout_cart_index>

    <checkout_onepage_review>
        <reference name="root">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
        </reference>
    </checkout_onepage_review>

    <checkout_onepage_success>
        <reference name="checkout.success">
            <block type="downloadable/checkout_success" name="downloadable.checkout.success" template="downloadable/checkout/success.phtml"/>
        </reference>
    </checkout_onepage_success>

    <checkout_multishipping_addresses>
        <reference name="checkout_addresses">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
        </reference>
    </checkout_multishipping_addresses>

    <checkout_multishipping_shipping>
        <reference name="checkout_billing_items">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
        </reference>
    </checkout_multishipping_shipping>

    <checkout_multishipping_overview>
        <reference name="checkout_overview">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
        </reference>
    </checkout_multishipping_overview>

    <checkout_multishipping_success>
        <reference name="checkout_success">
            <block type="downloadable/checkout_success" name="downloadable.checkout.success" template="downloadable/checkout/success.phtml"/>
        </reference>
    </checkout_multishipping_success>

    <paypal_express_review>
        <reference name="paypal.express.review.details">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
        </reference>
    </paypal_express_review>
    <paypal_express_review_details>
        <reference name="root">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
        </reference>
    </paypal_express_review_details>

    <sales_order_view>
        <reference name="order_items">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
        </reference>
    </sales_order_view>

    <sales_order_invoice>
        <reference name="invoice_items">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
        </reference>
    </sales_order_invoice>

    <sales_order_creditmemo>
        <reference name="creditmemo_items">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
        </reference>
    </sales_order_creditmemo>

<!--
Print pages
-->

    <sales_order_print>
        <reference name="sales.order.print">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
        </reference>
    </sales_order_print>

    <sales_order_printinvoice>
        <reference name="sales.order.print.invoice">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
        </reference>
    </sales_order_printinvoice>

    <sales_order_printcreditmemo>
        <reference name="sales.order.print.creditmemo">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
        </reference>
    </sales_order_printcreditmemo>

<!--
EOF Print pages
-->

<!--
Emails
-->

    <sales_email_order_items>
        <reference name="items">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_order_downloadable</block><template>downloadable/email/order/items/order/downloadable.phtml</template></action>
        </reference>
    </sales_email_order_items>

    <sales_email_order_invoice_items>
        <reference name="items">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_downloadable</block><template>downloadable/email/order/items/invoice/downloadable.phtml</template></action>
        </reference>
    </sales_email_order_invoice_items>

    <sales_email_order_creditmemo_items>
        <reference name="items">
            <action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_downloadable</block><template>downloadable/email/order/items/creditmemo/downloadable.phtml</template></action>
        </reference>
    </sales_email_order_creditmemo_items>

    <PRODUCT_TYPE_downloadable>
        <reference name="product.info">
            <block type="downloadable/catalog_product_view_type" name="product.info.downloadable" as="product_type_data" template="downloadable/catalog/product/type.phtml">
                 <block type="downloadable/catalog_product_samples" name="product.info.downloadable.samples" as="samples" template="downloadable/catalog/product/samples.phtml"/>
                 <block type="core/text_list" name="product.info.downloadable.extra" as="product_type_data_extra"/>
            </block>
        </reference>
        <reference name="product.info.options.wrapper">
            <block type="downloadable/catalog_product_links" name="product.info.downloadable.options" as="type_downloadable_options" before="-" template="downloadable/catalog/product/links.phtml"/>
            <action method="insert"><block>product.info.downloadable.options</block></action>
        </reference>
        <reference name="product.info.downloadable.extra">
            <block type="cataloginventory/stockqty_default" template="cataloginventory/stockqty/default.phtml"/>
        </reference>
    </PRODUCT_TYPE_downloadable>

</layout>
