| @@ 152-165 (lines=14) @@ | ||
| 149 | ; |
|
| 150 | ||
| 151 | ||
| 152 | if (in_array('edit', $allowedActions)) { |
|
| 153 | $configuration['fields']['_actions']['type'] = 'collection'; |
|
| 154 | $configuration['fields']['_actions']['options']['_edit'] = [ |
|
| 155 | 'type' => 'action', |
|
| 156 | 'options' => [ |
|
| 157 | 'title' => $this->getTranslationKey($translationPattern, 'edit', $event->getAdmin()->getName()), |
|
| 158 | 'route' => $admin->generateRouteName('edit'), |
|
| 159 | 'parameters' => [ |
|
| 160 | 'id' => false |
|
| 161 | ], |
|
| 162 | 'icon' => 'pencil' |
|
| 163 | ] |
|
| 164 | ]; |
|
| 165 | } |
|
| 166 | if (in_array('delete', $allowedActions)) { |
|
| 167 | $configuration['fields']['_actions']['type'] = 'collection'; |
|
| 168 | $configuration['fields']['_actions']['options']['_delete'] = [ |
|
| @@ 166-179 (lines=14) @@ | ||
| 163 | ] |
|
| 164 | ]; |
|
| 165 | } |
|
| 166 | if (in_array('delete', $allowedActions)) { |
|
| 167 | $configuration['fields']['_actions']['type'] = 'collection'; |
|
| 168 | $configuration['fields']['_actions']['options']['_delete'] = [ |
|
| 169 | 'type' => 'action', |
|
| 170 | 'options' => [ |
|
| 171 | 'title' => $this->getTranslationKey($translationPattern, 'delete', $event->getAdmin()->getName()), |
|
| 172 | 'route' => $admin->generateRouteName('delete'), |
|
| 173 | 'parameters' => [ |
|
| 174 | 'id' => false |
|
| 175 | ], |
|
| 176 | 'icon' => 'remove' |
|
| 177 | ] |
|
| 178 | ]; |
|
| 179 | } |
|
| 180 | } |
|
| 181 | } |
|
| 182 | // reset action configuration |
|