<?php
$obj = $form->getObject();
if (!$form->isNew()) {
    $list = $obj->getProductPropList();
    ?>
    <div class="list">
        <?php
        if (count($list) > 0) {
            echo '<table cellspacing="0" cellpadding="0" class="adminTable">';
            echo '<tr><th>Значения</th><th></th></tr>';
            foreach ($list as $list_elem) {
                ?>
                <tr>
                    <td><?php
                        $arr = array();
                        foreach ($list_elem->getTranslation() as $t) {
                            $html = '<div class="ru_en_title">';
                            if (!isset($t['available']) || $t['available']) {
                                $html .= '<span class="small_gray">' . mb_strtoupper($t['lang']) . ':</span>' . $t['variant'] . '</div>';
                                if ($t['lang'] == 'ru') {
                                    array_unshift($arr, $html);
                                } else {
                                    $arr[] = $html;
                                }
                            }
                        }
                        echo implode('<i class="br5"></i>', $arr);
                        ?></td>
                    <td>
                        <a class="custom_button custom_button_edit"
                           href="<?php echo url_for('@product_prop_list_edit?id=' . $list_elem->getId()) ?>"></a>
                        <a class="custom_button custom_button_delete"
                           onclick="propList.delete($(this) ,'<?php echo $list_elem->getId() ?>')"></a>
                    </td>
                </tr>
                <?php
            }
            echo '</table><i class="br15"></i>';
        }
        ?>
        <a class='green_btn' href='<?php echo url_for('@product_prop_list_new') . "?prop_id=" . $obj->getId() ?>'>Добавить значение</a>
    </div>

    <script type="text/javascript">
        function listSwicher() {
            if ($("input[name='product_prop[isList]']").prop('checked')) {
                $('.list').show();
            }
            else {
                $('.list').hide();
            }
        }

        $("input[name='product_prop[isList]']").change(listSwicher);

        $(document).ready(listSwicher)

    </script>
    <?php
}
?>