Skip to content

Commit c25a002

Browse files
author
Joan He
committed
Merge remote-tracking branch 'arcticfoxes/MAGETWO-55094' into 2.3-develop-pr
2 parents c306dc5 + 376d3ac commit c25a002

File tree

12 files changed

+194
-261
lines changed

12 files changed

+194
-261
lines changed

app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml

Lines changed: 75 additions & 129 deletions
Large diffs are not rendered by default.

app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,30 @@
88
<div class="add-video-button-container">
99
<button
1010
id="add_video_button"
11-
title="<?= /* @escapeNotVerified */ $addVideoTitle ?>"
11+
title="<?= $block->escapeHtmlAttr($addVideoTitle) ?>"
1212
type="button"
1313
class="action-secondary"
1414
onclick="jQuery('#new-video').modal('openModal'); jQuery('#new_video_form')[0].reset();"
1515
data-ui-id="widget-button-1">
16-
<span><?= /* @escapeNotVerified */ __('Add Video') ?></span>
16+
<span><?= $block->escapeHtml(__('Add Video')) ?></span>
1717
</button>
1818
</div>
1919
</div>
20-
<div id="<?= /* @escapeNotVerified */ $htmlId ?>-container"
20+
<div id="<?= $block->escapeHtmlAttr($htmlId) ?>-container"
2121
class="images"
2222
data-mage-init='{"baseImage":{}}'
23-
data-max-file-size="<?= /* @escapeNotVerified */ $fileMaxSize ?>"
23+
data-max-file-size="<?= $block->escapeHtmlAttr($fileMaxSize) ?>"
2424
>
2525
<div class="image image-placeholder">
26-
<input type="file" name="image" data-url="<?= /* @escapeNotVerified */ $uploadUrl ?>" multiple="multiple" />
27-
<img class="spacer" src="<?= /* @escapeNotVerified */ $spacerImage ?>"/>
28-
<p class="image-placeholder-text"><?= /* @escapeNotVerified */ $imagePlaceholderText ?></p>
26+
<input type="file" name="image" data-url="<?= $block->escapeUrl($uploadUrl) ?>" multiple="multiple" />
27+
<img class="spacer" src="<?= $block->escapeUrl($spacerImage) ?>"/>
28+
<p class="image-placeholder-text"><?= $block->escapeHtml($imagePlaceholderText) ?></p>
2929
</div>
30-
<script id="<?= /* @escapeNotVerified */ $htmlId ?>-template"
30+
<script id="<?= $block->escapeHtmlAttr($htmlId) ?>-template"
3131
data-template="image"
3232
type="text/x-magento-template">
3333
<div class="image">
34-
<img class="spacer" src="<?= /* @escapeNotVerified */ $spacerImage ?>"/>
34+
<img class="spacer" src="<?= $block->escapeUrl($spacerImage) ?>"/>
3535
<img
3636
class="product-image"
3737
src="<%- data.url %>"
@@ -42,25 +42,25 @@
4242
type="button"
4343
class="action-delete"
4444
data-role="delete-button"
45-
title="<?= /* @escapeNotVerified */ $deleteImageText ?>">
46-
<span><?= /* @escapeNotVerified */ $deleteImageText ?></span>
45+
title="<?= $block->escapeHtmlAttr($deleteImageText) ?>">
46+
<span><?= $block->escapeHtml($deleteImageText) ?></span>
4747
</button>
4848
<button
4949
type="button"
5050
class="action-make-base"
5151
data-role="make-base-button"
52-
title="<?= /* @escapeNotVerified */ $makeBaseText ?>">
53-
<span><?= /* @escapeNotVerified */ $makeBaseText ?></span>
52+
title="<?= $block->escapeHtmlAttr($makeBaseText) ?>">
53+
<span><?= $block->escapeHtml($makeBaseText) ?></span>
5454
</button>
5555
<div class="draggable-handle"></div>
5656
</div>
5757
<div class="image-label"></div>
58-
<div class="image-fade"><span><?= /* @escapeNotVerified */ $hiddenText ?></span></div>
58+
<div class="image-fade"><span><?= $block->escapeHtml($hiddenText) ?></span></div>
5959
</div>
6060
</script>
6161
</div>
6262
<span class="action-manage-images" data-activate-tab="image-management">
63-
<span><?= /* @escapeNotVerified */ $imageManagementText ?></span>
63+
<span><?= $block->escapeHtml($imageManagementText) ?></span>
6464
</span>
6565
<script>
6666
require([

app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/slideout/form.phtml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
*/
66
/* @var Magento\ProductVideo\Block\Adminhtml\Product\Edit\NewVideo $block */
77
?>
8-
<div id="<?= /* @escapeNotVerified */ $block->getNameInLayout() ?>" style="display:none"
9-
data-modal-info='<?= /* @escapeNotVerified */ $block->getWidgetOptions() ?>'
8+
<div id="<?= $block->escapeHtmlAttr($block->getNameInLayout()) ?>" style="display:none"
9+
data-modal-info='<?= /* @noEscape */ $block->getWidgetOptions() ?>'
1010
>
11-
<?= /* @escapeNotVerified */ $block->getFormHtml() ?>
11+
<?= $block->getFormHtml() ?>
1212
<div id="video-player-preview-location" class="video-player-sidebar">
1313
<div class="video-player-container"></div>
1414
<div class="video-information title">
15-
<label><?= /* @escapeNotVerified */ __('Title:') ?> </label><span></span>
15+
<label><?= $block->escapeHtml(__('Title:')) ?> </label><span></span>
1616
</div>
1717
<div class="video-information uploaded">
18-
<label><?= /* @escapeNotVerified */ __('Uploaded:') ?> </label><span></span>
18+
<label><?= $block->escapeHtml(__('Uploaded:')) ?> </label><span></span>
1919
</div>
2020
<div class="video-information uploader">
21-
<label><?= /* @escapeNotVerified */ __('Uploader:') ?> </label><span></span>
21+
<label><?= $block->escapeHtml(__('Uploader:')) ?> </label><span></span>
2222
</div>
2323
<div class="video-information duration">
24-
<label><?= /* @escapeNotVerified */ __('Duration:') ?> </label><span></span>
24+
<label><?= $block->escapeHtml(__('Duration:')) ?> </label><span></span>
2525
</div>
2626
</div>
2727
</div>

app/code/Magento/ProductVideo/view/frontend/templates/product/view/gallery.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
{
1515
"[data-gallery-role=gallery-placeholder]": {
1616
"Magento_ProductVideo/js/fotorama-add-video-events": {
17-
"videoData": <?= /* @escapeNotVerified */ $block->getMediaGalleryDataJson() ?>,
18-
"videoSettings": <?= /* @escapeNotVerified */ $block->getVideoSettingsJson() ?>,
17+
"videoData": <?= /* @noEscape */ $block->getMediaGalleryDataJson() ?>,
18+
"videoSettings": <?= /* @noEscape */ $block->getVideoSettingsJson() ?>,
1919
"optionsVideoData": <?= /* @noEscape */ $block->getOptionsMediaGalleryDataJson() ?>
2020
}
2121
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
98
?>
109
<script type="text/x-magento-init">
1110
{
1211
"*": {
1312
"swatchesProductAttributes": {
14-
"hiddenFields": <?= /* @escapeNotVerified */ json_encode($this->helper('Magento\Catalog\Helper\Data')->getAttributeHiddenFields()) ?>
13+
"hiddenFields": <?= /* @noEscape */ json_encode($this->helper(Magento\Catalog\Helper\Data::class)->getAttributeHiddenFields()) ?>
1514
}
1615
}
1716
}

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

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
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
}

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */
108

119
$stores = $block->getStoresSortedBySortOrder();
1210
?>
1311
<fieldset class="admin__fieldset fieldset">
1412
<legend class="legend">
15-
<span><?= $block->escapeHtml( __('Manage Swatch (Values of Your Attribute)')) ?></span>
13+
<span><?= $block->escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?></span>
1614
</legend><br />
1715
<div class="admin__control-table-wrapper" id="swatch-visual-options-panel">
1816
<table class="data-table clearfix" cellspacing="0">
@@ -21,13 +19,12 @@ $stores = $block->getStoresSortedBySortOrder();
2119
<th class="col-draggable"></th>
2220
<th class="col-default"><span><?= $block->escapeHtml(__('Is Default')) ?></span></th>
2321
<th><span><?= $block->escapeHtml(__('Swatch')) ?></span></th>
24-
<?php foreach ($stores as $_store): ?>
25-
<th<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> class="_required"<?php endif; ?>>
22+
<?php foreach ($stores as $_store) : ?>
23+
<th<?= ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) ? ' class="_required"' : '' ?>
2624
<span><?= $block->escapeHtml($_store->getName()) ?></span>
2725
</th>
28-
<?php endforeach;
29-
$colTotal = count($stores) * 2 + 3;
30-
?>
26+
<?php endforeach; ?>
27+
<?php $colTotal = count($stores) * 2 + 3; ?>
3128
<th class="col-delete">&nbsp;</th>
3229
</tr>
3330
</thead>
@@ -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_visual_option_button"
4643
title="<?= $block->escapeHtml(__('Add Swatch')) ?>"
4744
type="button" class="action- scalable add">
@@ -57,14 +54,14 @@ $stores = $block->getStoresSortedBySortOrder();
5754
<script id="swatch-visual-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" class="draggable-handle"
6259
title="<?= $block->escapeHtml(__('Sort Option')) ?>"></div>
6360
<?php endif; ?>
64-
<input data-role="order" type="hidden" name="optionvisual[order][<%- data.id %>]" value="<%- data.sort_order %>" <?php if ($block->getReadOnly() || $block->canManageOptionDefaultOnly()): ?> disabled="disabled"<?php endif; ?>/>
61+
<input data-role="order" type="hidden" name="optionvisual[order][<%- data.id %>]" value="<%- data.sort_order %>" <?= ($block->getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?>/>
6562
</td>
6663
<td class="col-default">
67-
<input class="input-radio" type="<%- data.intype %>" name="defaultvisual[]" value="<%- data.id %>" <%- data.checked %><?php if ($block->getReadOnly()):?>disabled="disabled"<?php endif;?>/>
64+
<input class="input-radio" type="<%- data.intype %>" name="defaultvisual[]" value="<%- data.id %>" <%- data.checked %><?= ($block->getReadOnly()) ? ' disabled="disabled"' : '' ?>/>
6865
</td>
6966
<td class="swatches-visual-col col-default <%- data.empty_class %>">
7067
<?php //@todo add logic getting swatch value from db */ ?>
@@ -88,17 +85,17 @@ $stores = $block->getStoresSortedBySortOrder();
8885
</div>
8986
</div>
9087
</td>
91-
<?php foreach ($stores as $_store): ?>
88+
<?php foreach ($stores as $_store) : ?>
9289
<td class="swatch-col-<%- data.id %>">
9390
<input name="optionvisual[value][<%- data.id %>][<?= (int)$_store->getId() ?>]"
9491
value="<%- data.store<?= (int) $_store->getId() ?> %>"
95-
class="input-text<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option required-unique<?php endif; ?>"
96-
type="text" <?php if ($block->getReadOnly() || $block->canManageOptionDefaultOnly()): ?> disabled="disabled"<?php endif; ?>/>
92+
class="input-text<?= ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) ? ' required-option required-unique' : '' ?>"
93+
type="text" <?= ($block->getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?>/>
9794
</td>
9895
<?php endforeach; ?>
9996
<td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
10097
<input type="hidden" class="delete-flag" name="optionvisual[delete][<%- data.id %>]" value="" />
101-
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
98+
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?>
10299
<button title="<?= $block->escapeHtml(__('Delete')) ?>" type="button"
103100
class="action- scalable delete delete-option">
104101
<span><?= $block->escapeHtml(__('Delete')) ?></span>

0 commit comments

Comments
 (0)