<?php

/** @var Ess_M2ePro_Block_Adminhtml_Walmart_ProductType_Edit_FieldTemplates $this */
$attributes = $this->getAvailableAttributes();

?>

<div id="template_field" style="display: none;">
    <div id="field_container_%id%" class="admin__field field">
        <table>
            <tr>
                <td class="label">
                    <label>%title%: %spanRequired%</label>
                </td>
                <td class="value">
                    <select id="field_mode_%id%" name="field_data%formId%[mode]" class="%modeClass% M2ePro-validate-product-type-specific-mode">
                        <option value="<?= Ess_M2ePro_Model_Walmart_ProductType::FIELD_NOT_CONFIGURED; ?>" style="color: grey;"><?= $this->__('Not Selected'); ?></option>
                        <option value="<?= Ess_M2ePro_Model_Walmart_ProductType::FIELD_CUSTOM_VALUE; ?>" style="color: black;"><?= $this->__('Custom Value'); ?></option>
                        <option value="<?= Ess_M2ePro_Model_Walmart_ProductType::FIELD_CUSTOM_ATTRIBUTE; ?>" style="color: black;"><?= $this->__('Custom Attribute'); ?></option>
                    </select>
                <td class="value">
                    <img src="<?php echo $this->getSkinUrl('M2ePro/images/tool-tip-icon.png'); ?>" class="tool-tip-image">
                    <span class="tool-tip-message" style="display: none;">
                        <img src="<?php echo $this->getSkinUrl('M2ePro/images/help.png'); ?>">
                        <span>%tooltip%</span>
                    </span>
                </td>
                <td id="custom_value_container_%id%"
                    class="value product_type_value_container"
                    style="display: none;">

                    <select id="field_attribute_%id%"
                            name="field_data%formId%[attribute_code]"
                            class="select admin__control-select product_type_setting_element"
                            style="display: none;">
                        <option value="0" selected="selected"><?= Mage::helper('M2ePro')->__('None'); ?></option>
                        %additional_attribute_options%
                        <optgroup label="Magento Attributes" class="M2ePro-custom-attribute-optgroup">
                            <?php foreach ($attributes as $attribute) : ?>
                                <option value="<?php echo $attribute['code']; ?>">
                                    <?php echo $this->escapeHtml($attribute['label']); ?>
                                </option>
                            <?php endforeach; ?>
                        </optgroup>
                    </select>
                </td>
            </tr>
        </table>
    </div>
</div>

<div id="template_image_option" style="display: none;">
    <option value="image"><?= Mage::helper('M2ePro')->__('Product Base Image'); ?></option>
</div>

<div id="template_images_optgroup" style="display: none;">
    <optgroup label="<?= Mage::helper('M2ePro')->__('Product Images'); ?>">
        <option value="1">1</option>
        <option value="2"><?= Mage::helper('M2ePro')->__('Up to 2'); ?></option>
        <option value="3"><?= Mage::helper('M2ePro')->__('Up to 3'); ?></option>
        <option value="4"><?= Mage::helper('M2ePro')->__('Up to 4'); ?></option>
        <option value="5"><?= Mage::helper('M2ePro')->__('Up to 5'); ?></option>
        <option value="6"><?= Mage::helper('M2ePro')->__('Up to 6'); ?></option>
        <option value="7"><?= Mage::helper('M2ePro')->__('Up to 7'); ?></option>
        <option value="8"><?= Mage::helper('M2ePro')->__('Up to 8'); ?></option>
    </optgroup>
</div>

<div id="template_fieldset" style="display: none;" class="entry-edit">
    <div class="fieldset-wrap">
        <div class="entry-edit %fieldset_id%_hide" id="%fieldset_id%">
            <div class="entry-edit-head">
                <h4 class="icon-head head-edit-form fieldset-legend">%title%</h4>
            </div>

            <div class="fieldset">
                <div class="hor-scroll">
                    <div class="block_notices_module" title="%title%">
                        %tooltip%
                    </div>
                    <table class="form-list" cellspacing="0" cellpadding="0">
                        <tbody></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
