FormInlineAjaxController
class \
- Extends
- AbstractFormEngineAjaxController
Handle FormEngine inline ajax calls
Table of Contents
Methods
- 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.
- addRegisteredRequireJsModulesToJavaScriptItems() : void
- backendUserHasUcInlineView() : bool
- Method to check whether the backend user has the property inline view for the current IRRE item.
- compileChild() : array
- Compile a full child record
- compileChildChild() : array
- With useCombination set, not only content of the intermediate table, but also the connected child should be rendered in one go. Prepare this here.
- createExecutableStringRepresentationOfRegisteredRequireJsModules() : array
- Gets result array from FormEngine and returns string with js modules that need to be loaded and evaluated by JavaScript.
- extractSignedParentConfigFromRequest() : array
- Validates the config that is transferred over the wire to provide the correct TCA config for the parent table
- getBackendUserAuthentication() : BackendUserAuthentication
- getErrorMessageForAJAX() : array
- Generates an error message that transferred as JSON for AJAX calls
- getInlineExpandCollapseStateArray() : array
- Get expand / collapse state of inline items
- getInlineExpandCollapseStateArrayForTableUid() : array
- Return expand / collapse state array for a given table / uid combination
- getInlineFirstPidFromDomObjectId() : int|string|null
- Get inlineFirstPid from a given objectId string
- getInlineRelatedRecordsUidArray() : array
- Gets an array with the uids of related records out of a list of items.
- getLabelsFromLocalizationFile() : array
- 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
- Merge stuff from child array into json array.
- removeFromArray() : array
- Remove an element from an array.
- serializeJavaScriptModuleInstructionItems() : array
Methods
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
addRegisteredRequireJsModulesToJavaScriptItems()
protected
addRegisteredRequireJsModulesToJavaScriptItems(array $result, JavaScriptItems $items) : void
Parameters
- $result : array
- $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(array $parentData, string $parentFieldName, int $childUid, array $inlineStructure) : array
Parameters
- $parentData : array
-
Result array of parent
- $parentFieldName : string
-
Name of parent field
- $childUid : int
-
Uid of child to compile
- $inlineStructure : array
-
Current inline structure
Tags
Return values
array —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(array $child, array $parentConfig, array $inlineStructure) : array
Parameters
- $child : array
-
Full data array of "mm" record
- $parentConfig : array
-
TCA configuration of "parent"
- $inlineStructure : array
-
Current inline structure
Return values
array —Full data array of child
createExecutableStringRepresentationOfRegisteredRequireJsModules()
Gets result array from FormEngine and returns string with js modules that need to be loaded and evaluated by JavaScript.
protected
createExecutableStringRepresentationOfRegisteredRequireJsModules(array $result[, bool $skipInstructions = false ]) : array
Parameters
- $result : array
- $skipInstructions : bool = false
-
whether to skip
JavaScriptModuleInstruction
Return values
arrayextractSignedParentConfigFromRequest()
Validates the config that is transferred over the wire to provide the correct TCA config for the parent table
protected
extractSignedParentConfigFromRequest(string $contextString) : array
Parameters
- $contextString : string
Tags
Return values
arraygetBackendUserAuthentication()
protected
getBackendUserAuthentication() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetErrorMessageForAJAX()
Generates an error message that transferred as JSON for AJAX calls
protected
getErrorMessageForAJAX(string $message) : array
Parameters
- $message : string
-
The error message to be shown
Internal
Tags
Return values
array —The error message in a JSON array
getInlineExpandCollapseStateArray()
Get expand / collapse state of inline items
protected
getInlineExpandCollapseStateArray() : array
Return values
arraygetInlineExpandCollapseStateArrayForTableUid()
Return expand / collapse state array for a given table / uid combination
protected
getInlineExpandCollapseStateArrayForTableUid(string $table, int $uid) : array
Parameters
- $table : string
-
Handled table
- $uid : int
-
Handled uid
Return values
arraygetInlineFirstPidFromDomObjectId()
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
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 —An array with uids
getLabelsFromLocalizationFile()
Parse a language file and get a label/value array from it.
protected
getLabelsFromLocalizationFile(string $file) : array
Parameters
- $file : string
-
EXT:path/to/file
Return values
array —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 $jsonResult, array $childResult) : array
This method is needed since ajax handling methods currently need to put scriptCalls before and after child code.
Parameters
- $jsonResult : array
-
Given json result
- $childResult : array
-
Given child result
Return values
array —Merged json array
removeFromArray()
Remove an element from an array.
protected
removeFromArray(mixed $needle, array $haystack[, bool $strict = false ]) : array
Parameters
- $needle : mixed
-
The element to be removed.
- $haystack : array
-
The array the element should be removed from.
- $strict : bool = false
-
Search elements strictly.
Return values
array —The array $haystack without the $needle
serializeJavaScriptModuleInstructionItems()
protected
serializeJavaScriptModuleInstructionItems(JavaScriptModuleInstruction $instruction) : array
Parameters
- $instruction : JavaScriptModuleInstruction