File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,22 @@ public function getIndexUrl(): string
7474 */
7575 public function getButtons (): array
7676 {
77+ $ buttonDefinitions = $ this ->getBlock ()->getButtons ();
78+ if (!empty ($ buttonDefinitions )) {
79+ $ buttons = [];
80+ foreach ($ buttonDefinitions as $ buttonDefinition ) {
81+ $ buttons [] = $ this ->buttonFactory ->create (
82+ method: (string )$ buttonDefinition ['method ' ],
83+ label: (string )$ buttonDefinition ['label ' ],
84+ cssClass: isset ($ buttonDefinition ['cssClass ' ]) ? (string )$ buttonDefinition ['cssClass ' ] : '' ,
85+ url: isset ($ buttonDefinition ['url ' ]) ? (string )$ buttonDefinition ['url ' ] : '' ,
86+ primary: $ buttonDefinition ['primary ' ] ?? false ,
87+ );
88+ }
89+
90+ return $ buttons ;
91+ }
92+
7793 $ item = $ this ->getValue ();
7894 if ($ item instanceof DataObject && $ item ->getId () > 0 ) {
7995 return [
You can’t perform that action at this time.
0 commit comments