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.
Table of Contents
Constants
- ALLOWED_ACTIONS = ['overview', 'edit', 'save', 'delete']
Properties
- $iconFactory : IconFactory
- $moduleTemplate : ModuleTemplate
- $moduleTemplateFactory : ModuleTemplateFactory
- $pageRenderer : PageRenderer
- $siteFinder : SiteFinder
- $uriBuilder : UriBuilder
- $view : ViewInterface
Methods
- __construct() : mixed
- handleRequest() : ResponseInterface
- Main entry method: Dispatch to other actions - those method names that end with "Action".
- configureEditViewDocHeader() : void
- Create document header buttons of "edit" action
- configureOverViewDocHeader() : void
- Create document header buttons of "overview" action
- deleteAction() : ResponseInterface
- Delete an existing configuration
- editAction() : void
- Shows a form to create a new site configuration, or edit an existing one.
- 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.
- initializeView() : void
- Sets up the Fluid View.
- overviewAction() : void
- 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
- 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.
Constants
ALLOWED_ACTIONS
protected
mixed
ALLOWED_ACTIONS
= ['overview', 'edit', 'save', 'delete']
Properties
$iconFactory
protected
IconFactory
$iconFactory
$moduleTemplate
protected
ModuleTemplate
$moduleTemplate
$moduleTemplateFactory
protected
ModuleTemplateFactory
$moduleTemplateFactory
$pageRenderer
protected
PageRenderer
$pageRenderer
$siteFinder
protected
SiteFinder
$siteFinder
$uriBuilder
protected
UriBuilder
$uriBuilder
$view
protected
ViewInterface
$view
Methods
__construct()
public
__construct(SiteFinder $siteFinder, IconFactory $iconFactory, PageRenderer $pageRenderer, UriBuilder $uriBuilder, ModuleTemplateFactory $moduleTemplateFactory) : mixed
Parameters
- $siteFinder : SiteFinder
- $iconFactory : IconFactory
- $pageRenderer : PageRenderer
- $uriBuilder : UriBuilder
- $moduleTemplateFactory : ModuleTemplateFactory
handleRequest()
Main entry method: Dispatch to other actions - those method names that end with "Action".
public
handleRequest(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
-
the current request
Return values
ResponseInterface —the response with the content
configureEditViewDocHeader()
Create document header buttons of "edit" action
protected
configureEditViewDocHeader() : void
configureOverViewDocHeader()
Create document header buttons of "overview" action
protected
configureOverViewDocHeader(string $requestUri) : void
Parameters
- $requestUri : string
deleteAction()
Delete an existing configuration
protected
deleteAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfaceeditAction()
Shows a form to create a new site configuration, or edit an existing one.
protected
editAction(ServerRequestInterface $request) : void
Parameters
- $request : ServerRequestInterface
Tags
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>initializeView()
Sets up the Fluid View.
protected
initializeView(string $templateName) : void
Parameters
- $templateName : string
overviewAction()
List pages that have 'is_siteroot' flag set - those that have the globe icon in page tree.
protected
overviewAction(ServerRequestInterface $request) : void
Link to Add / Edit / Delete for each.
Parameters
- $request : ServerRequestInterface
saveAction()
Save incoming data from editAction and redirect to overview or edit
protected
saveAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Tags
Return values
ResponseInterfacevalidateAndProcessIdentifier()
Validation and processing of site identifier
protected
validateAndProcessIdentifier(bool $isNew, string $identifier, int $rootPageId) : 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
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) : array<string|int, mixed>
Parameters
- $newSysSiteData : array<string|int, mixed>
-
Incoming data
Tags
Return values
array<string|int, mixed> —Updated data if needed