-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4412 from magento-obsessive-owls/MC-16926
- Loading branch information
Showing
61 changed files
with
840 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,22 @@ | |
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Catalog\Block\Adminhtml\Product; | ||
|
||
/** | ||
* Customer edit block | ||
* | ||
* @author Magento Core Team <[email protected]> | ||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) | ||
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod) | ||
*/ | ||
namespace Magento\Catalog\Block\Adminhtml\Product; | ||
|
||
class Edit extends \Magento\Backend\Block\Widget | ||
{ | ||
/** | ||
* @var \Magento\Framework\Escaper | ||
*/ | ||
private $escaper; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
|
@@ -47,6 +52,7 @@ class Edit extends \Magento\Backend\Block\Widget | |
* @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory | ||
* @param \Magento\Framework\Registry $registry | ||
* @param \Magento\Catalog\Helper\Product $productHelper | ||
* @param \Magento\Framework\Escaper $escaper | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
|
@@ -55,16 +61,20 @@ public function __construct( | |
\Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory, | ||
\Magento\Framework\Registry $registry, | ||
\Magento\Catalog\Helper\Product $productHelper, | ||
\Magento\Framework\Escaper $escaper, | ||
array $data = [] | ||
) { | ||
$this->_productHelper = $productHelper; | ||
$this->_attributeSetFactory = $attributeSetFactory; | ||
$this->_coreRegistry = $registry; | ||
$this->jsonEncoder = $jsonEncoder; | ||
$this->escaper = $escaper; | ||
parent::__construct($context, $data); | ||
} | ||
|
||
/** | ||
* Edit Product constructor | ||
* | ||
* @return void | ||
*/ | ||
protected function _construct() | ||
|
@@ -144,6 +154,8 @@ protected function _prepareLayout() | |
} | ||
|
||
/** | ||
* Retrieve back button html | ||
* | ||
* @return string | ||
*/ | ||
public function getBackButtonHtml() | ||
|
@@ -152,6 +164,8 @@ public function getBackButtonHtml() | |
} | ||
|
||
/** | ||
* Retrieve cancel button html | ||
* | ||
* @return string | ||
*/ | ||
public function getCancelButtonHtml() | ||
|
@@ -160,6 +174,8 @@ public function getCancelButtonHtml() | |
} | ||
|
||
/** | ||
* Retrieve save button html | ||
* | ||
* @return string | ||
*/ | ||
public function getSaveButtonHtml() | ||
|
@@ -168,6 +184,8 @@ public function getSaveButtonHtml() | |
} | ||
|
||
/** | ||
* Retrieve save and edit button html | ||
* | ||
* @return string | ||
*/ | ||
public function getSaveAndEditButtonHtml() | ||
|
@@ -176,6 +194,8 @@ public function getSaveAndEditButtonHtml() | |
} | ||
|
||
/** | ||
* Retrieve delete button html | ||
* | ||
* @return string | ||
*/ | ||
public function getDeleteButtonHtml() | ||
|
@@ -194,6 +214,8 @@ public function getSaveSplitButtonHtml() | |
} | ||
|
||
/** | ||
* Retrieve validation url | ||
* | ||
* @return string | ||
*/ | ||
public function getValidationUrl() | ||
|
@@ -202,6 +224,8 @@ public function getValidationUrl() | |
} | ||
|
||
/** | ||
* Retrieve save url | ||
* | ||
* @return string | ||
*/ | ||
public function getSaveUrl() | ||
|
@@ -210,6 +234,8 @@ public function getSaveUrl() | |
} | ||
|
||
/** | ||
* Retrieve save and continue url | ||
* | ||
* @return string | ||
*/ | ||
public function getSaveAndContinueUrl() | ||
|
@@ -221,6 +247,8 @@ public function getSaveAndContinueUrl() | |
} | ||
|
||
/** | ||
* Retrieve product id | ||
* | ||
* @return mixed | ||
*/ | ||
public function getProductId() | ||
|
@@ -229,6 +257,8 @@ public function getProductId() | |
} | ||
|
||
/** | ||
* Retrieve product set id | ||
* | ||
* @return mixed | ||
*/ | ||
public function getProductSetId() | ||
|
@@ -241,6 +271,8 @@ public function getProductSetId() | |
} | ||
|
||
/** | ||
* Retrieve duplicate url | ||
* | ||
* @return string | ||
*/ | ||
public function getDuplicateUrl() | ||
|
@@ -249,6 +281,8 @@ public function getDuplicateUrl() | |
} | ||
|
||
/** | ||
* Retrieve product header | ||
* | ||
* @deprecated 101.1.0 | ||
* @return string | ||
*/ | ||
|
@@ -263,6 +297,8 @@ public function getHeader() | |
} | ||
|
||
/** | ||
* Get product attribute set name | ||
* | ||
* @return string | ||
*/ | ||
public function getAttributeSetName() | ||
|
@@ -275,11 +311,14 @@ public function getAttributeSetName() | |
} | ||
|
||
/** | ||
* Retrieve id of selected tab | ||
* | ||
* @return string | ||
*/ | ||
public function getSelectedTabId() | ||
{ | ||
return addslashes(htmlspecialchars($this->getRequest()->getParam('tab'))); | ||
// phpcs:ignore Magento2.Functions.DiscouragedFunction | ||
return addslashes($this->escaper->escapeHtml($this->getRequest()->getParam('tab'))); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.