You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/php/api/interactions.md
+21-16Lines changed: 21 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,11 @@
1
1
# Interactions
2
2
3
-
The interaction system enables users to perform context menu actions on specific `DatabaseObject` instances. These interactions are designed to be reusable and universally available, ensuring consistency across the application wherever database objects appear—whether in lists, detail views, or other components.
3
+
The interaction system enables users to perform context menu actions on specific `DatabaseObject` instances.
4
+
These interactions are designed to be reusable and universally available, ensuring consistency across the application wherever database objects appear – whether in lists, detail views, or other components.
4
5
5
-
Interactions are registered centrally using a provider class dedicated to each object type. This architecture allows for modular extensibility, where plugins can contribute additional interactions by subscribing to specialized registration events. Once registered, these plugin-defined interactions are seamlessly integrated and become available across all relevant UI contexts.
6
+
Interactions are registered centrally using a provider class dedicated to each object type.
7
+
This architecture allows for modular extensibility, where plugins can contribute additional interactions by subscribing to specialized registration events.
8
+
Once registered, these plugin-defined interactions are seamlessly integrated and become available across all relevant UI contexts.
6
9
7
10
This system provides a clean, scalable way to define and extend user actions without duplicating logic or UI elements.
8
11
@@ -47,11 +50,13 @@ Bulk interactions are the successor to the “Clipboard” feature and are appli
47
50
48
51
**Type:**`(object) => boolean`
49
52
50
-
Interactions allows the configuration of callback function that determines whether a specific interaction can be applied to the given object. This function is responsible for:
53
+
Interactions allow the configuration of callback function that determines whether a specific interaction can be applied to the given object.
54
+
This function is responsible for:
55
+
51
56
* Verifying that the user has the necessary permissions to perform the interaction.
52
-
* Preventing invalid state transitions (e.g., attempting to set an item as default when it is already the default).
57
+
* Preventing invalid state transitions, for example, attempting to set an item as default when it is already the default.
53
58
54
-
If omitted, the interaction is considered unconditionally available.
59
+
If omitted, the interaction is considered to be unconditionally available.
|`InteractionConfirmationType::None`| No confirmation |
74
79
|`InteractionConfirmationType::SoftDelete`| Predetermined confirmation message asking for a soft-delete. |
75
-
|`InteractionConfirmationType::SoftDeleteWithReason`| Predetermined confirmation message asking for a soft-delete with the optional option to enter a reason. |
80
+
|`InteractionConfirmationType::SoftDeleteWithReason`| Predetermined confirmation message asking for a soft-delete with an optional field for the reason. |
76
81
|`InteractionConfirmationType::Restore`| Predetermined confirmation message asking for a restore. |
77
-
|`InteractionConfirmationType::Delete`| Predetermined confirmation message asking for a delete. |
78
-
|`InteractionConfirmationType::Disable`| Predetermined confirmation message asking for a disable. |
82
+
|`InteractionConfirmationType::Delete`| Predetermined confirmation message asking for the permanent deletion. |
83
+
|`InteractionConfirmationType::Disable`| Predetermined confirmation message asking to disable the item. |
79
84
|`InteractionConfirmationType::Custom`| Allows you to specify a custom confirmation message. |
80
85
81
86
Example:
@@ -149,7 +154,7 @@ new EditInteraction(ExampleEditForm::class)
149
154
150
155
### `FormBuilderDialogInteraction`
151
156
152
-
Opens a form builder dialog using the given controller link.
157
+
Opens a form builder dialog using the given controller link that is expected to provide a `Psr15DialogForm`.
153
158
154
159
Example:
155
160
@@ -200,9 +205,9 @@ Example:
200
205
201
206
```php
202
207
new LinkInteraction(
203
-
"id",
208
+
'id',
204
209
ExampleForm::class,
205
-
"label"
210
+
'label'
206
211
)
207
212
```
208
213
@@ -258,9 +263,9 @@ Example:
258
263
259
264
```php
260
265
new ToggleInteraction(
261
-
"id",
262
-
"enable/endpoint/%s",
263
-
"disable/endpoint/%s"
266
+
'id',
267
+
'enable/endpoint/%s',
268
+
'disable/endpoint/%s'
264
269
)
265
270
```
266
271
@@ -352,7 +357,7 @@ class ExamplePage extends AbstractPage
0 commit comments