File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
app/code/Magento/PageBuilder
Controller/Adminhtml/Stage Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 21
21
*/
22
22
class Preview extends \Magento \Backend \App \Action implements HttpPostActionInterface
23
23
{
24
+ const ADMIN_RESOURCE = 'Magento_Backend::content ' ;
25
+
24
26
/**
25
27
* @var \Magento\PageBuilder\Model\Stage\RendererPool
26
28
*/
@@ -66,7 +68,10 @@ class Preview extends \Magento\Backend\App\Action implements HttpPostActionInter
66
68
* @param \Magento\PageBuilder\Model\Stage\RendererPool $rendererPool
67
69
* @param \Magento\Store\Model\App\Emulation $emulation
68
70
* @param \Magento\Framework\App\State $appState
69
- * @param \Magento\Theme\Model\View\Design $design
71
+ * @param \Magento\Framework\View\DesignInterface $design
72
+ * @param \Magento\Framework\View\Design\Theme\ThemeProviderInterface $themeProvider
73
+ * @param \Magento\Store\Model\StoreManagerInterface $storeManager
74
+ * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
70
75
* @param \Magento\PageBuilder\Model\Stage\PreviewRegistry $previewRegistry
71
76
*/
72
77
public function __construct (
@@ -95,7 +100,8 @@ public function __construct(
95
100
/**
96
101
* Generates an HTML preview for the stage
97
102
*
98
- * @return \Magento\Framework\Controller\ResultInterface
103
+ * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|mixed
104
+ * @throws \Exception
99
105
*/
100
106
public function execute ()
101
107
{
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class PreviewRegistry
22
22
*
23
23
* @return string
24
24
*/
25
- public function getPreviewArea ()
25
+ public function getPreviewArea () : string
26
26
{
27
27
return \Magento \Framework \App \Area::AREA_FRONTEND ;
28
28
}
@@ -42,7 +42,7 @@ public function setIsPreview(bool $isPreview)
42
42
*
43
43
* @return bool
44
44
*/
45
- public function getIsPreview ()
45
+ public function isPreview () : bool
46
46
{
47
47
return $ this ->isPreview ;
48
48
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public function beforeCreate(
70
70
string $ imageId ,
71
71
array $ attributes = null
72
72
) {
73
- if ($ this ->previewRegistry ->getIsPreview ()) {
73
+ if ($ this ->previewRegistry ->isPreview ()) {
74
74
$ this ->appState ->emulateAreaCode (
75
75
$ this ->previewRegistry ->getPreviewArea (),
76
76
[$ this , 'loadDesignConfig ' ]
You can’t perform that action at this time.
0 commit comments