Skip to content

Commit 0f41d8a

Browse files
authored
[TASK] Update Code snippets (#6165)
Releases: main
1 parent a01fbbd commit 0f41d8a

File tree

7 files changed

+101
-36
lines changed

7 files changed

+101
-36
lines changed

Documentation/ApiOverview/Backend/BackendModules/_ModuleTemplate.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,12 @@
128128
Generates a menu in the docheader to access third-level modules
129129

130130
:param $additionalQueryParams: the additionalQueryParams, default: []
131+
132+
.. php:method:: addButtonToButtonBar(\TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface $button, string $buttonPosition = 'left', int $buttonGroup = 1)
133+
:returns: `self`
134+
135+
Shorthand method to add a new button to the button bar
136+
137+
:param $button: the button
138+
:param $buttonPosition: the buttonPosition, default: 'left'
139+
:param $buttonGroup: the buttonGroup, default: 1

Documentation/CodeSnippets/Events/Backend/AfterSectionMarkupGeneratedEvent.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:returns: `\TYPO3\CMS\Backend\View\PageLayoutContext`
1414

1515
.. php:method:: getRecords()
16-
:returns: `array`
16+
:returns: `\RecordInterface[]`
1717

1818
.. php:method:: setContent(string $content = '')
1919

Documentation/CodeSnippets/Events/Backend/BeforeSectionMarkupGeneratedEvent.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:returns: `\TYPO3\CMS\Backend\View\PageLayoutContext`
1414

1515
.. php:method:: getRecords()
16-
:returns: `array`
16+
:returns: `\RecordInterface[]`
1717

1818
.. php:method:: setContent(string $content = '')
1919

Documentation/CodeSnippets/Events/Backend/ModifyRecordListRecordActionsEvent.rst.txt

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
"edit", "copy", "delete") for a table in the RecordList.
99

10-
.. php:method:: setAction(string $action, string $actionName = '', string $group = '', string $before = '', string $after = '')
10+
.. php:method:: setAction(?\TYPO3\CMS\Backend\Template\Components\ComponentInterface $action, string $actionName, \TYPO3\CMS\Backend\Template\Components\ActionGroup $group = \TYPO3\CMS\Backend\Template\Components\ActionGroup::secondary, string $before = '', string $after = '')
1111
1212
Add a new action or override an existing one. Latter is only possible,
1313
in case $columnName is given. Otherwise, the column will be added with
@@ -19,62 +19,60 @@
1919
be added to the secondary group.
2020

2121
:param $action: the action
22-
:param $actionName: the actionName, default: ''
23-
:param $group: the group, default: ''
22+
:param $actionName: the actionName
23+
:param $group: the group, default: \TYPO3\CMS\Backend\Template\Components\ActionGroup::secondary
2424
:param $before: the before, default: ''
2525
:param $after: the after, default: ''
2626

27-
.. php:method:: hasAction(string $actionName, string $group = '')
27+
.. php:method:: hasAction(string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)
2828
:returns: `bool`
2929

3030
Whether the action exists in the given group. In case non or
3131
an invalid $group is provided, both groups will be checked.
3232

3333
:param $actionName: the actionName
34-
:param $group: the group, default: ''
34+
:param $group: the group, default: NULL
3535

36-
.. php:method:: getAction(string $actionName, string $group = '')
37-
:returns: `?string`
36+
.. php:method:: getAction(string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)
37+
:returns: `?\TYPO3\CMS\Backend\Template\Components\ComponentInterface`
3838

3939
Get action by its name. In case the action exists in both groups
4040
and non or an invalid $group is provided, the action from the
4141
"primary" group will be returned.
4242

4343
:param $actionName: the actionName
44-
:param $group: the group, default: ''
44+
:param $group: the group, default: NULL
4545

46-
.. php:method:: removeAction(string $actionName, string $group = '')
47-
:returns: `bool`
46+
.. php:method:: removeAction(string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)
4847
4948
Remove action by its name. In case the action exists in both groups
5049
and non or an invalid $group is provided, the action will be removed
5150
from both groups.
5251

5352
:param $actionName: the actionName
54-
:param $group: the group, default: ''
55-
:Return description: Whether the action could be removed - Will thereforereturn FALSE if the action to remove does not exist.
56-
57-
.. php:method:: getActionGroup(string $group)
58-
:returns: `?array`
53+
:param $group: the group, default: NULL
5954

60-
Get the actions of a specific group
55+
.. php:method:: moveActionTo(string $actionName, \TYPO3\CMS\Backend\Template\Components\ActionGroup $group, string $before = '', string $after = '')
6156
57+
:param $actionName: the actionName
6258
:param $group: the group
59+
:param $before: the before, default: ''
60+
:param $after: the after, default: ''
6361

64-
.. php:method:: setActions(array $actions)
65-
66-
:param $actions: the actions
62+
.. php:method:: getActionGroup(\TYPO3\CMS\Backend\Template\Components\ActionGroup $group)
63+
:returns: `\TYPO3\CMS\Backend\Template\Components\ComponentGroup`
6764

68-
.. php:method:: getActions()
69-
:returns: `array`
65+
Get the actions of a specific group
7066

71-
.. php:method:: getTable()
72-
:returns: `string`
67+
:param $group: the group
7368

7469
.. php:method:: getRecord()
75-
:returns: `array`
70+
:returns: `\TYPO3\CMS\Core\Domain\RecordInterface`
7671

7772
.. php:method:: getRecordList()
7873
:returns: `\TYPO3\CMS\Backend\RecordList\DatabaseRecordList`
7974

8075
Returns the current DatabaseRecordList instance.
76+
77+
.. php:method:: getRequest()
78+
:returns: `\Psr\Http\Message\RequestInterface`

Documentation/CodeSnippets/Events/Backend/PageContentPreviewRenderingEvent.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
:returns: `string`
1313

1414
.. php:method:: getRecord()
15-
:returns: `array`
15+
:returns: `\TYPO3\CMS\Core\Domain\RecordInterface`
1616

17-
.. php:method:: setRecord(array $record)
17+
.. php:method:: setRecord(\TYPO3\CMS\Core\Domain\RecordInterface $record)
1818
1919
:param $record: the record
2020

Documentation/CodeSnippets/Events/Filelist/ProcessFileListActionsEvent.rst.txt

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,64 @@
1111
.. php:method:: isFile()
1212
:returns: `bool`
1313

14-
.. php:method:: getActionItems()
15-
:returns: `array`
14+
.. php:method:: setAction(?\TYPO3\CMS\Backend\Template\Components\ComponentInterface $action, string $actionName, \TYPO3\CMS\Backend\Template\Components\ActionGroup $group = \TYPO3\CMS\Backend\Template\Components\ActionGroup::secondary, string $before = '', string $after = '')
1615
17-
.. php:method:: setActionItems(array $actionItems)
16+
Add a new action or override an existing one. Latter is only possible,
17+
in case $columnName is given. Otherwise, the column will be added with
18+
a numeric index, which is generally not recommended. It's also possible
19+
to define the position of an action with either the "before" or "after"
20+
argument, while their value must be an existing action.
1821

19-
:param $actionItems: the actionItems
22+
Note: In case none or an invalid $group is provided, the new action will
23+
be added to the secondary group.
24+
25+
:param $action: the action
26+
:param $actionName: the actionName
27+
:param $group: the group, default: \TYPO3\CMS\Backend\Template\Components\ActionGroup::secondary
28+
:param $before: the before, default: ''
29+
:param $after: the after, default: ''
30+
31+
.. php:method:: hasAction(string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)
32+
:returns: `bool`
33+
34+
Whether the action exists in the given group. In case none or
35+
an invalid $group is provided, both groups will be checked.
36+
37+
:param $actionName: the actionName
38+
:param $group: the group, default: NULL
39+
40+
.. php:method:: getAction(string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)
41+
:returns: `?\TYPO3\CMS\Backend\Template\Components\ComponentInterface`
42+
43+
Get action by its name. In case the action exists in both groups
44+
and none or an invalid $group is provided, the action from the
45+
"primary" group will be returned.
46+
47+
:param $actionName: the actionName
48+
:param $group: the group, default: NULL
49+
50+
.. php:method:: removeAction(string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)
51+
52+
Remove action by its name. In case the action exists in both groups
53+
and none or an invalid $group is provided, the action will be removed
54+
from both groups.
55+
56+
:param $actionName: the actionName
57+
:param $group: the group, default: NULL
58+
59+
.. php:method:: moveActionTo(string $actionName, \TYPO3\CMS\Backend\Template\Components\ActionGroup $group, string $before = '', string $after = '')
60+
61+
:param $actionName: the actionName
62+
:param $group: the group
63+
:param $before: the before, default: ''
64+
:param $after: the after, default: ''
65+
66+
.. php:method:: getActionGroup(\TYPO3\CMS\Backend\Template\Components\ActionGroup $group)
67+
:returns: `\TYPO3\CMS\Backend\Template\Components\ComponentGroup`
68+
69+
Get the actions of a specific group
70+
71+
:param $group: the group
72+
73+
.. php:method:: getRequest()
74+
:returns: `\Psr\Http\Message\RequestInterface`

Documentation/CodeSnippets/Events/Form/BeforeRenderableIsRemovedFromFormEvent.rst.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
44
.. php:class:: BeforeRenderableIsRemovedFromFormEvent
55
6-
Listeners to this event will be able to prevent deletion of the renderable (form element) and to add custom logic based on the deletion.
6+
Listeners to this Event will be able to:
7+
- Get the renderable that is about to be removed from the form
8+
- Stop the deletion process by setting preventRemoval to true
9+
- Add custom logic, e.g. cleanup tasks, before deletion
710

811
.. php:attr:: renderable
12+
:readonly:
913
:public:
1014

11-
The form element (readonly)
12-
1315
.. php:attr:: preventRemoval
1416
:public:
1517

16-
A boolean flag that can be set to true to prevent removal of the renderable.
18+
.. php:method:: isPropagationStopped()
19+
:returns: `bool`

0 commit comments

Comments
 (0)