@@ -42,6 +42,8 @@ public function __construct(
42
42
}
43
43
44
44
/**
45
+ * Construct block
46
+ *
45
47
* @return void
46
48
*/
47
49
protected function _construct ()
@@ -51,6 +53,14 @@ protected function _construct()
51
53
52
54
parent ::_construct ();
53
55
56
+ $ this ->buttonList ->update ('save ' , 'label ' , __ ('Save Attribute ' ));
57
+ $ this ->buttonList ->update ('save ' , 'class ' , 'save primary ' );
58
+ $ this ->buttonList ->update (
59
+ 'save ' ,
60
+ 'data_attribute ' ,
61
+ ['mage-init ' => ['button ' => ['event ' => 'save ' , 'target ' => '#edit_form ' ]]]
62
+ );
63
+
54
64
if ($ this ->getRequest ()->getParam ('popup ' )) {
55
65
$ this ->buttonList ->remove ('back ' );
56
66
if ($ this ->getRequest ()->getParam ('product_tab ' ) != 'variations ' ) {
@@ -64,6 +74,8 @@ protected function _construct()
64
74
100
65
75
);
66
76
}
77
+ $ this ->buttonList ->update ('reset ' , 'level ' , 10 );
78
+ $ this ->buttonList ->update ('save ' , 'class ' , 'save action-secondary ' );
67
79
} else {
68
80
$ this ->addButton (
69
81
'save_and_edit_button ' ,
@@ -79,14 +91,6 @@ protected function _construct()
79
91
);
80
92
}
81
93
82
- $ this ->buttonList ->update ('save ' , 'label ' , __ ('Save Attribute ' ));
83
- $ this ->buttonList ->update ('save ' , 'class ' , 'save primary ' );
84
- $ this ->buttonList ->update (
85
- 'save ' ,
86
- 'data_attribute ' ,
87
- ['mage-init ' => ['button ' => ['event ' => 'save ' , 'target ' => '#edit_form ' ]]]
88
- );
89
-
90
94
$ entityAttribute = $ this ->_coreRegistry ->registry ('entity_attribute ' );
91
95
if (!$ entityAttribute || !$ entityAttribute ->getIsUserDefined ()) {
92
96
$ this ->buttonList ->remove ('delete ' );
@@ -96,14 +100,14 @@ protected function _construct()
96
100
}
97
101
98
102
/**
99
- * { @inheritdoc}
103
+ * @inheritdoc
100
104
*/
101
105
public function addButton ($ buttonId , $ data , $ level = 0 , $ sortOrder = 0 , $ region = 'toolbar ' )
102
106
{
103
107
if ($ this ->getRequest ()->getParam ('popup ' )) {
104
108
$ region = 'header ' ;
105
109
}
106
- parent ::addButton ($ buttonId , $ data , $ level , $ sortOrder , $ region );
110
+ return parent ::addButton ($ buttonId , $ data , $ level , $ sortOrder , $ region );
107
111
}
108
112
109
113
/**
0 commit comments