Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-cms
Block
Adminhtml
Wysiwyg
Images
Content.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Cms\Block\Adminhtml\Wysiwyg\Images
;
7
14
class
Content
extends
\Magento\Backend\Block\Widget\Container
15
{
19
protected
$_jsonEncoder
;
20
26
public
function
__construct
(
27
\
Magento
\Backend\
Block
\Widget\
Context
$context,
28
\
Magento
\Framework\Json\EncoderInterface $jsonEncoder,
29
array
$data
= []
30
) {
31
$this->_jsonEncoder = $jsonEncoder;
32
parent::__construct($context,
$data
);
33
}
34
40
protected
function
_construct
()
41
{
42
parent::_construct();
43
$this->_headerText =
__
(
'Media Storage'
);
44
$this->buttonList->remove(
'back'
);
45
$this->buttonList->remove(
'edit'
);
46
$this->buttonList->add(
47
'cancel'
,
48
[
'class'
=>
'cancel action-quaternary'
,
'label'
=>
__
(
'Cancel'
),
'type'
=>
'button'
,
49
'onclick'
=>
'MediabrowserUtility.closeDialog();'
],
50
0,
51
0,
52
'header'
53
);
54
55
$this->buttonList->add(
56
'delete_folder'
,
57
[
'class'
=>
'delete no-display action-quaternary'
,
'label'
=>
__
(
'Delete Folder'
),
'type'
=>
'button'
],
58
0,
59
0,
60
'header'
61
);
62
63
$this->buttonList->add(
64
'delete_files'
,
65
[
'class'
=>
'delete no-display action-quaternary'
,
'label'
=>
__
(
'Delete Selected'
),
'type'
=>
'button'
],
66
0,
67
0,
68
'header'
69
);
70
71
$this->buttonList->add(
72
'new_folder'
,
73
[
'class'
=>
'save'
,
'label'
=>
__
(
'Create Folder'
),
'type'
=>
'button'
],
74
0,
75
0,
76
'header'
77
);
78
79
$this->buttonList->add(
80
'insert_files'
,
81
[
'class'
=>
'save no-display action-primary'
,
'label'
=>
__
(
'Add Selected'
),
'type'
=>
'button'
],
82
0,
83
0,
84
'header'
85
);
86
}
87
93
public
function
getContentsUrl
()
94
{
95
return
$this->
getUrl
(
'cms/*/contents'
, [
96
'type'
=> $this->
getRequest
()->getParam(
'type'
),
97
]);
98
}
99
105
public
function
getFilebrowserSetupObject
()
106
{
107
$setupObject = new \Magento\Framework\DataObject();
108
109
$setupObject->setData(
110
[
111
'newFolderPrompt'
=>
__
(
'New Folder Name:'
),
112
'deleteFolderConfirmationMessage'
=>
__
(
'Are you sure you want to delete this folder?'
),
113
'deleteFileConfirmationMessage'
=>
__
(
'Are you sure you want to delete this file?'
),
114
'targetElementId'
=> $this->
getTargetElementId
(),
115
'contentsUrl'
=> $this->
getContentsUrl
(),
116
'onInsertUrl'
=> $this->
getOnInsertUrl
(),
117
'newFolderUrl'
=> $this->
getNewfolderUrl
(),
118
'deleteFolderUrl'
=> $this->
getDeletefolderUrl
(),
119
'deleteFilesUrl'
=> $this->
getDeleteFilesUrl
(),
120
'headerText'
=> $this->
getHeaderText
(),
121
'showBreadcrumbs'
=>
true
,
122
]
123
);
124
125
return
$this->_jsonEncoder->encode($setupObject);
126
}
127
133
public
function
getNewfolderUrl
()
134
{
135
return
$this->
getUrl
(
'cms/*/newFolder'
);
136
}
137
143
protected
function
getDeletefolderUrl
()
144
{
145
return
$this->
getUrl
(
'cms/*/deleteFolder'
);
146
}
147
153
public
function
getDeleteFilesUrl
()
154
{
155
return
$this->
getUrl
(
'cms/*/deleteFiles'
);
156
}
157
163
public
function
getOnInsertUrl
()
164
{
165
return
$this->
getUrl
(
'cms/*/onInsert'
);
166
}
167
173
public
function
getTargetElementId
()
174
{
175
return
$this->
getRequest
()->getParam(
'target_element_id'
);
176
}
177
}
Magento\Cms\Block\Adminhtml\Wysiwyg\Images
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\getOnInsertUrl
getOnInsertUrl()
Definition:
Content.php:163
Magento\Backend\Block\Widget\Container\getHeaderText
getHeaderText()
Definition:
Container.php:154
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\__construct
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Json\EncoderInterface $jsonEncoder, array $data=[])
Definition:
Content.php:26
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\getNewfolderUrl
getNewfolderUrl()
Definition:
Content.php:133
__
__()
Definition:
__.php:13
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\_construct
_construct()
Definition:
Content.php:40
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\$_jsonEncoder
$_jsonEncoder
Definition:
Content.php:19
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\getDeletefolderUrl
getDeletefolderUrl()
Definition:
Content.php:143
Magento\Framework\View\Element\AbstractBlock\getUrl
getUrl($route='', $params=[])
Definition:
AbstractBlock.php:773
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\getTargetElementId
getTargetElementId()
Definition:
Content.php:173
Magento\Cms\Block\Adminhtml\Block
Definition:
Block.php:11
Magento
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\getDeleteFilesUrl
getDeleteFilesUrl()
Definition:
Content.php:153
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\getContentsUrl
getContentsUrl()
Definition:
Content.php:93
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content
Definition:
Content.php:14
Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\getFilebrowserSetupObject
getFilebrowserSetupObject()
Definition:
Content.php:105
Magento\Framework\View\Element\AbstractBlock\getRequest
getRequest()
Definition:
AbstractBlock.php:227