4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
- // @codingStandardsIgnoreFile
7
+ // phpcs:disable Magento2.Files.LineLength
8
8
9
9
/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text */
10
10
@@ -20,9 +20,8 @@ $stores = $block->getStoresSortedBySortOrder();
20
20
<tr id="swatch-text-options-table">
21
21
<th class="col-draggable"></th>
22
22
<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 ; ?> "
23
+ <?php foreach ($ stores as $ _store ) : ?>
24
+ <th class="col-swatch col-swatch-min-width col-<%- data.id %><?= ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? '_required ' : '' ?> "
26
25
colspan="2">
27
26
<span><?= $ block ->escapeHtml ($ _store ->getName ()) ?> </span>
28
27
</th>
@@ -41,7 +40,7 @@ $stores = $block->getStoresSortedBySortOrder();
41
40
</tr>
42
41
<tr>
43
42
<th colspan="<?= (int )$ colTotal ?> " class="col-actions-add">
44
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
43
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
45
44
<button id="add_new_swatch_text_option_button"
46
45
title="<?= $ block ->escapeHtml (__ ('Add Swatch ' )) ?> "
47
46
type="button" class="action- scalable add">
@@ -57,44 +56,44 @@ $stores = $block->getStoresSortedBySortOrder();
57
56
<script id="swatch-text-row-template" type="text/x-magento-template">
58
57
<tr>
59
58
<td class="col-draggable">
60
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
59
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
61
60
<div data-role="draggable-handle"
62
61
class="draggable-handle"
63
- title="<?= $ block ->escapeHtml (__ ('Sort Option ' )) ?> "></div>
62
+ title="<?= $ block ->escapeHtmlAttr (__ ('Sort Option ' )) ?> "></div>
64
63
<?php endif ; ?>
65
64
<input data-role="order" type="hidden" name="optiontext[order][<%- data.id %>]"
66
65
value="<%- data.sort_order %>"
67
- <?php if ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()): ?> disabled="disabled"<?php endif ; ?>
66
+ <?= ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) ? ' disabled="disabled"' : '' ?>
68
67
/>
69
68
</td>
70
69
<td class="col-default">
71
70
<input class="input-radio"
72
71
type="<%- data.intype %>"
73
72
name="defaulttext[]"
74
- value="<%- data.id %>" <%- data.checked %><?php if ($ block ->getReadOnly ()): ?> disabled="disabled"<?php endif ; ?> />
73
+ value="<%- data.id %>" <%- data.checked %><?= ($ block ->getReadOnly ()) ? ' disabled="disabled"' : '' ?> />
75
74
</td>
76
- <?php foreach ($ stores as $ _store ): ?>
75
+ <?php foreach ($ stores as $ _store ) : ?>
77
76
<?php $ storeId = (int )$ _store ->getId (); ?>
78
77
<td class="col-swatch col-swatch-min-width col-<%- data.id %>">
79
78
<input class="input-text
80
79
swatch-text-field-<?= /* @noEscape */ $ storeId ?>
81
- <?php if ($ storeId == \Magento \Store \Model \Store::DEFAULT_STORE_ID ): ?> required-option required-unique<?php endif ; ?> "
80
+ <?= ($ storeId == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? ' required-option required-unique' : '' ?> "
82
81
name="swatchtext[value][<%- data.id %>][<?= /* @noEscape */ $ storeId ?> ]"
83
82
type="text" value="<%- data.swatch<?= /* @noEscape */ $ storeId ?> %>"
84
- placeholder="<?= $ block ->escapeHtml (__ ("Swatch " )) ?> "/>
83
+ placeholder="<?= $ block ->escapeHtmlAttr (__ ("Swatch " )) ?> "/>
85
84
</td>
86
85
<td class="col-swatch-min-width swatch-col-<%- data.id %>">
87
86
<input name="optiontext[value][<%- data.id %>][<?= /* @noEscape */ $ storeId ?> ]"
88
87
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 " )) ?> "/>
88
+ class="input-text<?= ($ storeId == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? ' required-option' : '' ?> "
89
+ type="text" <?= ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) ? ' disabled="disabled"' : '' ?>
90
+ placeholder="<?= $ block ->escapeHtmlAttr (__ ("Description " )) ?> "/>
92
91
</td>
93
92
<?php endforeach ; ?>
94
93
<td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
95
94
<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"
95
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
96
+ <button title="<?= $ block ->escapeHtmlAttr (__ ('Delete ' )) ?> " type="button"
98
97
class="action- scalable delete delete-option">
99
98
<span><?= $ block ->escapeHtml (__ ('Delete ' )) ?> </span>
100
99
</button>
@@ -105,10 +104,10 @@ $stores = $block->getStoresSortedBySortOrder();
105
104
<script type="text/x-magento-init">
106
105
{
107
106
"*": {
108
- "Magento_Swatches/js/text": <?= /* @escapeNotVerified */ $ block ->getJsonConfig () ?> ,
107
+ "Magento_Swatches/js/text": <?= /* @noEscape */ $ block ->getJsonConfig () ?> ,
109
108
"Magento_Catalog/catalog/product/attribute/unique-validate": {
110
109
"element": "required-text-swatch-unique",
111
- "message": "<?= $ block ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
110
+ "message": "<?= $ block ->escapeJs ( $ block -> escapeHtml (__ ("The value of Admin must be unique. " ) )) ?> "
112
111
}
113
112
}
114
113
}
0 commit comments