<?php
/**
 * OpenMage
 *
 * 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 at https://opensource.org/license/afl-3-0-php
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://www.openmage.org)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_File $this */
?>
<script type="text/javascript">

OptionTemplateFile = '<table class="border" cellpadding="0" cellspacing="0">'+
        '<tr class="headings">'+
            <?php if ($this->getCanReadPrice() !== false) : ?>
            '<th class="type-price">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Price')); ?> + '</th>' +
            '<th class="type-type">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Price Type')); ?> + '</th>' +
            <?php endif ?>
            '<th class="type-sku">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('SKU')); ?> + '</th>' +
            '<th class="type-title">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Allowed File Extensions')); ?> + ' <span class="required">*</span>' + '</th>'+
            '<th class="last">' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Maximum Image Size')); ?> + '</th>' +
        '</tr>' +
        '<tr>' +
            <?php if ($this->getCanReadPrice() !== false) : ?>
            '<td><input class="input-text validate-zero-or-greater" type="text" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif ?>></td>' +
            '<td>' + <?php echo $this->helper('core')->jsonEncode($this->getPriceTypeSelectHtml()) ?> + '</td>' +
            <?php else: ?>
            '<input type="hidden" name="product[options][{{option_id}}][price]">' +
            '<input type="hidden" name="product[options][{{option_id}}][price_type]" id="product_option_{{option_id}}_price_type">' +
            <?php endif ?>
            '<td><input type="text" class="input-text" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>' +
            '<td><input class="input-text required-entry" type="text" name="product[options][{{option_id}}][file_extension]" value="{{file_extension}}"></td>' +
            '<td class="type-last last" nowrap><input class="input-text" type="text" name="product[options][{{option_id}}][image_size_x]" value="{{image_size_x}}">' +
                <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('x')) ?> +
                '<input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}">' +
                 <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('px.')) ?> +
            '<br/>' + <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('leave blank if its not an image')) ?> + '</td>' +
        '</tr>'+
    '</table>';

if ($('option_panel_type_file')) {
    $('option_panel_type_file').remove();
}

</script>
