10
10
use Magento \Cms \Helper \Wysiwyg \Images ;
11
11
use Magento \Framework \View \Element \UiComponentFactory ;
12
12
use Magento \Framework \View \Element \UiComponent \ContextInterface ;
13
+ use Magento \Ui \Component \Form \Element \DataType \Media \OpenDialogUrl ;
13
14
use Magento \Variable \Model \Variable \Config as VariableConfig ;
14
15
15
16
/**
@@ -39,12 +40,18 @@ class HtmlCode extends \Magento\Ui\Component\Form\Field
39
40
*/
40
41
private $ currentTreePath ;
41
42
43
+ /**
44
+ * @var OpenDialogUrl
45
+ */
46
+ private $ openDialogUrl ;
47
+
42
48
/**
43
49
* @param ContextInterface $context
44
50
* @param UiComponentFactory $uiComponentFactory
45
51
* @param BackendUrlInterface $backendUrl
46
52
* @param Images $imagesHelper
47
53
* @param VariableConfig $variableConfig
54
+ * @param OpenDialogUrl $openDialogUrl
48
55
* @param string $currentTreePath
49
56
* @param array $components
50
57
* @param array $data
@@ -55,6 +62,7 @@ public function __construct(
55
62
BackendUrlInterface $ backendUrl ,
56
63
Images $ imagesHelper ,
57
64
VariableConfig $ variableConfig ,
65
+ OpenDialogUrl $ openDialogUrl ,
58
66
$ currentTreePath = 'wysiwyg ' ,
59
67
$ components = [],
60
68
array $ data = []
@@ -63,6 +71,7 @@ public function __construct(
63
71
$ this ->imagesHelper = $ imagesHelper ;
64
72
$ this ->variableConfig = $ variableConfig ;
65
73
$ this ->currentTreePath = $ currentTreePath ;
74
+ $ this ->openDialogUrl = $ openDialogUrl ;
66
75
parent ::__construct ($ context , $ uiComponentFactory , $ components , $ data );
67
76
}
68
77
@@ -82,7 +91,7 @@ public function prepare()
82
91
]
83
92
);
84
93
$ config ['imageUrl ' ] = $ this ->backendUrl ->getUrl (
85
- ' cms/wysiwyg_images/index ' ,
94
+ $ this -> openDialogUrl -> get () ,
86
95
[
87
96
'current_tree_path ' => $ this ->imagesHelper ->idEncode ($ this ->currentTreePath ),
88
97
'target_element_id ' => self ::HTML_ID_PLACEHOLDER
0 commit comments