44 * See COPYING.txt for license details.
55 */
66
7- // @codingStandardsIgnoreFile
8-
97/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text */
108
119$ stores = $ block ->getStoresSortedBySortOrder ();
@@ -20,9 +18,8 @@ $stores = $block->getStoresSortedBySortOrder();
2018 <tr id="swatch-text-options-table">
2119 <th class="col-draggable"></th>
2220 <th class="col-default"><span><?= $ block ->escapeHtml (__ ('Is Default ' )) ?> </span></th>
23- <?php foreach ($ stores as $ _store ): ?>
24- <th class="col-swatch col-swatch-min-width col-<%- data.id %>
25- <?php if ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ): ?> _required<?php endif ; ?> "
21+ <?php foreach ($ stores as $ _store ) : ?>
22+ <th class="col-swatch col-swatch-min-width col-<%- data.id %><?= ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? ' _required ' : '' ?> "
2623 colspan="2">
2724 <span><?= $ block ->escapeHtml ($ _store ->getName ()) ?> </span>
2825 </th>
@@ -41,7 +38,7 @@ $stores = $block->getStoresSortedBySortOrder();
4138 </tr>
4239 <tr>
4340 <th colspan="<?= (int )$ colTotal ?> " class="col-actions-add">
44- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
41+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
4542 <button id="add_new_swatch_text_option_button"
4643 title="<?= $ block ->escapeHtml (__ ('Add Swatch ' )) ?> "
4744 type="button" class="action- scalable add">
@@ -57,44 +54,44 @@ $stores = $block->getStoresSortedBySortOrder();
5754 <script id="swatch-text-row-template" type="text/x-magento-template">
5855 <tr>
5956 <td class="col-draggable">
60- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
57+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
6158 <div data-role="draggable-handle"
6259 class="draggable-handle"
63- title="<?= $ block ->escapeHtml (__ ('Sort Option ' )) ?> "></div>
60+ title="<?= $ block ->escapeHtmlAttr (__ ('Sort Option ' )) ?> "></div>
6461 <?php endif ; ?>
6562 <input data-role="order" type="hidden" name="optiontext[order][<%- data.id %>]"
6663 value="<%- data.sort_order %>"
67- <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()): ?> disabled="disabled"<?php endif ; ?>
64+ <?= ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) ? ' disabled="disabled"' : '' ?>
6865 />
6966 </td>
7067 <td class="col-default">
7168 <input class="input-radio"
7269 type="<%- data.intype %>"
7370 name="defaulttext[]"
74- value="<%- data.id %>" <%- data.checked %><?php if ($ block ->getReadOnly ()): ?> disabled="disabled"<?php endif ; ?> />
71+ value="<%- data.id %>" <%- data.checked %><?= ($ block ->getReadOnly ()) ? ' disabled="disabled"' : '' ?> />
7572 </td>
76- <?php foreach ($ stores as $ _store ): ?>
73+ <?php foreach ($ stores as $ _store ) : ?>
7774 <?php $ storeId = (int )$ _store ->getId (); ?>
7875 <td class="col-swatch col-swatch-min-width col-<%- data.id %>">
7976 <input class="input-text
8077 swatch-text-field-<?= /* @noEscape */ $ storeId ?>
81- <?php if ($ storeId == \Magento \Store \Model \Store::DEFAULT_STORE_ID ): ?> required-option required-unique<?php endif ; ?> "
78+ <?= ($ storeId == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? ' required-option required-unique' : '' ?> "
8279 name="swatchtext[value][<%- data.id %>][<?= /* @noEscape */ $ storeId ?> ]"
8380 type="text" value="<%- data.swatch<?= /* @noEscape */ $ storeId ?> %>"
84- placeholder="<?= $ block ->escapeHtml (__ ("Swatch " )) ?> "/>
81+ placeholder="<?= $ block ->escapeHtmlAttr (__ ("Swatch " )) ?> "/>
8582 </td>
8683 <td class="col-swatch-min-width swatch-col-<%- data.id %>">
8784 <input name="optiontext[value][<%- data.id %>][<?= /* @noEscape */ $ storeId ?> ]"
8885 value="<%- data.store<?= /* @noEscape */ $ storeId ?> %>"
89- class="input-text<?php if ($ storeId == \Magento \Store \Model \Store::DEFAULT_STORE_ID ): ?> required-option<?php endif ; ?> "
90- type="text" <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()): ?> disabled="disabled"<?php endif ; ?>
91- placeholder="<?= $ block ->escapeHtml (__ ("Description " )) ?> "/>
86+ class="input-text<?= ($ storeId == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? ' required-option' : '' ?> "
87+ type="text" <?= ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) ? ' disabled="disabled"' : '' ?>
88+ placeholder="<?= $ block ->escapeHtmlAttr (__ ("Description " )) ?> "/>
9289 </td>
9390 <?php endforeach ; ?>
9491 <td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
9592 <input type="hidden" class="delete-flag" name="optiontext[delete][<%- data.id %>]" value="" />
96- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
97- <button title="<?= $ block ->escapeHtml (__ ('Delete ' )) ?> " type="button"
93+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
94+ <button title="<?= $ block ->escapeHtmlAttr (__ ('Delete ' )) ?> " type="button"
9895 class="action- scalable delete delete-option">
9996 <span><?= $ block ->escapeHtml (__ ('Delete ' )) ?> </span>
10097 </button>
@@ -105,10 +102,10 @@ $stores = $block->getStoresSortedBySortOrder();
105102 <script type="text/x-magento-init">
106103 {
107104 "*": {
108- "Magento_Swatches/js/text": <?= /* @escapeNotVerified */ $ block ->getJsonConfig () ?> ,
105+ "Magento_Swatches/js/text": <?= /* @noEscape */ $ block ->getJsonConfig () ?> ,
109106 "Magento_Catalog/catalog/product/attribute/unique-validate": {
110107 "element": "required-text-swatch-unique",
111- "message": "<?= $ block ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
108+ "message": "<?= $ block ->escapeJs ( $ block -> escapeHtml (__ ("The value of Admin must be unique. " ) )) ?> "
112109 }
113110 }
114111 }
0 commit comments