NewContentElementController

class \TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController

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".

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

$colPos

If set, the content is destined for a specific column.

protected int|null $colPos = null

$eventDispatcher read-only

protected EventDispatcherInterface $eventDispatcher

$returnUrl

protected string $returnUrl = ''

$sys_language

protected int $sys_language = \TYPO3\CMS\Core\Schema\LanguageMarker::DEFAULT_LANGUAGE

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

ResponseInterface

getWizards()

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

array

hasPositionalArguments()

protected hasPositionalArguments(array $elements) : bool

Parameters

$elements : array

Return values

bool

loadAvailableWizards()

protected loadAvailableWizards() : array

Return values

array

mergeContentElementWizardsWithPageTSConfigWizards()

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

array

migrateCommonGroupToDefault()

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

array

orderElements()

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

array

orderWizards()

There are two separate ordering systems for wizard groups: 1. TCA itemGroup sorting by associative array item order.

protected orderWizards(array $wizards) : array
  1. 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

array

positionMapAction()

Renders the position map

protected positionMapAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

prepareDependencyOrdering()

Prepare a wizard tab configuration for sorting.

protected prepareDependencyOrdering(array $wizardGroup, string $key) : array

Parameters

$wizardGroup : array
$key : string

Return values

array

prepareWizardItem()

protected prepareWizardItem(array $itemConf) : array

Parameters

$itemConf : array

Return values

array

removeInvalidWizardItems()

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

array

removeWizardsByBackendLayoutColPosRestriction()

protected removeWizardsByBackendLayoutColPosRestriction(array $wizardGroups, array $pageInfo, int|null $colPos, ServerRequestInterface $request) : array

Parameters

$wizardGroups : array
$pageInfo : array
$colPos : int|null
$request : ServerRequestInterface

Return values

array

removeWizardsByPageTs()

protected removeWizardsByPageTs(array $wizards, mixed $wizardsItemsPageTs) : array

Parameters

$wizards : array
$wizardsItemsPageTs : mixed

Return values

array

wizardAction()

Renders the wizard

protected wizardAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface
On this page