Skip to content

Commit 7ec9c5c

Browse files
committed
Merge remote-tracking branch '37457/patch-1' into comm_prs_248beta1
2 parents db49817 + 830f1a3 commit 7ec9c5c

File tree

1 file changed

+21
-19
lines changed
  • app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute

1 file changed

+21
-19
lines changed

app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@
55
*/
66

77
// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound
8+
// phpcs:disable Generic.Files.LineLength.TooLong
89
/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */
10+
/** @var $escaper \Magento\Framework\Escaper */
911

1012
$stores = $block->getStoresSortedBySortOrder();
1113
?>
1214
<fieldset class="admin__fieldset fieldset">
1315
<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>
1517
</legend><br />
1618
<div class="admin__control-table-wrapper" id="swatch-visual-options-panel">
1719
<table class="data-table clearfix" cellspacing="0">
1820
<thead>
1921
<tr id="swatch-visual-options-table">
2022
<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>
2628
</th>
2729
<?php endforeach; ?>
2830
<?php $colTotal = count($stores) * 2 + 3; ?>
@@ -39,11 +41,11 @@ $stores = $block->getStoresSortedBySortOrder();
3941
</tr>
4042
<tr>
4143
<th colspan="<?= (int)$colTotal ?>" class="col-actions-add">
42-
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?>
44+
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
4345
<button id="add_new_swatch_visual_option_button"
44-
title="<?= $block->escapeHtml(__('Add Swatch')) ?>"
46+
title="<?= $escaper->escapeHtml(__('Add Swatch')) ?>"
4547
type="button" class="action- scalable add">
46-
<span><?= $block->escapeHtml(__('Add Swatch')) ?></span>
48+
<span><?= $escaper->escapeHtml(__('Add Swatch')) ?></span>
4749
</button>
4850
<?php endif; ?>
4951
</th>
@@ -55,9 +57,9 @@ $stores = $block->getStoresSortedBySortOrder();
5557
<script id="swatch-visual-row-template" type="text/x-magento-template">
5658
<tr>
5759
<td class="col-draggable">
58-
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?>
60+
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
5961
<div data-role="draggable-handle" class="draggable-handle"
60-
title="<?= $block->escapeHtml(__('Sort Option')) ?>"></div>
62+
title="<?= $escaper->escapeHtml(__('Sort Option')) ?>"></div>
6163
<?php endif; ?>
6264
<input data-role="order" type="hidden" name="optionvisual[order][<%- data.id %>]" value="<%- data.sort_order %>" <?= ($block->getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?>/>
6365
</td>
@@ -71,22 +73,22 @@ $stores = $block->getStoresSortedBySortOrder();
7173
<div class="swatch_sub-menu_container" id="swatch_container_option_<%- data.id %>">
7274
<div class="swatch_row position-relative">
7375
<div class="swatch_row_name colorpicker_handler">
74-
<p><?= $block->escapeHtml(__('Choose a color')) ?></p>
76+
<p><?= $escaper->escapeHtml(__('Choose a color')) ?></p>
7577
</div>
7678
</div>
7779
<div class="swatch_row">
7880
<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>
8082
</div>
8183
</div>
8284
<div class="swatch_row">
8385
<div class="swatch_row_name btn_remove_swatch">
84-
<p><?= $block->escapeHtml(__('Clear')) ?></p>
86+
<p><?= $escaper->escapeHtml(__('Clear')) ?></p>
8587
</div>
8688
</div>
8789
</div>
8890
</td>
89-
<?php foreach ($stores as $_store) : ?>
91+
<?php foreach ($stores as $_store): ?>
9092
<td class="swatch-col-<%- data.id %>">
9193
<input name="optionvisual[value][<%- data.id %>][<?= (int)$_store->getId() ?>]"
9294
value="<%- data.store<?= (int) $_store->getId() ?> %>"
@@ -96,10 +98,10 @@ $stores = $block->getStoresSortedBySortOrder();
9698
<?php endforeach; ?>
9799
<td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
98100
<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"
101103
class="action- scalable delete delete-option">
102-
<span><?= $block->escapeHtml(__('Delete')) ?></span>
104+
<span><?= $escaper->escapeHtml(__('Delete')) ?></span>
103105
</button>
104106
<?php endif;?>
105107
</td>
@@ -111,7 +113,7 @@ $stores = $block->getStoresSortedBySortOrder();
111113
"Magento_Swatches/js/visual": <?= /* @noEscape */ $block->getJsonConfig() ?> ,
112114
"Magento_Catalog/catalog/product/attribute/unique-validate": {
113115
"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.")) ?>"
115117
}
116118
}
117119
}

0 commit comments

Comments
 (0)