Skip to content

Commit 1970b92

Browse files
author
Sergey Shvets
committed
MAGETWO-54648: [GitHub] No Swatch Input for Admin Scope. No Fallback to Admin Scope #5143 #5142
1 parent 81d6abd commit 1970b92

File tree

1 file changed

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

1 file changed

+20
-20
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ $stores = $block->getStoresSortedBySortOrder();
1212
?>
1313
<fieldset class="fieldset">
1414
<legend class="legend">
15-
<span><?php /* @escapeNotVerified */ echo __('Manage Swatch (Values of Your Attribute)') ?></span>
15+
<span><?php echo $block->escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?></span>
1616
</legend>
1717
<div id="swatch-text-options-panel">
1818
<table class="data-table clearfix" cellspacing="0">
1919
<thead>
2020
<tr id="swatch-text-options-table">
2121
<th class="col-draggable"></th>
22-
<th class="col-default"><span><?php /* @escapeNotVerified */ echo __('Is Default') ?></span></th>
22+
<th class="col-default"><span><?php echo $block->escapeHtml(__('Is Default')) ?></span></th>
2323
<?php foreach ($stores as $_store): ?>
2424
<th class="col-swatch col-<%- data.id %>
2525
<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> _required<?php endif; ?>"
2626
colspan="2">
27-
<span><?php /* @escapeNotVerified */ echo $_store->getName() ?></span>
27+
<span><?php echo $block->escapeHtml($_store->getName()) ?></span>
2828
</th>
2929
<?php endforeach; ?>
3030
<?php $colTotal = count($stores) * 2 + 3; ?>
@@ -39,12 +39,12 @@ $stores = $block->getStoresSortedBySortOrder();
3939
</th>
4040
</tr>
4141
<tr>
42-
<th colspan="<?php /* @escapeNotVerified */ echo $colTotal; ?>" class="col-actions-add">
42+
<th colspan="<?php echo (int)$colTotal; ?>" class="col-actions-add">
4343
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
44-
<button id="add_new_swatch_text_option_button" title="
45-
<?php /* @escapeNotVerified */ echo __('Add Swatch'); ?>"
44+
<button id="add_new_swatch_text_option_button"
45+
title="<?php echo $block->escapeHtml(__('Add Swatch')); ?>"
4646
type="button" class="action- scalable add">
47-
<span><?php /* @escapeNotVerified */ echo __('Add Swatch'); ?></span>
47+
<span><?php echo $block->escapeHtml(__('Add Swatch')); ?></span>
4848
</button>
4949
<?php endif; ?>
5050
</th>
@@ -59,7 +59,7 @@ $stores = $block->getStoresSortedBySortOrder();
5959
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
6060
<div data-role="draggable-handle"
6161
class="draggable-handle"
62-
title="<?php /* @escapeNotVerified */ echo __('Sort Option'); ?>"></div>
62+
title="<?php echo $block->escapeHtml(__('Sort Option')); ?>"></div>
6363
<?php endif; ?>
6464
<input data-role="order" type="hidden" name="optiontext[order][<%- data.id %>]"
6565
value="<%- data.sort_order %>"
@@ -73,29 +73,29 @@ $stores = $block->getStoresSortedBySortOrder();
7373
value="<%- data.id %>" <%- data.checked %><?php if ($block->getReadOnly()):?>disabled="disabled"<?php endif;?>/>
7474
</td>
7575
<?php foreach ($stores as $_store): ?>
76+
<?php $storeId = (int)$_store->getId(); ?>
7677
<td class="col-swatch col-<%- data.id %>">
7778
<input class="input-text
78-
swatch-text-field-<?php /* @escapeNotVerified */ echo $_store->getId() ?>
79-
<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option<?php endif; ?>"
80-
name="swatchtext[value][<%- data.id %>][<?php /* @escapeNotVerified */ echo $_store->getId() ?>]"
81-
type="text" value="<%- data.swatch<?php /* @escapeNotVerified */ echo $_store->getId() ?> %>"
82-
placeholder="<?php echo __("Swatch"); ?>" />
79+
swatch-text-field-<?php /* @noEscape */ echo $storeId; ?>
80+
<?php if ($storeId == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option<?php endif; ?>"
81+
name="swatchtext[value][<%- data.id %>][<?php /* @noEscape */ echo $storeId; ?>]"
82+
type="text" value="<%- data.swatch<?php /* @noEscape */ echo $storeId; ?> %>"
83+
placeholder="<?php echo $block->escapeHtml(__("Swatch")); ?>"/>
8384
</td>
8485
<td class="swatch-col-<%- data.id %>">
85-
<input name="optiontext[value][<%- data.id %>][<?php /* @escapeNotVerified */ echo $_store->getId() ?>]"
86-
value="<%- data.store<?php /* @escapeNotVerified */ echo $_store->getId() ?> %>"
87-
class="input-text<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option<?php endif; ?>"
86+
<input name="optiontext[value][<%- data.id %>][<?php /* @noEscape */ echo $storeId; ?>]"
87+
value="<%- data.store<?php /* @noEscape */ echo $storeId; ?> %>"
88+
class="input-text<?php if ($storeId == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option<?php endif; ?>"
8889
type="text" <?php if ($block->getReadOnly() || $block->canManageOptionDefaultOnly()):?> disabled="disabled"<?php endif;?>
8990
placeholder="<?php echo __("Description"); ?>" />
9091
</td>
9192
<?php endforeach; ?>
9293
<td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
9394
<input type="hidden" class="delete-flag" name="optiontext[delete][<%- data.id %>]" value="" />
9495
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
95-
<button title="<?php /* @escapeNotVerified */ echo __('Delete') ?>" type="button"
96-
class="action- scalable delete delete-option"
97-
>
98-
<span><?php /* @escapeNotVerified */ echo __('Delete') ?></span>
96+
<button title="<?php echo $block->escapeHtml(__('Delete')); ?>" type="button"
97+
class="action- scalable delete delete-option">
98+
<span><?php echo $block->escapeHtml(__('Delete')); ?></span>
9999
</button>
100100
<?php endif;?>
101101
</td>

0 commit comments

Comments
 (0)