FormInlineAjaxController extends AbstractFormEngineAjaxController
Handle FormEngine inline ajax calls
Attributes
- #[AsController]
Table of Contents
Methods
- __construct() : mixed
- createAction() : ResponseInterface
- Create a new inline child via AJAX.
- detailsAction() : ResponseInterface
- Show the details of a child record.
- expandOrCollapseAction() : ResponseInterface
- Store status of inline children expand / collapse state in backend user uC.
- synchronizeLocalizeAction() : ResponseInterface
- Adds localizations or synchronizes the locations of all child records.
- addJavaScriptModulesToJavaScriptItems() : void
- backendUserHasUcInlineView() : bool
- Method to check whether the backend user has the property inline view for the current IRRE item.
- compileChild() : array<string|int, mixed>
- Compile a full child record
- compileChildChild() : array<string|int, mixed>
- With useCombination set, not only content of the intermediate table, but also the connected child should be rendered in one go. Prepare this here.
- extractSignedParentConfigFromRequest() : array<string|int, mixed>
- Validates the config that is transferred over the wire to provide the correct TCA config for the parent table
- getBackendUserAuthentication() : BackendUserAuthentication
- getChildChildTableName() : string
- The child-child table name is set in the child TCA "the selector field" and is depending on the TCA type (select or group) either the "foreign_table" or the (first) "allowed" table.
- getInlineExpandCollapseStateArray() : array<string|int, mixed>
- Get expand / collapse state of inline items
- getInlineFirstPidFromDomObjectId() : int|string|null
- Get inlineFirstPid from a given objectId string
- getInlineRelatedRecordsUidArray() : array<string|int, mixed>
- Gets an array with the uids of related records out of a list of items.
- getLabelsFromLocalizationFile() : array<string|int, mixed>
- Parse a language file and get a label/value array from it.
- getLanguageService() : LanguageService|null
- getRelativePathToStylesheetFile() : string
- Resolve a CSS file position, possibly prefixed with 'EXT:'
- mergeChildResultIntoJsonResult() : array<string|int, mixed>
- Merge stuff from child array into json array.
- removeFromArray() : array<string|int, mixed>
- Remove an element from an array.
Methods
__construct()
public
__construct(FormDataCompiler $formDataCompiler, HashService $hashService, NodeFactory $nodeFactory) : mixed
Parameters
- $formDataCompiler : FormDataCompiler
- $hashService : HashService
- $nodeFactory : NodeFactory
createAction()
Create a new inline child via AJAX.
public
createAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacedetailsAction()
Show the details of a child record.
public
detailsAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfaceexpandOrCollapseAction()
Store status of inline children expand / collapse state in backend user uC.
public
expandOrCollapseAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
-
the incoming request
Return values
ResponseInterface —the filled response
synchronizeLocalizeAction()
Adds localizations or synchronizes the locations of all child records.
public
synchronizeLocalizeAction(ServerRequestInterface $request) : ResponseInterface
Handle AJAX calls to localize all records of a parent, localize a single record or to synchronize with the original language parent.
Parameters
- $request : ServerRequestInterface
-
the incoming request
Return values
ResponseInterface —the filled response
addJavaScriptModulesToJavaScriptItems()
protected
addJavaScriptModulesToJavaScriptItems(array<string|int, mixed> $modules, JavaScriptItems $items) : void
Parameters
- $modules : array<string|int, mixed>
- $items : JavaScriptItems
backendUserHasUcInlineView()
Method to check whether the backend user has the property inline view for the current IRRE item.
protected
backendUserHasUcInlineView(BackendUserAuthentication $backendUser) : bool
In existing or old IRRE items the attribute may not exist, then the json_decode will fail.
Parameters
- $backendUser : BackendUserAuthentication
Return values
boolcompileChild()
Compile a full child record
protected
compileChild(ServerRequestInterface $request, array<string|int, mixed> $parentData, string $parentFieldName, int $childUid, array<string|int, mixed> $inlineStructure) : array<string|int, mixed>
Parameters
- $request : ServerRequestInterface
- $parentData : array<string|int, mixed>
-
Result array of parent
- $parentFieldName : string
-
Name of parent field
- $childUid : int
-
Uid of child to compile
- $inlineStructure : array<string|int, mixed>
-
Current inline structure
Tags
Return values
array<string|int, mixed> —Full result array
compileChildChild()
With useCombination set, not only content of the intermediate table, but also the connected child should be rendered in one go. Prepare this here.
protected
compileChildChild(ServerRequestInterface $request, array<string|int, mixed> $child, array<string|int, mixed> $parentConfig, array<string|int, mixed> $inlineStructure) : array<string|int, mixed>
Parameters
- $request : ServerRequestInterface
- $child : array<string|int, mixed>
-
Full data array of "mm" record
- $parentConfig : array<string|int, mixed>
-
TCA configuration of "parent"
- $inlineStructure : array<string|int, mixed>
-
Current inline structure
Return values
array<string|int, mixed> —Full data array of child
extractSignedParentConfigFromRequest()
Validates the config that is transferred over the wire to provide the correct TCA config for the parent table
protected
extractSignedParentConfigFromRequest(string $contextString) : array<string|int, mixed>
Parameters
- $contextString : string
Tags
Return values
array<string|int, mixed>getBackendUserAuthentication()
protected
getBackendUserAuthentication() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetChildChildTableName()
The child-child table name is set in the child TCA "the selector field" and is depending on the TCA type (select or group) either the "foreign_table" or the (first) "allowed" table.
protected
getChildChildTableName(string $foreignSelector, array<string|int, mixed> $childConfiguration) : string
Parameters
- $foreignSelector : string
- $childConfiguration : array<string|int, mixed>
Return values
stringgetInlineExpandCollapseStateArray()
Get expand / collapse state of inline items
protected
getInlineExpandCollapseStateArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getInlineFirstPidFromDomObjectId()
Get inlineFirstPid from a given objectId string
protected
getInlineFirstPidFromDomObjectId(string $domObjectId) : int|string|null
Parameters
- $domObjectId : string
-
The id attribute of an element
Return values
int|string|null —Pid or null
getInlineRelatedRecordsUidArray()
Gets an array with the uids of related records out of a list of items.
protected
getInlineRelatedRecordsUidArray(string $itemList) : array<string|int, mixed>
This list could contain more information than required. This methods just extracts the uids.
Parameters
- $itemList : string
-
The list of related child records
Return values
array<string|int, mixed> —An array with uids
getLabelsFromLocalizationFile()
Parse a language file and get a label/value array from it.
protected
getLabelsFromLocalizationFile(string $file) : array<string|int, mixed>
Parameters
- $file : string
-
EXT:path/to/file
Return values
array<string|int, mixed> —Label/value array
getLanguageService()
protected
getLanguageService() : LanguageService|null
Return values
LanguageService|nullgetRelativePathToStylesheetFile()
Resolve a CSS file position, possibly prefixed with 'EXT:'
protected
getRelativePathToStylesheetFile(string $stylesheetFile) : string
Parameters
- $stylesheetFile : string
-
Given file, possibly prefixed with EXT:
Return values
string —Web root relative position to file
mergeChildResultIntoJsonResult()
Merge stuff from child array into json array.
protected
mergeChildResultIntoJsonResult(array<string|int, mixed> $jsonResult, array<string|int, mixed> $childResult) : array<string|int, mixed>
This method is needed since ajax handling methods currently need to put scriptCalls before and after child code.
Parameters
- $jsonResult : array<string|int, mixed>
-
Given json result
- $childResult : array<string|int, mixed>
-
Given child result
Return values
array<string|int, mixed> —Merged json array
removeFromArray()
Remove an element from an array.
protected
removeFromArray(mixed $needle, array<string|int, mixed> $haystack[, bool $strict = false ]) : array<string|int, mixed>
Parameters
- $needle : mixed
-
The element to be removed.
- $haystack : array<string|int, mixed>
-
The array the element should be removed from.
- $strict : bool = false
-
Search elements strictly.
Return values
array<string|int, mixed> —The array $haystack without the $needle