<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Labels  */
?>

<div class="fieldset-wrapper admin__collapsible-block-wrapper opened" id="manage-titles-wrapper">
    <div class="fieldset-wrapper-title">
        <strong class="admin__collapsible-title" data-bs-toggle="collapse" data-bs-target="#manage-titles-content">
            <span><?= $block->escapeHtml(__('Manage Titles (Size, Color, etc.)')) ?></span>
        </strong>
    </div>
    <div class="fieldset-wrapper-content in collapse" id="manage-titles-content">
        <fieldset class="admin__fieldset fieldset">
            <div class="admin__control-table-wrapper">
                <table class="admin__control-table" id="attribute-labels-table">
                    <thead>
                    <tr>
                        <?php foreach ($block->getStores() as $_store): ?>
                            <th class="col-store-view"><?= $block->escapeHtml($_store->getName()) ?></th>
                        <?php endforeach; ?>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <?php $_labels = $block->getLabelValues() ?>
                        <?php foreach ($block->getStores() as $_store): ?>
                            <td class="col-store-view">
                                <?php $isRequired = $_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID; ?>
                                <?php $isRequiredClass = $isRequired ? 'required-option' : ''; ?>
                                <input class="input-text validate-no-html-tags <?= /* @noEscape */ $isRequiredClass ?>"
                                       type="text"
                                       name="frontend_label[<?= $block->escapeHtmlAttr($_store->getId()) ?>]"
                                       value="<?= $block->escapeHtmlAttr($_labels[$_store->getId()]) ?>"
                                    <?php if ($block->getReadOnly()): ?>
                                        disabled="disabled"
                                    <?php endif;?>/>
                            </td>
                        <?php endforeach; ?>
                    </tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
    </div>
</div>
