| @@ 150-163 (lines=14) @@ | ||
| 147 | ) { |
|
| 148 | // in list view, we add by default and an edit and a delete button |
|
| 149 | if ($event->getActionName() == 'list') { |
|
| 150 | if (in_array('edit', $allowedActions)) { |
|
| 151 | $configuration['fields']['_actions']['type'] = 'collection'; |
|
| 152 | $configuration['fields']['_actions']['options']['_edit'] = [ |
|
| 153 | 'type' => 'action', |
|
| 154 | 'options' => [ |
|
| 155 | 'title' => $this->applicationConfiguration->getTranslationKey('edit', $event->getAdmin()->getName()), |
|
| 156 | 'route' => $admin->generateRouteName('edit'), |
|
| 157 | 'parameters' => [ |
|
| 158 | 'id' => false |
|
| 159 | ], |
|
| 160 | 'icon' => 'pencil' |
|
| 161 | ] |
|
| 162 | ]; |
|
| 163 | } |
|
| 164 | if (in_array('delete', $allowedActions)) { |
|
| 165 | $configuration['fields']['_actions']['type'] = 'collection'; |
|
| 166 | $configuration['fields']['_actions']['options']['_delete'] = [ |
|
| @@ 164-177 (lines=14) @@ | ||
| 161 | ] |
|
| 162 | ]; |
|
| 163 | } |
|
| 164 | if (in_array('delete', $allowedActions)) { |
|
| 165 | $configuration['fields']['_actions']['type'] = 'collection'; |
|
| 166 | $configuration['fields']['_actions']['options']['_delete'] = [ |
|
| 167 | 'type' => 'action', |
|
| 168 | 'options' => [ |
|
| 169 | 'title' => $this->applicationConfiguration->getTranslationKey('delete', $event->getAdmin()->getName()), |
|
| 170 | 'route' => $admin->generateRouteName('delete'), |
|
| 171 | 'parameters' => [ |
|
| 172 | 'id' => false |
|
| 173 | ], |
|
| 174 | 'icon' => 'remove' |
|
| 175 | ] |
|
| 176 | ]; |
|
| 177 | } |
|
| 178 | } |
|
| 179 | } |
|
| 180 | // add default menu actions if none was provided |
|