File tree Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Original file line number Diff line number Diff line change 1- <a
2- href =" {{ backpack_url ($crud -> instantCreateButton [' name' ] . ' /ajax/create?' . $crud -> instantCreateButton [' entity' ] . ' =' . $entry -> id ) } }"
3- type =" button"
4- class =" {{ $crud -> instantCreateButton [' class' ] } }"
5- data-toggle =" modal"
6- data-target =" #{{ $crud -> instantCreateButton [' name' ] } } _modal" >
7- {!! $crud -> instantCreateButton [' content' ] ! !}
8- </a >
1+ @isset ($crud -> instantCreateButtons [$button -> name ] )
2+ <a
3+ href =" {{ backpack_url ($crud -> instantCreateButtons [$button -> name ][' name' ] . ' /ajax/create?' . $crud -> instantCreateButtons [$button -> name ][' entity' ] . ' =' . $entry -> id ) } }"
4+ type =" button"
5+ class =" {{ $crud -> instantCreateButtons [$button -> name ][' class' ] } }"
6+ data-toggle =" modal"
7+ data-target =" #{{ $crud -> instantCreateButtons [$button -> name ][' name' ] } } _modal" >
8+ {!! $crud -> instantCreateButtons [$button -> name ][' content' ] ! !}
9+ </a >
10+ @endisset
Original file line number Diff line number Diff line change 1- <div class =" modal fade"
2- id =" {{ $crud -> instantCreateButton [' name' ] } } _modal"
3- role =" dialog"
4- aria-labelledby =" {{ $crud -> instantCreateButton [' name' ] } } _modal"
5- aria-hidden =" true" >
6- <div class =" modal-dialog" role =" document" >
7- <div class =" modal-content" ></div >
1+ @isset ($crud -> instantCreateButtons [$button -> name ] )
2+ <div class =" modal fade"
3+ id =" {{ $crud -> instantCreateButtons [$button -> name ][' name' ] } } _modal"
4+ role =" dialog"
5+ aria-labelledby =" {{ $crud -> instantCreateButtons [$button -> name ][' name' ] } } _modal"
6+ aria-hidden =" true" >
7+ <div class =" modal-dialog" role =" document" >
8+ <div class =" modal-content" ></div >
9+ </div >
810 </div >
9- </ div >
11+ @endisset
Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ public function addInstantCreateButtonToList(
1010 string $ entity = 'entity_id ' ,
1111 string $ class = 'btn btn-xs btn-default '
1212 ) {
13- $ this ->crud ->instantCreateButton = [
13+ if (!isset ($ this ->crud ->instantCreateButtons )) {
14+ $ this ->crud ->instantCreateButtons = [];
15+ }
16+
17+ $ this ->crud ->instantCreateButtons [$ foreignAjaxEntity ] = [
1418 'name ' => $ foreignAjaxEntity ,
1519 'entity ' => $ entity ,
1620 'class ' => $ class ,
You can’t perform that action at this time.
0 commit comments