File tree Expand file tree Collapse file tree 3 files changed +74
-2
lines changed
app/code/Magento/MediaGalleryCatalogUi
Ui/Component/Listing/Columns
view/adminhtml/ui_component Expand file tree Collapse file tree 3 files changed +74
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \MediaGalleryCatalogUi \Ui \Component \Listing \Columns ;
7
+
8
+ use Magento \Ui \Component \Listing \Columns \Column ;
9
+
10
+ /**
11
+ * Class InMenu column for Category grid
12
+ */
13
+ class InMenu extends Column
14
+ {
15
+ /**
16
+ * Prepare data source.
17
+ *
18
+ * @param array $dataSource
19
+ * @return array
20
+ */
21
+ public function prepareDataSource (array $ dataSource )
22
+ {
23
+ if (isset ($ dataSource ['data ' ]['items ' ])) {
24
+ $ fieldName = $ this ->getData ('name ' );
25
+ foreach ($ dataSource ['data ' ]['items ' ] as & $ item ) {
26
+ if (isset ($ item [$ fieldName ]) && $ item [$ fieldName ] == 1 ) {
27
+ $ item [$ fieldName ] = 'Yes ' ;
28
+ } else {
29
+ $ item [$ fieldName ] = 'No ' ;
30
+ }
31
+ }
32
+ }
33
+
34
+ return $ dataSource ;
35
+ }
36
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \MediaGalleryCatalogUi \Ui \Component \Listing \Columns ;
7
+
8
+ use Magento \Ui \Component \Listing \Columns \Column ;
9
+
10
+ /**
11
+ * Class IsActive column for Category grid
12
+ */
13
+ class IsActive extends Column
14
+ {
15
+ /**
16
+ * Prepare data source.
17
+ *
18
+ * @param array $dataSource
19
+ * @return array
20
+ */
21
+ public function prepareDataSource (array $ dataSource )
22
+ {
23
+ if (isset ($ dataSource ['data ' ]['items ' ])) {
24
+ $ fieldName = $ this ->getData ('name ' );
25
+ foreach ($ dataSource ['data ' ]['items ' ] as & $ item ) {
26
+ if (isset ($ item [$ fieldName ]) && $ item [$ fieldName ] == 1 ) {
27
+ $ item [$ fieldName ] = 'Yes ' ;
28
+ } else {
29
+ $ item [$ fieldName ] = 'No ' ;
30
+ }
31
+ }
32
+ }
33
+
34
+ return $ dataSource ;
35
+ }
36
+ }
Original file line number Diff line number Diff line change 167
167
<label translate =" true" >Products</label >
168
168
</settings >
169
169
</column >
170
- <column name =" include_in_menu" component = " Magento_Ui/js/grid/columns/select " >
170
+ <column name =" include_in_menu" class = " Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns\InMenu " >
171
171
<settings >
172
172
<label translate =" true" >In Menu</label >
173
173
</settings >
174
174
</column >
175
- <column name =" is_active" component = " Magento_Ui/js/grid/columns/select " >
175
+ <column name =" is_active" class = " Magento\MediaGalleryCatalogUi\Ui\Component\Listing\Columns\IsActive " >
176
176
<settings >
177
177
<label translate =" true" >Enabled</label >
178
178
</settings >
You can’t perform that action at this time.
0 commit comments