Skip to content

Commit 6f3cc44

Browse files
committed
Add openDialogConfig to all instance initialization
1 parent d6fabe2 commit 6f3cc44

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

app/code/Magento/Cms/Model/Wysiwyg/Gallery/DefaultConfigProvider.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
namespace Magento\Cms\Model\Wysiwyg\Gallery;
1010

11+
use Magento\Ui\Component\Form\Element\DataType\Media\OpenDialogUrl;
12+
13+
/**
14+
* @inheritdoc
15+
*/
1116
class DefaultConfigProvider implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface
1217
{
1318
/**
@@ -30,26 +35,34 @@ class DefaultConfigProvider implements \Magento\Framework\Data\Wysiwyg\ConfigPro
3035
*/
3136
private $currentTreePath;
3237

38+
/**
39+
* @var OpednDialogUrl
40+
*/
41+
private $openDialogUrl;
42+
3343
/**
3444
* @param \Magento\Backend\Model\UrlInterface $backendUrl
3545
* @param \Magento\Cms\Helper\Wysiwyg\Images $imagesHelper
46+
* @param OpenDialogUrl $openDialogUrl
3647
* @param array $windowSize
3748
* @param string|null $currentTreePath
3849
*/
3950
public function __construct(
4051
\Magento\Backend\Model\UrlInterface $backendUrl,
4152
\Magento\Cms\Helper\Wysiwyg\Images $imagesHelper,
53+
OpenDialogUrl $openDialogUrl,
4254
array $windowSize = [],
4355
$currentTreePath = null
4456
) {
4557
$this->backendUrl = $backendUrl;
4658
$this->imagesHelper = $imagesHelper;
59+
$this->openDialogUrl = $openDialogUrl;
4760
$this->windowSize = $windowSize;
4861
$this->currentTreePath = $currentTreePath;
4962
}
5063

5164
/**
52-
* {@inheritdoc}
65+
* @inheritdoc
5366
*/
5467
public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Framework\DataObject
5568
{
@@ -72,7 +85,7 @@ public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Fram
7285
[
7386
'add_images' => true,
7487
'files_browser_window_url' => $this->backendUrl->getUrl(
75-
'cms/wysiwyg_images/index',
88+
$this->openDialogUrl->get(),
7689
$fileBrowserUrlParams
7790
),
7891
'files_browser_window_width' => $this->windowSize['width'],

app/code/Magento/Tinymce3/Model/Config/Gallery/Config.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Magento\Tinymce3\Model\Config\Gallery;
99

10+
use Magento\Ui\Component\Form\Element\DataType\Media\OpenDialogUrl;
11+
1012
/**
1113
* Class Config adds information about required configurations to display media gallery of tinymce3 editor
1214
*
@@ -19,13 +21,21 @@ class Config implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface
1921
*/
2022
private $backendUrl;
2123

24+
/**
25+
* @var OpednDialogUrl
26+
*/
27+
private $openDialogUrl;
28+
2229
/**
2330
* @param \Magento\Backend\Model\UrlInterface $backendUrl
31+
* @param OpenDialogUrl $openDialogUrl
2432
*/
2533
public function __construct(
26-
\Magento\Backend\Model\UrlInterface $backendUrl
34+
\Magento\Backend\Model\UrlInterface $backendUrl,
35+
OpenDialogUrl $openDialogUrl
2736
) {
2837
$this->backendUrl = $backendUrl;
38+
$this->openDialogUrl = $openDialogUrl;
2939
}
3040

3141
/**
@@ -39,7 +49,7 @@ public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Fram
3949
$config->addData(
4050
[
4151
'add_images' => true,
42-
'files_browser_window_url' => $this->backendUrl->getUrl('cms/wysiwyg_images/index'),
52+
'files_browser_window_url' => $this->backendUrl->getUrl($this->openDialogUrl->get()),
4353
]
4454
);
4555

0 commit comments

Comments
 (0)