‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Controller\SiteConfigurationController Class Reference

Public Member Functions

 __construct (protected readonly SiteFinder $siteFinder, protected readonly IconFactory $iconFactory, protected readonly UriBuilder $uriBuilder, protected readonly ModuleTemplateFactory $moduleTemplateFactory, private readonly FormDataCompiler $formDataCompiler, private readonly PageRenderer $pageRenderer, private readonly SiteConfiguration $siteConfiguration, private readonly SiteWriter $siteWriter,)
 
 overviewAction (ServerRequestInterface $request)
 
 editAction (ServerRequestInterface $request)
 
 saveAction (ServerRequestInterface $request)
 
 deleteAction (ServerRequestInterface $request)
 

Protected Member Functions

mixed validateAndProcessIdentifier (bool $isNew, string $identifier, int $rootPageId, array $allSites, array $mappingRootPageToSite)
 
mixed validateAndProcessValue (string $tableName, string $fieldName, $fieldValue)
 
array validateFullStructure (array $newSysSiteData, bool $isNewConfiguration)
 
 configureEditViewDocHeader (ModuleTemplate $view)
 
 configureOverViewDocHeader (ModuleTemplate $view, string $requestUri)
 
 getAllSitePages ()
 
 getDuplicatedEntryPoints (array $allSites, array $pages)
 
 getLastLanguageId ()
 
 validateValueForRequired (array $tcaFieldConfig, mixed $value)
 
 getMergeSiteData (array $currentSiteConfiguration, array $newSysSiteData)
 
 getLanguageService ()
 
 getBackendUser ()
 

Detailed Description

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.

Definition at line 66 of file SiteConfigurationController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::__construct ( protected readonly SiteFinder  $siteFinder,
protected readonly IconFactory  $iconFactory,
protected readonly UriBuilder  $uriBuilder,
protected readonly ModuleTemplateFactory  $moduleTemplateFactory,
private readonly FormDataCompiler  $formDataCompiler,
private readonly PageRenderer  $pageRenderer,
private readonly SiteConfiguration  $siteConfiguration,
private readonly SiteWriter  $siteWriter 
)

Definition at line 68 of file SiteConfigurationController.php.

Member Function Documentation

◆ configureEditViewDocHeader()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::configureEditViewDocHeader ( ModuleTemplate  $view)
protected

◆ configureOverViewDocHeader()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::configureOverViewDocHeader ( ModuleTemplate  $view,
string  $requestUri 
)
protected

◆ deleteAction()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::deleteAction ( ServerRequestInterface  $request)

◆ editAction()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::editAction ( ServerRequestInterface  $request)

◆ getAllSitePages()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::getAllSitePages ( )
protected

◆ getBackendUser()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::getBackendUser ( )
protected

◆ getDuplicatedEntryPoints()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::getDuplicatedEntryPoints ( array  $allSites,
array  $pages 
)
protected

Get all entry duplicates which are used multiple times

Parameters
Site[]$allSites

Definition at line 768 of file SiteConfigurationController.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

Referenced by TYPO3\CMS\Backend\Controller\SiteConfigurationController\overviewAction().

◆ getLanguageService()

◆ getLastLanguageId()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::getLastLanguageId ( )
protected

Returns the last (highest) language id from all sites

Definition at line 796 of file SiteConfigurationController.php.

Referenced by TYPO3\CMS\Backend\Controller\SiteConfigurationController\saveAction().

◆ getMergeSiteData()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::getMergeSiteData ( array  $currentSiteConfiguration,
array  $newSysSiteData 
)
protected

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.

Additionally, we also keep the baseVariants of languages, since they can't be modified via the GUI, but are part of the public API.

Definition at line 832 of file SiteConfigurationController.php.

Referenced by TYPO3\CMS\Backend\Controller\SiteConfigurationController\saveAction().

◆ overviewAction()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::overviewAction ( ServerRequestInterface  $request)

◆ saveAction()

◆ validateAndProcessIdentifier()

mixed TYPO3\CMS\Backend\Controller\SiteConfigurationController::validateAndProcessIdentifier ( bool  $isNew,
string  $identifier,
int  $rootPageId,
array  $allSites,
array  $mappingRootPageToSite 
)
protected

Validation and processing of site identifier

Parameters
bool$isNew‪If true, we're dealing with a new record
string$identifier‪Given identifier to validate and process
int$rootPageIdPage uid this identifier is bound to
array<non-empty-string,Site>‪$allSites All sites loaded without settings.yaml.
array<int,Site>‪$mappingRootPageToSite Identifier site mapping as lookup. Not loaded settings.yaml.
Returns
‪mixed Verified / modified value

Definition at line 451 of file SiteConfigurationController.php.

References TYPO3\CMS\Webhooks\Message\$identifier, TYPO3\CMS\Backend\Controller\SiteConfigurationController\getLanguageService(), TYPO3\CMS\Core\Site\Entity\Site\getRootPageId(), TYPO3\CMS\Core\Utility\StringUtility\getUniqueId(), and TYPO3\CMS\Backend\Controller\SiteConfigurationController\validateAndProcessValue().

Referenced by TYPO3\CMS\Backend\Controller\SiteConfigurationController\saveAction().

◆ validateAndProcessValue()

mixed TYPO3\CMS\Backend\Controller\SiteConfigurationController::validateAndProcessValue ( string  $tableName,
string  $fieldName,
  $fieldValue 
)
protected

Simple validation and processing method for incoming form field values.

Note this does not support all TCA "eval" options but only what we really need.

Parameters
string$tableName‪Table name
string$fieldName‪Field name
mixed$fieldValue‪Incoming value from FormEngine
Returns
‪mixed Verified / modified value
Exceptions
SiteValidationErrorException

Definition at line 514 of file SiteConfigurationController.php.

References $GLOBALS, TYPO3\CMS\Backend\Controller\SiteConfigurationController\getLanguageService(), TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode(), and TYPO3\CMS\Backend\Controller\SiteConfigurationController\validateValueForRequired().

Referenced by TYPO3\CMS\Backend\Controller\SiteConfigurationController\saveAction(), and TYPO3\CMS\Backend\Controller\SiteConfigurationController\validateAndProcessIdentifier().

◆ validateFullStructure()

array TYPO3\CMS\Backend\Controller\SiteConfigurationController::validateFullStructure ( array  $newSysSiteData,
bool  $isNewConfiguration 
)
protected

Last sanitation method after all data has been gathered. Check integrity of full record, manipulate if possible, or throw exception if unfixable broken.

Parameters
array$newSysSiteData‪Incoming data
bool$isNewConfiguration‪Flag whether site configuration is new
Returns
‪array Updated data if needed
Exceptions

Definition at line 579 of file SiteConfigurationController.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Backend\Controller\SiteConfigurationController\getLanguageService().

Referenced by TYPO3\CMS\Backend\Controller\SiteConfigurationController\saveAction().

◆ validateValueForRequired()

TYPO3\CMS\Backend\Controller\SiteConfigurationController::validateValueForRequired ( array  $tcaFieldConfig,
mixed  $value 
)
protected

Checks if required=TRUE is set. If set: checks if the value is not empty (or not "0"). If not set or set to FALSE: Returns TRUE.

Definition at line 814 of file SiteConfigurationController.php.

Referenced by TYPO3\CMS\Backend\Controller\SiteConfigurationController\validateAndProcessValue().