SiteConfigurationController

class \TYPO3\CMS\Backend\Controller\SiteConfigurationController

Backend controller: The "Site management" -> "Sites" module

List all site root pages, CRUD site configuration.

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
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
Get all entry duplicates which are used multiple times
getLanguageService()  : LanguageService
getLastLanguageId()  : int
Returns the last (highest) language id from all sites
getMergeSiteData()  : array
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
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

Methods

deleteAction()

Delete an existing configuration

public deleteAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

editAction()

Shows a form to create a new site configuration, or edit an existing one.

public editAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Tags

throws
RuntimeException

Return values

ResponseInterface

overviewAction()

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

ResponseInterface

saveAction()

Save incoming data from editAction and redirect to overview or edit

public saveAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Tags

throws
RuntimeException

Return values

ResponseInterface

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

Return values

array

getDuplicatedEntryPoints()

Get all entry duplicates which are used multiple times

protected getDuplicatedEntryPoints(Site[] $allSites, array $pages) : array

Parameters

$allSites : Site[]
$pages : array

Return values

array

getLastLanguageId()

Returns the last (highest) language id from all sites

protected getLastLanguageId() : int

Return values

int

getMergeSiteData()

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 $currentSiteConfiguration, array $newSysSiteData) : array

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
$newSysSiteData : array

Return values

array

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

throws
SiteValidationErrorException
throws
RuntimeException

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 $newSysSiteData, bool $isNewConfiguration) : array

Parameters

$newSysSiteData : array

Incoming data

$isNewConfiguration : bool

Flag whether site configuration is new

Tags

throws
RuntimeException

Return values

array —

Updated data if needed

validateValueForRequired()

Checks if required=TRUE is set.

protected validateValueForRequired(array $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
$value : mixed

Return values

bool
On this page