
<?php if ($this->helper('wishlist')->isAllow()) : ?>
    <div class="my-wishlist">
        <div class="page-title title-buttons">
            <?php if ($this->helper('wishlist')->isRssAllow() && $this->hasWishlistItems()): ?>
                <a href="<?php echo $this->helper('wishlist')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="link-rss"><?php echo $this->__('RSS Feed') ?></a>
            <?php endif; ?>
            <h1><?php echo $this->getTitle(); ?></h1>
        </div>
        <?php echo Mage::helper('designer/messages')->all() ?>

        <form id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post">
            <?php echo $this->getChildHtml('top'); ?>
            <fieldset>
                <?php if ($this->hasWishlistItems()): ?>
                        <?php echo $this->getBlockHtml('formkey');?>
                        <?php $this->getChild('items')->setItems($this->getWishlistItems()); ?>
                        <?php echo $this->getChildHtml('items');?>
                        <script type="text/javascript">decorateTable('wishlist-table')</script>
                <?php else: ?>
                    <p class="wishlist-empty"><?php echo $this->__('You have no items in your wishlist.') ?></p>
                <?php endif ?>
                <div class="buttons-set buttons-set2">
                    <?php echo $this->getChild('control_buttons')->toHtml();?>
                </div>
            </fieldset>
        </form>

        <script type="text/javascript">
        //<![CDATA[
        var wishlistForm = new Validation($('wishlist-view-form'));
        function addAllWItemsToCart() {
            var url = '<?php echo $this->getUrl('*/*/allcart', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>';
            var separator = (url.indexOf('?') >= 0) ? '&' : '?';
            $$('#wishlist-view-form .qty').each(
                function (input, index) {
                    url += separator + input.name + '=' + encodeURIComponent(input.value);
                    separator = '&';
                }
            );
            setLocation(url);
        }
        //]]>
        </script>
    </div>
    <?php echo $this->getChildHtml('bottom'); ?>
    <div class="buttons-set">
        <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
    </div>
<?php endif ?>
