NewContentElementController
class \
New Content element wizard. This is the modal that pops up when clicking "+content" in page module, which will trigger wizardAction() since there is a colPos given. Method positionMapAction() is triggered for instance from the records module "+content" on tt_content table header, and from records module doc-header "+" and then "Click here for wizard".
Internal
This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
Attributes
- #[AsController]
Table of Contents
Properties
- $backendLayoutView : BackendLayoutView
- $backendViewFactory : BackendViewFactory
- $colPos : int|null
- If set, the content is destined for a specific column.
- $dependencyOrderingService : DependencyOrderingService
- $eventDispatcher : EventDispatcherInterface
- $id : int
- $pageInfo : array
- $returnUrl : string
- $sys_language : int
- $tcaSchemaFactory : TcaSchemaFactory
- $uid_pid : int
- $uriBuilder : UriBuilder
Methods
- __construct() : mixed
- handleRequest() : ResponseInterface
- Process incoming request and dispatch to the requested action
- getBackendUser() : BackendUserAuthentication
- getLanguageService() : LanguageService
- getWizards() : array
- Returns the array of elements in the wizard display.
- hasPositionalArguments() : bool
- loadAvailableWizards() : array
- mergeContentElementWizardsWithPageTSConfigWizards() : array
- This method merges Content Element wizards defined by TCA with wizards defined in PageTSConfig.
- migrateCommonGroupToDefault() : array<string, array>
- This method returns the wizard items, defined in Page TSconfig for b/w compatibility.
- migratePositionalCommonGroupToDefault() : array
- orderElements() : array
- Orders elements within a wizard group using before/after configuration.
- orderWizards() : array
- There are two separate ordering systems for wizard groups: 1. TCA itemGroup sorting by associative array item order.
- positionMapAction() : ResponseInterface
- Renders the position map
- prepareDependencyOrdering() : array
- Prepare a wizard tab configuration for sorting.
- prepareWizardItem() : array
- removeInvalidWizardItems() : array
- Checks the array for elements which might contain invalid default values and will unset them! Looks for the "defaultValues" key in each element and if found it will traverse that array as fieldname / value pairs and check.
- removeWizardsByBackendLayoutColPosRestriction() : array
- removeWizardsByPageTs() : array
- wizardAction() : ResponseInterface
- Renders the wizard
Properties
$backendLayoutView read-only
protected
BackendLayoutView
$backendLayoutView
$backendViewFactory read-only
protected
BackendViewFactory
$backendViewFactory
$colPos
If set, the content is destined for a specific column.
protected
int|null
$colPos
= null
$dependencyOrderingService read-only
protected
DependencyOrderingService
$dependencyOrderingService
$eventDispatcher read-only
protected
EventDispatcherInterface
$eventDispatcher
$id
protected
int
$id
= 0
$pageInfo
protected
array
$pageInfo
= []
$returnUrl
protected
string
$returnUrl
= ''
$sys_language
protected
int
$sys_language
= \TYPO3\CMS\Core\Schema\LanguageMarker::DEFAULT_LANGUAGE
$tcaSchemaFactory read-only
protected
TcaSchemaFactory
$tcaSchemaFactory
$uid_pid
protected
int
$uid_pid
= 0
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
Methods
__construct()
public
__construct(UriBuilder $uriBuilder, BackendViewFactory $backendViewFactory, EventDispatcherInterface $eventDispatcher, DependencyOrderingService $dependencyOrderingService, TcaSchemaFactory $tcaSchemaFactory, BackendLayoutView $backendLayoutView) : mixed
Parameters
- $uriBuilder : UriBuilder
- $backendViewFactory : BackendViewFactory
- $eventDispatcher : EventDispatcherInterface
- $dependencyOrderingService : DependencyOrderingService
- $tcaSchemaFactory : TcaSchemaFactory
- $backendLayoutView : BackendLayoutView
handleRequest()
Process incoming request and dispatch to the requested action
public
handleRequest(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacegetBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetWizards()
Returns the array of elements in the wizard display.
protected
getWizards(ServerRequestInterface $request) : array
For the plugin section there is support for adding elements there from a global variable.
Parameters
- $request : ServerRequestInterface
Return values
arrayhasPositionalArguments()
protected
hasPositionalArguments(array $elements) : bool
Parameters
- $elements : array
Return values
boolloadAvailableWizards()
protected
loadAvailableWizards() : array
Return values
arraymergeContentElementWizardsWithPageTSConfigWizards()
This method merges Content Element wizards defined by TCA with wizards defined in PageTSConfig.
protected
mergeContentElementWizardsWithPageTSConfigWizards(array $contentElementWizards, array $pageTsConfigWizards) : array
PageTS has precedence. It might happen that both TCA and PageTS define an entry with exactly the same default values. In such a case, the automatically added TCA entry is dropped.
Parameters
- $contentElementWizards : array
- $pageTsConfigWizards : array
Return values
arraymigrateCommonGroupToDefault()
This method returns the wizard items, defined in Page TSconfig for b/w compatibility.
protected
migrateCommonGroupToDefault(array<string, array> $wizardsFromPageTs) : array<string, array>
Additionally, it migrates previously defined wizard items in the
common group to the new default group, which is defined in TCA.
Parameters
- $wizardsFromPageTs : array<string, array>
Return values
array<string, array>migratePositionalCommonGroupToDefault()
protected
migratePositionalCommonGroupToDefault(array $wizards) : array
Parameters
- $wizards : array
Return values
arrayorderElements()
Orders elements within a wizard group using before/after configuration.
protected
orderElements(array $elements) : array
Similar to orderWizards() but for individual content elements.
Parameters
- $elements : array
Return values
arrayorderWizards()
There are two separate ordering systems for wizard groups: 1. TCA itemGroup sorting by associative array item order.
protected
orderWizards(array $wizards) : array
- PageTS defined order by "before" and "after".
System 1. has a well-defined order, where every item defines "after" (linked list). Due to this, the two system cannot be combined. As soon as system 2 defines at least one "before" or "after" it takes over.
Parameters
- $wizards : array
Return values
arraypositionMapAction()
Renders the position map
protected
positionMapAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfaceprepareDependencyOrdering()
Prepare a wizard tab configuration for sorting.
protected
prepareDependencyOrdering(array $wizardGroup, string $key) : array
Parameters
- $wizardGroup : array
- $key : string
Return values
arrayprepareWizardItem()
protected
prepareWizardItem(array $itemConf) : array
Parameters
- $itemConf : array
Return values
arrayremoveInvalidWizardItems()
Checks the array for elements which might contain invalid default values and will unset them! Looks for the "defaultValues" key in each element and if found it will traverse that array as fieldname / value pairs and check.
protected
removeInvalidWizardItems(array $wizardItems) : array
Parameters
- $wizardItems : array
Return values
arrayremoveWizardsByBackendLayoutColPosRestriction()
protected
removeWizardsByBackendLayoutColPosRestriction(array $wizardGroups, array $pageInfo, int|null $colPos, ServerRequestInterface $request) : array
Parameters
- $wizardGroups : array
- $pageInfo : array
- $colPos : int|null
- $request : ServerRequestInterface
Return values
arrayremoveWizardsByPageTs()
protected
removeWizardsByPageTs(array $wizards, mixed $wizardsItemsPageTs) : array
Parameters
- $wizards : array
- $wizardsItemsPageTs : mixed
Return values
arraywizardAction()
Renders the wizard
protected
wizardAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface