-
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 branch '2.4-develop' into 25963-grid-export-labels
- Loading branch information
Showing
67 changed files
with
1,485 additions
and
1,174 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
50 changes: 50 additions & 0 deletions
50
app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Catalog\Model\Config; | ||
|
||
use Magento\Framework\App\Config\ScopeConfigInterface; | ||
|
||
/** | ||
* Config for catalog media | ||
*/ | ||
class CatalogMediaConfig | ||
{ | ||
private const XML_PATH_CATALOG_MEDIA_URL_FORMAT = 'web/url/catalog_media_url_format'; | ||
|
||
const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters'; | ||
const HASH = 'hash'; | ||
|
||
/** | ||
* @var ScopeConfigInterface | ||
*/ | ||
private $scopeConfig; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param ScopeConfigInterface $scopeConfig | ||
*/ | ||
public function __construct(ScopeConfigInterface $scopeConfig) | ||
{ | ||
$this->scopeConfig = $scopeConfig; | ||
} | ||
|
||
/** | ||
* Get media URL format for catalog images | ||
* | ||
* @param string $scopeType | ||
* @param null|int|string $scopeCode | ||
* @return string | ||
*/ | ||
public function getMediaUrlFormat($scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null) | ||
{ | ||
return $this->scopeConfig->getValue( | ||
CatalogMediaConfig::XML_PATH_CATALOG_MEDIA_URL_FORMAT, | ||
$scopeType, | ||
$scopeCode | ||
); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
app/code/Magento/Catalog/Model/Config/Source/Web/CatalogMediaUrlFormat.php
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Catalog\Model\Config\Source\Web; | ||
|
||
use Magento\Catalog\Model\Config\CatalogMediaConfig; | ||
|
||
/** | ||
* Option provider for catalog media URL format system setting. | ||
*/ | ||
class CatalogMediaUrlFormat implements \Magento\Framework\Data\OptionSourceInterface | ||
{ | ||
/** | ||
* Get a list of supported catalog media URL formats. | ||
* | ||
* @codeCoverageIgnore | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
return [ | ||
[ | ||
'value' => CatalogMediaConfig::IMAGE_OPTIMIZATION_PARAMETERS, | ||
'label' => __('Image optimization based on query parameters') | ||
], | ||
['value' => CatalogMediaConfig::HASH, 'label' => __('Unique hash per image variant (Legacy mode)')] | ||
]; | ||
} | ||
} |
Oops, something went wrong.