diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml index d436dc8d1ef3a..f92b7112e5f47 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml @@ -4,24 +4,27 @@ * See COPYING.txt for license details. */ -/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text */ +/** + * @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text + * @var \Magento\Framework\Escaper $escaper + */ $stores = $block->getStoresSortedBySortOrder(); ?>
- escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?> + escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?>
- + @@ -40,9 +43,9 @@ $stores = $block->getStoresSortedBySortOrder(); @@ -57,7 +60,7 @@ $stores = $block->getStoresSortedBySortOrder(); getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?>
+ title="escapeHtmlAttr(__('Sort Option')) ?>">getStoresSortedBySortOrder(); " name="swatchtext[value][<%- data.id %>][]" type="text" value="<%- data.swatch %>" - placeholder="escapeHtmlAttr(__("Swatch")) ?>"/> + placeholder="escapeHtmlAttr(__("Swatch")) ?>"/> @@ -105,7 +108,7 @@ $stores = $block->getStoresSortedBySortOrder(); "Magento_Swatches/js/text": getJsonConfig() ?> , "Magento_Catalog/catalog/product/attribute/unique-validate": { "element": "required-text-swatch-unique", - "message": "escapeJs($block->escapeHtml(__("The value of Admin must be unique."))) ?>" + "message": "escapeJs($escaper->escapeHtml(__("The value of Admin must be unique."))) ?>" } } } diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml index b7b1ab5fc5323..55a94d842cf46 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml @@ -4,24 +4,27 @@ * See COPYING.txt for license details. */ -/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */ +/** + * @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual + * @var \Magento\Framework\Escaper $escaper + */ $stores = $block->getStoresSortedBySortOrder(); ?>
- escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?> + escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?>
escapeHtml(__('Is Default')) ?>escapeHtml(__('Is Default')) ?> - escapeHtml($_store->getName()) ?> + escapeHtml($_store->getName()) ?> getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?> getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : ''?> - placeholder="escapeHtmlAttr(__("Description")) ?>"/> + placeholder="escapeHtmlAttr(__("Description")) ?>"/> getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?> -
- - + + getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) ? ' class="_required"' : '' ?> - escapeHtml($_store->getName()) ?> + escapeHtml($_store->getName()) ?> @@ -40,9 +43,9 @@ $stores = $block->getStoresSortedBySortOrder(); @@ -56,7 +59,7 @@ $stores = $block->getStoresSortedBySortOrder(); @@ -70,17 +73,17 @@ $stores = $block->getStoresSortedBySortOrder();
-

escapeHtml(__('Choose a color')) ?>

+

escapeHtml(__('Choose a color')) ?>

-

escapeHtml(__('Upload a file')) ?>

+

escapeHtml(__('Upload a file')) ?>

-

escapeHtml(__('Clear')) ?>

+

escapeHtml(__('Clear')) ?>

@@ -96,9 +99,9 @@ $stores = $block->getStoresSortedBySortOrder(); @@ -110,7 +113,7 @@ $stores = $block->getStoresSortedBySortOrder(); "Magento_Swatches/js/visual": getJsonConfig() ?> , "Magento_Catalog/catalog/product/attribute/unique-validate": { "element": "required-visual-swatch-unique", - "message": "escapeHtml(__("The value of Admin must be unique.")) ?>" + "message": "escapeHtml(__("The value of Admin must be unique.")) ?>" } } } diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml index adb13e7f24c34..34607a9f5c14b 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml @@ -4,12 +4,15 @@ * See COPYING.txt for license details. */ -/* @var $block \Magento\ConfigurableProduct\Block\Adminhtml\Product\Steps\AttributeValues */ +/** + * @var $block \Magento\ConfigurableProduct\Block\Adminhtml\Product\Steps\AttributeValues + * @var \Magento\Framework\Escaper $escaper + */ ?> -
-

escapeHtml(__('Step 2: Attribute Values')) ?>

+
+

escapeHtml(__('Step 2: Attribute Values')) ?>

- escapeHtml(__('Select from the following attribute values for this product. Each unique combination of values creates a unique product SKU.')) ?> + escapeHtml(__('Select from the following attribute values for this product. Each unique combination of values creates a unique product SKU.')) ?>
@@ -18,12 +21,12 @@
+ title="escapeHtml(__('Sort Variations')) ?>">
( - escapeHtml(__('Options')) ?>) + escapeHtml(__('Options')) ?>)
@@ -31,20 +34,20 @@
@@ -69,17 +72,17 @@
@@ -89,7 +92,7 @@ type="button" data-action="addOption" data-bind="click: $parent.createOption, visible: canCreateOption"> - escapeHtml(__('Create New Value')) ?> + escapeHtml(__('Create New Value')) ?> @@ -99,11 +102,11 @@ "*": { "Magento_Ui/js/core/app": { "components": { - "escapeJs($block->getComponentName()) ?>": { + "escapeJs($block->getComponentName()) ?>": { "component": "Magento_ConfigurableProduct/js/variations/steps/attributes_values", - "appendTo": "escapeJs($block->getParentComponentName()) ?>", - "optionsUrl": "escapeJs($block->escapeUrl($block->getUrl('catalog/product_attribute/getAttributes'))) ?>", - "createOptionsUrl": "escapeJs($block->escapeUrl($block->getUrl('catalog/product_attribute/createOptions'))) ?>" + "appendTo": "escapeJs($block->getParentComponentName()) ?>", + "optionsUrl": "escapeJs($escaper->escapeUrl($block->getUrl('catalog/product_attribute/getAttributes'))) ?>", + "createOptionsUrl": "escapeJs($escaper->escapeUrl($block->getUrl('catalog/product_attribute/createOptions'))) ?>" } } } diff --git a/app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml b/app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml index bae3820042de0..2c0e79b923e1f 100644 --- a/app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml +++ b/app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml @@ -7,28 +7,30 @@ // phpcs:disable PSR2.ControlStructures.SwitchDeclaration // phpcs:disable Generic.WhiteSpace.ScopeIndent -/** @var $block \Magento\Swatches\Block\LayeredNavigation\RenderLayered */ +/** + * @var $block \Magento\Swatches\Block\LayeredNavigation\RenderLayered + */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ /** @var \Magento\Framework\Escaper $escaper */ ?> getSwatchData(); ?> -
+
@@ -111,7 +113,7 @@ escapeJs($swatchData['attribute_code'])}') + $('.swatch-layered.{$escaper->escapeJs($swatchData['attribute_code'])}') .find('[data-option-type="1"], [data-option-type="2"], [data-option-type="0"], [data-option-type="3"]') .SwatchRendererTooltip(); }); diff --git a/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml b/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml index 5a051d8ecf675..20dd6fb1c6717 100644 --- a/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml +++ b/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml @@ -5,10 +5,14 @@ */ use Magento\Catalog\Model\Product; +use Magento\Framework\Escaper; use Magento\Swatches\Block\Product\Renderer\Listing\Configurable; use Magento\Swatches\ViewModel\Product\Renderer\Configurable as ConfigurableViewModel; -/** @var Configurable $block */ +/** + * @var Configurable $block + * @var Escaper $escaper + */ /** @var Product $product */ $product = $block->getProduct() ?> @@ -16,22 +20,22 @@ $product = $block->getProduct() getId() ?> getConfigurableViewModel() ?> -
+
escapeHtml(__('Is Default')) ?>escapeHtml(__('Swatch')) ?>escapeHtml(__('Is Default')) ?>escapeHtml(__('Swatch')) ?> getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?> getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?>
+ title="escapeHtml(__('Sort Option')) ?>"> getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?>/>
getReadOnly() && !$block->canManageOptionDefaultOnly()) : ?> -