<?php
/*
 * @author     M2E Pro Developers Team
 * @copyright  M2E LTD
 * @license    Commercial use is forbidden
 */

// @codingStandardsIgnoreFile

/** @var Ess_M2ePro_Block_Adminhtml_Ebay_Template_Category_Chooser_Specific_Form_Renderer_Custom $this */

/** @var Ess_M2ePro_Block_Adminhtml_Ebay_Template_Category_Chooser_Specific_Form_Element_Custom $element */
$element = $this->getElement();

?>

<table class="form-list" cellspacing="0" cellpadding="0" style="width: 100%;">

    <tr>
        <td class="grid" colspan="2">

            <table class="border" cellpadding="0" cellspacing="0">
                <thead>
                <tr class="headings">
                    <th style="width: 30%;"><?php echo Mage::helper('M2ePro')->__('Name'); ?> <span class="required">*</span></th>
                    <th style="width: 30%;"><?php echo Mage::helper('M2ePro')->__('Mode'); ?> <span class="required">*</span></th>
                    <th style="width: 37%;"><?php echo Mage::helper('M2ePro')->__('Value'); ?> <span class="required">*</span></th>
                    <th style="width: 3%;">&nbsp;</th>
                </tr>
                </thead>

                <tbody id="specific_custom_table_body">
                <?php foreach ($element->getSpecifics() as $index => $specific) { ?>
                    <tr style="height: 25px; <?php if (isset($specific['__template__'])) echo ' display: none; '; ?>">
                        <td style="vertical-align:top;">
                            <?php echo $element->getModeHtml($index, $specific); ?>
                            <?php echo $element->getAttributeTitleLabelHtml($index, $specific); ?>
                            <?php echo $element->getAttributeTitleInputHtml($index, $specific); ?>
                        </td>
                        <td style="vertical-align:top;">
                            <?php echo $element->getValueModeSelectHtml($index, $specific); ?>
                        </td>
                        <td style="width: 100%; vertical-align:top; text-align: left;">
                            <?php echo $element->getValueCustomAttributeHtml($index, $specific); ?>
                            <?php echo $element->getValueCustomValueHtml($index, $specific); ?>
                        </td>
                        <td style="text-align: center; vertical-align: middle;">
                            <?php echo $this->getRemoveCustomSpecificButtonHtml(); ?>
                        </td>
                    </tr>
                <?php } ?>
                </tbody>

                <tfoot>
                <tr>
                    <td colspan="4" class="a-right"><?php echo $this->getAddCustomSpecificButtonHtml(); ?></td>
                </tr>
                </tfoot>

            </table>

        </td>
    </tr>

</table>