11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2024 Adobe
4+ * All Rights Reserved .
55 */
66
77// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound
8- /** @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options */
8+ // phpcs:disable Generic.Files.LineLength.TooLong
9+ /**
10+ * @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options
11+ * @var \Magento\Framework\Escaper $escaper
12+ */
13+
914
1015$ stores = $ block ->getStoresSortedBySortOrder ();
1116?>
1217<fieldset class="admin__fieldset fieldset">
1318 <legend class="legend">
14- <span><?= $ block ->escapeHtml (__ ('Manage Options (Values of Your Attribute) ' )) ?> </span>
19+ <span><?= $ escaper ->escapeHtml (__ ('Manage Options (Values of Your Attribute) ' )) ?> </span>
1520 </legend><br />
1621 <div class="admin__control-table-wrapper" id="manage-options-panel" data-index="attribute_options_select_container">
1722 <table class="admin__control-table" data-index="attribute_options_select">
1823 <thead>
1924 <tr id="attribute-options-table">
2025 <th class="col-draggable"></th>
2126 <th class="col-default control-table-actions-th">
22- <span><?= $ block ->escapeHtml (__ ('Is Default ' )) ?> </span>
27+ <span><?= $ escaper ->escapeHtml (__ ('Is Default ' )) ?> </span>
2328 </th>
2429 <?php
25- foreach ($ stores as $ _store ) :?>
26- <th<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) :?> class="_required"<?php endif ; ?> >
27- <span><?= $ block ->escapeHtml (__ ($ _store ->getName ())) ?> </span>
30+ foreach ($ stores as $ _store ):?>
31+ <th<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ):?> class="_required"<?php endif ; ?> >
32+ <span><?= $ escaper ->escapeHtml (__ ($ _store ->getName ())) ?> </span>
2833 </th>
2934 <?php endforeach ;
3035 $ storetotal = count ($ stores ) + 3 ;
@@ -38,15 +43,22 @@ $stores = $block->getStoresSortedBySortOrder();
3843 <th colspan="<?= (int )$ storetotal ?> " class="validation">
3944 <input type="hidden" class="required-dropdown-attribute-entry" name="dropdown_attribute_validation"/>
4045 <input type="hidden" class="required-dropdown-attribute-unique" name="dropdown_attribute_validation_unique"/>
46+ <input type="hidden" name="reset_is-default_option"/>
4147 </th>
4248 </tr>
4349 <tr>
4450 <th colspan="<?= (int ) $ storetotal ?> " class="col-actions-add">
45- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) :?>
51+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
4652 <button id="add_new_option_button" data-action="add_new_row"
47- title="<?= $ block ->escapeHtml (__ ('Add Option ' )) ?> "
53+ title="<?= $ escaper ->escapeHtml (__ ('Add Option ' )) ?> "
4854 type="button" class="action- scalable add">
49- <span><?= $ block ->escapeHtml (__ ('Add Option ' )) ?> </span>
55+ <span><?= $ escaper ->escapeHtml (__ ('Add Option ' )) ?> </span>
56+ </button>
57+
58+ <button id="reset_default_options_option_button"
59+ title="<?= $ escaper ->escapeHtml (__ ('Reset Is Default ' )) ?> "
60+ type="button" class="action- scalable reset">
61+ <span><?= $ escaper ->escapeHtml (__ ('Reset Is Default ' )) ?> </span>
5062 </button>
5163 <?php endif ; ?>
5264 </th>
@@ -58,26 +70,26 @@ $stores = $block->getStoresSortedBySortOrder();
5870 <script id="row-template" type="text/x-magento-template">
5971 <tr <% if (data.rowClasses) { %>class="<%- data.rowClasses %>"<% } %>>
6072 <td class="col-draggable">
61- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) :?>
73+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
6274 <div data-role="draggable-handle" class="draggable-handle"
63- title="<?= $ block ->escapeHtml (__ ('Sort Option ' )) ?> ">
75+ title="<?= $ escaper ->escapeHtml (__ ('Sort Option ' )) ?> ">
6476 </div>
6577 <?php endif ; ?>
66- <input data-role="order" type="hidden" name="option[order][<%- data.id %>]" value="<%- data.sort_order %>" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) :?> disabled="disabled"<?php endif ; ?> />
78+ <input data-role="order" type="hidden" name="option[order][<%- data.id %>]" value="<%- data.sort_order %>" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()):?> disabled="disabled"<?php endif ; ?> />
6779 </td>
6880 <td class="col-default control-table-actions-cell">
69- <input class="input-radio" type="<%- data.intype %>" name="default[]" value="<%- data.id %>" <%- data.checked %><?php if ($ block ->getReadOnly ()) :?> disabled="disabled"<?php endif ;?> />
81+ <input class="input-radio" type="<%- data.intype %>" name="default[]" value="<%- data.id %>" <%- data.checked %><?php if ($ block ->getReadOnly ()):?> disabled="disabled"<?php endif ;?> />
7082 </td>
71- <?php foreach ($ stores as $ _store ) :?>
72- <td class="col-<%- data.id %>"><input name="option[value][<%- data.id %>][<?= (int ) $ _store ->getId () ?> ]" value="<%- data.store<?= /* @noEscape */ (int ) $ _store ->getId () ?> %>" class="input-text<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) :?> required-option required-unique<?php endif ; ?> " type="text" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) :?> disabled="disabled"<?php endif ;?> /></td>
83+ <?php foreach ($ stores as $ _store ):?>
84+ <td class="col-<%- data.id %>"><input name="option[value][<%- data.id %>][<?= (int ) $ _store ->getId () ?> ]" value="<%- data.store<?= /* @noEscape */ (int ) $ _store ->getId () ?> %>" class="input-text<?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ):?> required-option required-unique<?php endif ; ?> " type="text" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()):?> disabled="disabled"<?php endif ;?> /></td>
7385 <?php endforeach ; ?>
7486 <td id="delete_button_container_<%- data.id %>" class="col-delete">
7587 <input type="hidden" class="delete-flag" name="option[delete][<%- data.id %>]" value="" />
76- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) :?>
77- <button id="delete_button_<%- data.id %>" title="<?= $ block ->escapeHtml (__ ('Delete ' )) ?> " type="button"
88+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()):?>
89+ <button id="delete_button_<%- data.id %>" title="<?= $ escaper ->escapeHtml (__ ('Delete ' )) ?> " type="button"
7890 class="action- scalable delete delete-option"
7991 >
80- <span><?= $ block ->escapeHtml (__ ('Delete ' )) ?> </span>
92+ <span><?= $ escaper ->escapeHtml (__ ('Delete ' )) ?> </span>
8193 </button>
8294 <?php endif ;?>
8395 </td>
@@ -102,7 +114,7 @@ $stores = $block->getStoresSortedBySortOrder();
102114 },
103115 "Magento_Catalog/catalog/product/attribute/unique-validate": {
104116 "element": "required-dropdown-attribute-unique",
105- "message": "<?= $ block ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
117+ "message": "<?= $ escaper ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
106118 }
107119 }
108120 }
0 commit comments