Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Index.php
Go to the documentation of this file.
1 <?php
8 
10 {
15 
21  public function __construct(
22  \Magento\Backend\App\Action\Context $context,
23  \Magento\Framework\Registry $coreRegistry,
24  \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
25  ) {
26  $this->resultLayoutFactory = $resultLayoutFactory;
27  parent::__construct($context, $coreRegistry);
28  }
29 
35  public function execute()
36  {
37  $storeId = (int)$this->getRequest()->getParam('store');
38 
39  try {
40  $this->_objectManager->get(\Magento\Cms\Helper\Wysiwyg\Images::class)->getCurrentPath();
41  } catch (\Exception $e) {
42  $this->messageManager->addErrorMessage($e->getMessage());
43  }
44  $this->_initAction();
46  $resultLayout = $this->resultLayoutFactory->create();
47  $resultLayout->addHandle('overlay_popup');
48  $block = $resultLayout->getLayout()->getBlock('wysiwyg_images.js');
49  if ($block) {
50  $block->setStoreId($storeId);
51  }
52  return $resultLayout;
53  }
54 }
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory)
Definition: Index.php:21
$block
Definition: block.php:8