Skip to content

Commit 04a261a

Browse files
committed
allow overriding button views
1 parent f3a3a2c commit 04a261a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Traits/CreatesListButton.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ public function addInstantCreateButtonToList(
99
string $content,
1010
string $entity = 'entity_id',
1111
string $class = 'btn btn-xs btn-default',
12-
string $position = 'beginning'
12+
string $position = 'beginning',
13+
string $createButtonView = 'webfactor::buttons.create',
14+
string $fakeButtonView = 'webfactor::buttons.fake'
1315
) {
1416
if (!isset($this->crud->instantCreateButtons)) {
1517
$this->crud->instantCreateButtons = [];
@@ -22,7 +24,7 @@ public function addInstantCreateButtonToList(
2224
'content' => $content,
2325
];
2426

25-
$this->crud->addButton('line', $foreignAjaxEntity, 'view', 'webfactor::buttons.create', $position);
26-
$this->crud->addButton('bottom', $foreignAjaxEntity, 'view', 'webfactor::buttons.fake');
27+
$this->crud->addButton('line', $foreignAjaxEntity, 'view', $createButtonView, $position);
28+
$this->crud->addButton('bottom', $foreignAjaxEntity, 'view', $fakeButtonView);
2729
}
2830
}

0 commit comments

Comments
 (0)