Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Block/Adminhtml/ContentConstructor/Constructor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace MageSuite\ContentConstructorAdmin\Block\Adminhtml\ContentConstructor;

use Magento\Ui\Component\Form\Element\DataType\Media\OpenDialogUrl;
use Magento\Cms\Model\Wysiwyg\Config;

class Constructor extends \Magento\Framework\View\Element\Template
{
/**
Expand Down Expand Up @@ -70,13 +73,19 @@ class Constructor extends \Magento\Framework\View\Element\Template
*/
protected $imagesHelper;

/**
* @var OpednDialogUrl
*/
protected $openDialogUrl;

/**
* Constructor constructor.
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \MageSuite\ContentConstructorAdmin\Repository\Xml\XmlToComponentConfigurationMapper $xmlToComponentConfiguration
* @param \Magento\Framework\Registry $registry
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \MageSuite\ContentConstructorAdmin\Helper\Configuration $configurationHelper
* @param OpenDialogUrl $openDialogUrl
* @param array $data
*/
public function __construct(
Expand All @@ -94,6 +103,7 @@ public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManager,
\MageSuite\ContentConstructorAdmin\Helper\Configuration $configurationHelper,
\Magento\Cms\Helper\Wysiwyg\Images $imagesHelper,
OpenDialogUrl $openDialogUrl,
array $data = []
) {
parent::__construct($context, $data);
Expand All @@ -111,6 +121,7 @@ public function __construct(
$this->storeManager = $storeManager;
$this->configurationHelper = $configurationHelper;
$this->imagesHelper = $imagesHelper;
$this->openDialogUrl = $openDialogUrl;

$this->setTemplate('MageSuite_ContentConstructorAdmin::constructor.phtml');
}
Expand Down Expand Up @@ -148,8 +159,11 @@ public function getAsset($assetLocation)
public function getUploaderUrl()
{
return $this->backendUrl->getUrl(
'cms/wysiwyg_images/index',
['current_tree_path' => $this->imagesHelper->idEncode('wysiwyg')]
$this->openDialogUrl->get(), [
'current_tree_path' => $this->imagesHelper->idEncode(
Config::IMAGE_DIRECTORY // => 'wysiwyg'
)
]
);
}

Expand Down