5
5
*/
6
6
7
7
// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound
8
+ // phpcs:disable Generic.Files.LineLength.TooLong
8
9
/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */
10
+ /** @var $escaper \Magento\Framework\Escaper */
9
11
10
12
$ stores = $ block ->getStoresSortedBySortOrder ();
11
13
?>
12
14
<fieldset class="admin__fieldset fieldset">
13
15
<legend class="legend">
14
- <span><?= $ block ->escapeHtml (__ ('Manage Swatch (Values of Your Attribute) ' )) ?> </span>
16
+ <span><?= $ escaper ->escapeHtml (__ ('Manage Swatch (Values of Your Attribute) ' )) ?> </span>
15
17
</legend><br />
16
18
<div class="admin__control-table-wrapper" id="swatch-visual-options-panel">
17
19
<table class="data-table clearfix" cellspacing="0">
18
20
<thead>
19
21
<tr id="swatch-visual-options-table">
20
22
<th class="col-draggable"></th>
21
- <th class="col-default"><span><?= $ block ->escapeHtml (__ ('Is Default ' )) ?> </span></th>
22
- <th><span><?= $ block ->escapeHtml (__ ('Swatch ' )) ?> </span></th>
23
- <?php foreach ($ stores as $ _store ) : ?>
24
- <th<?= ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? ' class="_required" ' : '' ?>
25
- <span><?= $ block ->escapeHtml ($ _store ->getName ()) ?> </span>
23
+ <th class="col-default"><span><?= $ escaper ->escapeHtml (__ ('Is Default ' )) ?> </span></th>
24
+ <th><span><?= $ escaper ->escapeHtml (__ ('Swatch ' )) ?> </span></th>
25
+ <?php foreach ($ stores as $ _store ): ?>
26
+ <th<?= ($ _store ->getId () == \Magento \Store \Model \Store::DEFAULT_STORE_ID ) ? ' class="_required" ' : '' ?> >
27
+ <span><?= $ escaper ->escapeHtml ($ _store ->getName ()) ?> </span>
26
28
</th>
27
29
<?php endforeach ; ?>
28
30
<?php $ colTotal = count ($ stores ) * 2 + 3 ; ?>
@@ -39,11 +41,11 @@ $stores = $block->getStoresSortedBySortOrder();
39
41
</tr>
40
42
<tr>
41
43
<th colspan="<?= (int )$ colTotal ?> " class="col-actions-add">
42
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
44
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
43
45
<button id="add_new_swatch_visual_option_button"
44
- title="<?= $ block ->escapeHtml (__ ('Add Swatch ' )) ?> "
46
+ title="<?= $ escaper ->escapeHtml (__ ('Add Swatch ' )) ?> "
45
47
type="button" class="action- scalable add">
46
- <span><?= $ block ->escapeHtml (__ ('Add Swatch ' )) ?> </span>
48
+ <span><?= $ escaper ->escapeHtml (__ ('Add Swatch ' )) ?> </span>
47
49
</button>
48
50
<?php endif ; ?>
49
51
</th>
@@ -55,9 +57,9 @@ $stores = $block->getStoresSortedBySortOrder();
55
57
<script id="swatch-visual-row-template" type="text/x-magento-template">
56
58
<tr>
57
59
<td class="col-draggable">
58
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
60
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
59
61
<div data-role="draggable-handle" class="draggable-handle"
60
- title="<?= $ block ->escapeHtml (__ ('Sort Option ' )) ?> "></div>
62
+ title="<?= $ escaper ->escapeHtml (__ ('Sort Option ' )) ?> "></div>
61
63
<?php endif ; ?>
62
64
<input data-role="order" type="hidden" name="optionvisual[order][<%- data.id %>]" value="<%- data.sort_order %>" <?= ($ block ->getReadOnly () || $ block ->canManageOptionDefaultOnly ()) ? ' disabled="disabled" ' : '' ?> />
63
65
</td>
@@ -71,22 +73,22 @@ $stores = $block->getStoresSortedBySortOrder();
71
73
<div class="swatch_sub-menu_container" id="swatch_container_option_<%- data.id %>">
72
74
<div class="swatch_row position-relative">
73
75
<div class="swatch_row_name colorpicker_handler">
74
- <p><?= $ block ->escapeHtml (__ ('Choose a color ' )) ?> </p>
76
+ <p><?= $ escaper ->escapeHtml (__ ('Choose a color ' )) ?> </p>
75
77
</div>
76
78
</div>
77
79
<div class="swatch_row">
78
80
<div class="swatch_row_name btn_choose_file_upload" id="swatch_choose_file_option_<%- data.id %>">
79
- <p><?= $ block ->escapeHtml (__ ('Upload a file ' )) ?> </p>
81
+ <p><?= $ escaper ->escapeHtml (__ ('Upload a file ' )) ?> </p>
80
82
</div>
81
83
</div>
82
84
<div class="swatch_row">
83
85
<div class="swatch_row_name btn_remove_swatch">
84
- <p><?= $ block ->escapeHtml (__ ('Clear ' )) ?> </p>
86
+ <p><?= $ escaper ->escapeHtml (__ ('Clear ' )) ?> </p>
85
87
</div>
86
88
</div>
87
89
</div>
88
90
</td>
89
- <?php foreach ($ stores as $ _store ) : ?>
91
+ <?php foreach ($ stores as $ _store ): ?>
90
92
<td class="swatch-col-<%- data.id %>">
91
93
<input name="optionvisual[value][<%- data.id %>][<?= (int )$ _store ->getId () ?> ]"
92
94
value="<%- data.store<?= (int ) $ _store ->getId () ?> %>"
@@ -96,10 +98,10 @@ $stores = $block->getStoresSortedBySortOrder();
96
98
<?php endforeach ; ?>
97
99
<td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
98
100
<input type="hidden" class="delete-flag" name="optionvisual[delete][<%- data.id %>]" value="" />
99
- <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()) : ?>
100
- <button title="<?= $ block ->escapeHtml (__ ('Delete ' )) ?> " type="button"
101
+ <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
102
+ <button title="<?= $ escaper ->escapeHtml (__ ('Delete ' )) ?> " type="button"
101
103
class="action- scalable delete delete-option">
102
- <span><?= $ block ->escapeHtml (__ ('Delete ' )) ?> </span>
104
+ <span><?= $ escaper ->escapeHtml (__ ('Delete ' )) ?> </span>
103
105
</button>
104
106
<?php endif ;?>
105
107
</td>
@@ -111,7 +113,7 @@ $stores = $block->getStoresSortedBySortOrder();
111
113
"Magento_Swatches/js/visual": <?= /* @noEscape */ $ block ->getJsonConfig () ?> ,
112
114
"Magento_Catalog/catalog/product/attribute/unique-validate": {
113
115
"element": "required-visual-swatch-unique",
114
- "message": "<?= $ block ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
116
+ "message": "<?= $ escaper ->escapeHtml (__ ("The value of Admin must be unique. " )) ?> "
115
117
}
116
118
}
117
119
}
0 commit comments