<?php
/**
 * Maho
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var Mage_Downloadable_Block_Adminhtml_Sales_Items_Column_Downloadable_Name $this */
?>

<?php if ($_item = $this->getItem()): ?>
    <h5 class="title"><?= $_item->getName() ?></h5>
    <div><strong><?= $this->helper('sales')->__('SKU') ?>:</strong> <?= implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($this->getSku()))) ?></div>
    <?php if ($this->getOrderOptions()): ?>
        <dl class="item-options">
        <?php foreach ($this->getOrderOptions() as $_option): ?>
            <dt><?= $this->escapeHtml($_option['label']) ?></dt>
            <dd>
            <?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
                <?= $_option['value'] ?>
            <?php else: ?>
                <?= Mage::helper('core/string')->truncate($_option['value'], 55, '', $_remainder) ?>
                <?php if ($_remainder):?>
                    ... <span id="<?= $_id = 'id' . uniqid()?>"><?= $_remainder ?></span>
                    <script type="text/javascript">
                    $('<?= $_id ?>').hide();
                    $('<?= $_id ?>').up().observe('mouseover', function(){$('<?= $_id ?>').show();});
                    $('<?= $_id ?>').up().observe('mouseout',  function(){$('<?= $_id ?>').hide();});
                    </script>
                <?php endif ?>
            <?php endif ?>
            </dd>
        <?php endforeach ?>
        </dl>
    <?php endif ?>
    <?php if ($this->getLinks()): ?>
        <dl class="item-options">
            <dt><?= $this->escapeHtml($this->getLinksTitle()) ?></dt>
            <?php foreach ($this->getLinks()->getPurchasedItems() as $_link): ?>
                <dd><?= $this->escapeHtml($_link->getLinkTitle()) ?></dd>
            <?php endforeach ?>
        </dl>
    <?php endif ?>
    <?= $this->escapeHtml($_item->getDescription()) ?>
<?php endif ?>
