SiteConfigurationController
Backend controller: The "Site management" -> "Sites" module List all site root pages, CRUD site configuration.
This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
Attributes
- #[AsController]
Table of Contents
Properties
- $iconFactory : IconFactory
- $moduleTemplateFactory : ModuleTemplateFactory
- $siteFinder : SiteFinder
- $uriBuilder : UriBuilder
Methods
- __construct() : mixed
- deleteAction() : ResponseInterface
- Delete an existing configuration
- editAction() : ResponseInterface
- Shows a form to create a new site configuration, or edit an existing one.
- overviewAction() : ResponseInterface
- List pages that have 'is_siteroot' flag set - those that have the globe icon in page tree.
- saveAction() : ResponseInterface
- Save incoming data from editAction and redirect to overview or edit
- configureEditViewDocHeader() : void
- Create document header buttons of "edit" action
- configureOverViewDocHeader() : void
- Create document header buttons of "overview" action
- getAllSitePages() : array<string|int, mixed>
- Returns a list of pages that have 'is_siteroot' set or are on pid 0 and not in list of excluded doktypes
- getBackendUser() : BackendUserAuthentication
- getDuplicatedEntryPoints() : array<string|int, mixed>
- Get all entry duplicates which are used multiple times
- getLanguageService() : LanguageService
- getLastLanguageId() : int
- Returns the last (highest) language id from all sites
- getMergeSiteData() : array<string|int, mixed>
- Method keeps root config objects, which are not given via GUI. This way, extension authors are able to use their own objects on root level that are not configurable via GUI. However: We overwrite the full subset of any GUI object to make sure we have a clean state.
- validateAndProcessIdentifier() : mixed
- Validation and processing of site identifier
- validateAndProcessValue() : mixed
- Simple validation and processing method for incoming form field values.
- validateFullStructure() : array<string|int, mixed>
- Last sanitation method after all data has been gathered. Check integrity of full record, manipulate if possible, or throw exception if unfixable broken.
- validateValueForRequired() : bool
- Checks if required=TRUE is set.
Properties
$iconFactory read-only
protected
IconFactory
$iconFactory
$moduleTemplateFactory read-only
protected
ModuleTemplateFactory
$moduleTemplateFactory
$siteFinder read-only
protected
SiteFinder
$siteFinder
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
Methods
__construct()
public
__construct(SiteFinder $siteFinder, IconFactory $iconFactory, UriBuilder $uriBuilder, ModuleTemplateFactory $moduleTemplateFactory, FormDataCompiler $formDataCompiler, PageRenderer $pageRenderer, SiteConfiguration $siteConfiguration, SiteWriter $siteWriter, NodeFactory $nodeFactory) : mixed
Parameters
- $siteFinder : SiteFinder
- $iconFactory : IconFactory
- $uriBuilder : UriBuilder
- $moduleTemplateFactory : ModuleTemplateFactory
- $formDataCompiler : FormDataCompiler
- $pageRenderer : PageRenderer
- $siteConfiguration : SiteConfiguration
- $siteWriter : SiteWriter
- $nodeFactory : NodeFactory
deleteAction()
Delete an existing configuration
public
deleteAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfaceeditAction()
Shows a form to create a new site configuration, or edit an existing one.
public
editAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Tags
Return values
ResponseInterfaceoverviewAction()
List pages that have 'is_siteroot' flag set - those that have the globe icon in page tree.
public
overviewAction(ServerRequestInterface $request) : ResponseInterface
Link to Add / Edit / Delete for each.
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacesaveAction()
Save incoming data from editAction and redirect to overview or edit
public
saveAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Tags
Return values
ResponseInterfaceconfigureEditViewDocHeader()
Create document header buttons of "edit" action
protected
configureEditViewDocHeader(ModuleTemplate $view, string|null $siteIdentifier) : void
Parameters
- $view : ModuleTemplate
- $siteIdentifier : string|null
configureOverViewDocHeader()
Create document header buttons of "overview" action
protected
configureOverViewDocHeader(ModuleTemplate $view, string $requestUri) : void
Parameters
- $view : ModuleTemplate
- $requestUri : string
getAllSitePages()
Returns a list of pages that have 'is_siteroot' set or are on pid 0 and not in list of excluded doktypes
protected
getAllSitePages() : array<string|int, mixed>
Return values
array<string|int, mixed>getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetDuplicatedEntryPoints()
Get all entry duplicates which are used multiple times
protected
getDuplicatedEntryPoints(array<string|int, Site> $allSites, array<string|int, mixed> $pages) : array<string|int, mixed>
Parameters
- $allSites : array<string|int, Site>
- $pages : array<string|int, mixed>
Return values
array<string|int, mixed>getLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetLastLanguageId()
Returns the last (highest) language id from all sites
protected
getLastLanguageId() : int
Return values
intgetMergeSiteData()
Method keeps root config objects, which are not given via GUI. This way, extension authors are able to use their own objects on root level that are not configurable via GUI. However: We overwrite the full subset of any GUI object to make sure we have a clean state.
protected
getMergeSiteData(array<string|int, mixed> $currentSiteConfiguration, array<string|int, mixed> $newSysSiteData) : array<string|int, mixed>
Additionally, we also keep the baseVariants of languages, since they can't be modified via the GUI, but are part of the public API.
Parameters
- $currentSiteConfiguration : array<string|int, mixed>
- $newSysSiteData : array<string|int, mixed>
Return values
array<string|int, mixed>validateAndProcessIdentifier()
Validation and processing of site identifier
protected
validateAndProcessIdentifier(bool $isNew, string $identifier, int $rootPageId, array<non-empty-string, Site> $allSites, array<int, Site> $mappingRootPageToSite) : mixed
Parameters
- $isNew : bool
-
If true, we're dealing with a new record
- $identifier : string
-
Given identifier to validate and process
- $rootPageId : int
-
Page uid this identifier is bound to
- $allSites : array<non-empty-string, Site>
-
All sites loaded without
settings.yaml
. - $mappingRootPageToSite : array<int, Site>
-
Identifier site mapping as lookup. Not loaded
settings.yaml
.
Return values
mixed —Verified / modified value
validateAndProcessValue()
Simple validation and processing method for incoming form field values.
protected
validateAndProcessValue(string $tableName, string $fieldName, mixed $fieldValue) : mixed
Note this does not support all TCA "eval" options but only what we really need.
Parameters
- $tableName : string
-
Table name
- $fieldName : string
-
Field name
- $fieldValue : mixed
-
Incoming value from FormEngine
Tags
Return values
mixed —Verified / modified value
validateFullStructure()
Last sanitation method after all data has been gathered. Check integrity of full record, manipulate if possible, or throw exception if unfixable broken.
protected
validateFullStructure(array<string|int, mixed> $newSysSiteData, bool $isNewConfiguration) : array<string|int, mixed>
Parameters
- $newSysSiteData : array<string|int, mixed>
-
Incoming data
- $isNewConfiguration : bool
-
Flag whether site configuration is new
Tags
Return values
array<string|int, mixed> —Updated data if needed
validateValueForRequired()
Checks if required=TRUE is set.
protected
validateValueForRequired(array<string|int, mixed> $tcaFieldConfig, mixed $value) : bool
If set: checks if the value is not empty (or not "0"). If not set or set to FALSE: Returns TRUE.
Parameters
- $tcaFieldConfig : array<string|int, mixed>
- $value : mixed