diff --git a/typo3/sysext/backend/Classes/Configuration/SiteTcaConfiguration.php b/typo3/sysext/backend/Classes/Configuration/SiteTcaConfiguration.php index 1b32aeb37d1cdb657d275a8b8c8ce337ef150240..08f44e0c7a9873c2fbf122557988630f5f45451d 100644 --- a/typo3/sysext/backend/Classes/Configuration/SiteTcaConfiguration.php +++ b/typo3/sysext/backend/Classes/Configuration/SiteTcaConfiguration.php @@ -23,41 +23,42 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Helper class for the backend "Sites" module * - * Load Site configuration TCA from ext:*Configuration/SiteConfigurationTCA - * and ext:*Configuration/SiteConfigurationTCA/Overrides + * Load Site configuration TCA from ext:*Configuration/SiteConfiguration + * and ext:*Configuration/SiteConfiguration/Overrides */ class SiteTcaConfiguration { /** * Returns a "fake TCA" array that is syntactically identical to - * "normal" TCA, and just isn't available as $GLOBALS['TCA']. + * "normal" TCA, but is not available as $GLOBALS['TCA']. During + * configuration loading time, the target array is available as + * $GLOBALS['SiteConfiguration'] within the Overrides files. + * + * It is not possible to use ExtensionManagementUtility methods. * * @return array */ public function getTca(): array { - // To allow casual ExtensionManagementUtility methods that works on $GLOBALS['TCA'] - // to change our fake TCA, just kick original TCA, and reset to original at the end. - $originalTca = $GLOBALS['TCA']; - $GLOBALS['TCA'] = []; + $GLOBALS['SiteConfiguration'] = []; $activePackages = GeneralUtility::makeInstance(PackageManager::class)->getActivePackages(); - // First load "full table" files from Configuration/SiteConfigurationTCA + // First load "full table" files from Configuration/SiteConfiguration $finder = new Finder(); foreach ($activePackages as $package) { try { - $finder->files()->depth(0)->name('*.php')->in($package->getPackagePath() . 'Configuration/SiteConfigurationTCA'); + $finder->files()->depth(0)->name('*.php')->in($package->getPackagePath() . 'Configuration/SiteConfiguration'); } catch (\InvalidArgumentException $e) { // No such directory in this package continue; } foreach ($finder as $fileInfo) { - $GLOBALS['TCA'][substr($fileInfo->getBasename(), 0, -4)] = require $fileInfo->getPathname(); + $GLOBALS['SiteConfiguration'][substr($fileInfo->getBasename(), 0, -4)] = require $fileInfo->getPathname(); } } - // Execute override files from Configuration/TCA/Overrides + // Execute override files from Configuration/SiteConfiguration/Overrides foreach ($activePackages as $package) { try { - $finder->files()->depth(0)->name('*.php')->in($package->getPackagePath() . 'Configuration/SiteConfigurationTCA/Overrides'); + $finder->files()->depth(0)->name('*.php')->in($package->getPackagePath() . 'Configuration/SiteConfiguration/Overrides'); } catch (\InvalidArgumentException $e) { // No such directory in this package continue; @@ -66,8 +67,8 @@ class SiteTcaConfiguration require $fileInfo->getPathname(); } } - $result = $GLOBALS['TCA']; - $GLOBALS['TCA'] = $originalTca; + $result = $GLOBALS['SiteConfiguration']; + unset($GLOBALS['SiteConfiguration']); return $result; } } diff --git a/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php b/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php index dc17e095bfebc1f09fcba881e6bd240a24306c88..f91fea916b97b95e33200e88556d28c108516d47 100644 --- a/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php +++ b/typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php @@ -124,7 +124,7 @@ class SiteConfigurationController { $this->configureEditViewDocHeader(); - // Put sys_site and friends TCA into global TCA + // Put site and friends TCA into global TCA // @todo: We might be able to get rid of that later $GLOBALS['TCA'] = array_merge($GLOBALS['TCA'], GeneralUtility::makeInstance(SiteTcaConfiguration::class)->getTca()); @@ -138,7 +138,7 @@ class SiteConfigurationController $defaultValues = []; if ($isNewConfig) { - $defaultValues['sys_site']['rootPageId'] = $pageUid; + $defaultValues['site']['rootPageId'] = $pageUid; } $allSites = $this->siteFinder->getAllSites(); @@ -152,7 +152,7 @@ class SiteConfigurationController $formDataGroup = GeneralUtility::makeInstance(SiteConfigurationDataGroup::class); $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup); $formDataCompilerInput = [ - 'tableName' => 'sys_site', + 'tableName' => 'site', 'vanillaUid' => $isNewConfig ? $pageUid : $allSites[$siteIdentifier]->getRootPageId(), 'command' => $isNewConfig ? 'new' : 'edit', 'returnUrl' => (string)$returnUrl, @@ -186,7 +186,7 @@ class SiteConfigurationController */ protected function saveAction(ServerRequestInterface $request): ResponseInterface { - // Put sys_site and friends TCA into global TCA + // Put site and friends TCA into global TCA // @todo: We might be able to get rid of that later $GLOBALS['TCA'] = array_merge($GLOBALS['TCA'], GeneralUtility::makeInstance(SiteTcaConfiguration::class)->getTca()); @@ -205,14 +205,14 @@ class SiteConfigurationController throw new \RuntimeException('Either save or save and close', 1520370364); } - if (!isset($parsedBody['data']['sys_site']) || !is_array($parsedBody['data']['sys_site'])) { - throw new \RuntimeException('No sys_site data or sys_site identifier given', 1521030950); + if (!isset($parsedBody['data']['site']) || !is_array($parsedBody['data']['site'])) { + throw new \RuntimeException('No site data or site identifier given', 1521030950); } $data = $parsedBody['data']; // This can be NEW123 for new records - $pageId = (int)key($data['sys_site']); - $sysSiteRow = current($data['sys_site']); + $pageId = (int)key($data['site']); + $sysSiteRow = current($data['site']); $siteIdentifier = $sysSiteRow['identifier'] ?? ''; $isNewConfiguration = false; @@ -236,20 +236,20 @@ class SiteConfigurationController try { $newSysSiteData = []; - // Hard set rootPageId: This is TCA readOnly and not transmitted by FormEngine, but is also the "uid" of the sys_site record + // Hard set rootPageId: This is TCA readOnly and not transmitted by FormEngine, but is also the "uid" of the site record $newSysSiteData['site']['rootPageId'] = $pageId; foreach ($sysSiteRow as $fieldName => $fieldValue) { - $type = $siteTca['sys_site']['columns'][$fieldName]['config']['type']; + $type = $siteTca['site']['columns'][$fieldName]['config']['type']; if ($type === 'input') { - $fieldValue = $this->validateAndProcessValue('sys_site', $fieldName, $fieldValue); + $fieldValue = $this->validateAndProcessValue('site', $fieldName, $fieldValue); $newSysSiteData['site'][$fieldName] = $fieldValue; } elseif ($type === 'inline') { $newSysSiteData['site'][$fieldName] = []; $childRowIds = GeneralUtility::trimExplode(',', $fieldValue, true); - if (!isset($siteTca['sys_site']['columns'][$fieldName]['config']['foreign_table'])) { + if (!isset($siteTca['site']['columns'][$fieldName]['config']['foreign_table'])) { throw new \RuntimeException('No foreign_table found for inline type', 1521555037); } - $foreignTable = $siteTca['sys_site']['columns'][$fieldName]['config']['foreign_table']; + $foreignTable = $siteTca['site']['columns'][$fieldName]['config']['foreign_table']; foreach ($childRowIds as $childRowId) { $childRowData = []; if (!isset($data[$foreignTable][$childRowId])) { @@ -315,7 +315,7 @@ class SiteConfigurationController { $languageService = $this->getLanguageService(); // Normal "eval" processing of field first - $identifier = $this->validateAndProcessValue('sys_site', 'identifier', $identifier); + $identifier = $this->validateAndProcessValue('site', 'identifier', $identifier); if ($isNew) { // Verify no other site with this identifier exists. If so, find a new unique name as // identifier and show a flash message the identifier has been adapted diff --git a/typo3/sysext/backend/Classes/Controller/SiteInlineAjaxController.php b/typo3/sysext/backend/Classes/Controller/SiteInlineAjaxController.php index d732aeeeed9577bc8e54199baf02cb7d25ed3226..6d8a46ea891313c7f880f6c081c0a6db85a8c4cf 100644 --- a/typo3/sysext/backend/Classes/Controller/SiteInlineAjaxController.php +++ b/typo3/sysext/backend/Classes/Controller/SiteInlineAjaxController.php @@ -81,8 +81,8 @@ class SiteInlineAjaxController extends AbstractFormEngineAjaxController $childTableName = $parentConfig['foreign_table']; $defaultDatabaseRow = []; - if ($childTableName === 'sys_site_language') { - // Feed new sys_site_language row with data from sys_language record if possible + if ($childTableName === 'site_language') { + // Feed new site_language row with data from sys_language record if possible if ($childChildUid > 0) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_language'); $queryBuilder->getRestrictions()->removeByType(HiddenRestriction::class); diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php index b4f1a60558f2e2589409dcf14222904b991ca3bf..72f21af4fa60c9e288279e93d3c807e037517980 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php @@ -41,12 +41,12 @@ class SiteDatabaseEditRow implements FormDataProviderInterface $tableName = $result['tableName']; $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); - if ($tableName === 'sys_site') { + if ($tableName === 'site') { $siteConfigurationForPageUid = (int)$result['vanillaUid']; $rowData = $siteFinder->getSiteByRootPageId($siteConfigurationForPageUid)->getConfiguration(); $result['databaseRow']['uid'] = $rowData['rootPageId']; $result['databaseRow']['identifier'] = $result['customData']['siteIdentifier']; - } elseif ($tableName === 'sys_site_errorhandling' || $tableName === 'sys_site_language') { + } elseif ($tableName === 'site_errorhandling' || $tableName === 'site_language') { $siteConfigurationForPageUid = (int)($result['inlineTopMostParentUid'] ?? $result['inlineParentUid']); $rowData = $siteFinder->getSiteByRootPageId($siteConfigurationForPageUid)->getConfiguration(); $parentFieldName = $result['inlineParentFieldName']; diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaInline.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaInline.php index c4cf7d380a04782332d00c83bcaaf91ca693b3ab..3f1903f414880903c879931e9de578048195d670 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaInline.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaInline.php @@ -29,7 +29,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Special data provider for the sites configuration module. * - * Handle inline children of 'sys_site" + * Handle inline children of 'site' */ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataProviderInterface { @@ -47,7 +47,7 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr continue; } $childTableName = $fieldConfig['config']['foreign_table']; - if ($childTableName !== 'sys_site_errorhandling' && $childTableName !== 'sys_site_language') { + if ($childTableName !== 'site_errorhandling' && $childTableName !== 'site_language') { throw new \RuntimeException('Inline relation to other tables not implemented', 1522494737); } $result['processedTca']['columns'][$fieldName]['children'] = []; @@ -122,9 +122,9 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr } } - // If we are dealing with sys_site_language, we *always* force a relation to sys_language "0" + // If we are dealing with site_language, we *always* force a relation to sys_language "0" $foreignTable = $result['processedTca']['columns'][$fieldName]['config']['foreign_table']; - if ($foreignTable === 'sys_site_language' && $result['command'] === 'new') { + if ($foreignTable === 'site_language' && $result['command'] === 'new') { // If new, just add a new default child $child = $this->compileDefaultSysSiteLanguageChild($result, $fieldName); $connectedUids[] = $child['databaseRow']['uid']; @@ -141,8 +141,8 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr } } - // If we are dealing with sys_site_language, we *always* force a relation to sys_language "0" - if ($foreignTable === 'sys_site_language' && $result['command'] === 'edit') { + // If we are dealing with ite_language, we *always* force a relation to sys_language "0" + if ($foreignTable === 'site_language' && $result['command'] === 'edit') { // If edit, find out if a child using sys_language "0" exists, else add it on top $defaultSysSiteLanguageChildFound = false; foreach ($result['processedTca']['columns'][$fieldName]['children'] as $child) { @@ -264,7 +264,7 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr } /** - * Compile default sys_site_language child using sys_language uid "0" + * Compile default site_language child using sys_language uid "0" * * @param array $result * @param string $parentFieldName @@ -280,7 +280,7 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup); $formDataCompilerInput = [ 'command' => 'new', - 'tableName' => 'sys_site_language', + 'tableName' => 'site_language', 'vanillaUid' => $result['inlineFirstPid'], 'returnUrl' => $result['returnUrl'], 'isInlineChild' => true, diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaSelectItems.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaSelectItems.php index 548efdf02316ea4d8cc71aaf02938fa9100b388f..6b511f7f3277d8ab09e83aad7d651c98c5d98447 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaSelectItems.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/SiteTcaSelectItems.php @@ -29,7 +29,7 @@ class SiteTcaSelectItems implements FormDataProviderInterface { /** * Resolve select items for - * * 'sys_site_language' -> 'typo3language' + * * 'site_language' -> 'typo3language' * * @param array $result * @return array @@ -38,7 +38,7 @@ class SiteTcaSelectItems implements FormDataProviderInterface public function addData(array $result): array { $table = $result['tableName']; - if ($table !== 'sys_site_language') { + if ($table !== 'site_language') { return $result; } diff --git a/typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site.php b/typo3/sysext/backend/Configuration/SiteConfiguration/site.php similarity index 83% rename from typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site.php rename to typo3/sysext/backend/Configuration/SiteConfiguration/site.php index 834cfb3f6019697cb5ea992768883de6d4f827d7..ab4ae85627543f44fda3a2dcb6acc83b611feec5 100644 --- a/typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site.php +++ b/typo3/sysext/backend/Configuration/SiteConfiguration/site.php @@ -3,14 +3,14 @@ return [ 'ctrl' => [ 'label' => 'identifier', - 'title' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.ctrl.title', + 'title' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.ctrl.title', 'typeicon_classes' => [ 'default' => 'mimetypes-x-content-domain', ], ], 'columns' => [ 'identifier' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.identifier', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.identifier', 'config' => [ 'type' => 'input', 'size' => 35, @@ -26,7 +26,7 @@ return [ ], ], 'rootPageId' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.rootPageId', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.rootPageId', 'config' => [ 'type' => 'select', 'readOnly' => true, @@ -41,7 +41,7 @@ return [ ], ], 'base' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.base', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.base', 'config' => [ 'type' => 'input', 'eval' => 'required', @@ -53,10 +53,10 @@ return [ ], ], 'languages' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.languages', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.languages', 'config' => [ 'type' => 'inline', - 'foreign_table' => 'sys_site_language', + 'foreign_table' => 'site_language', 'foreign_selector' => 'languageId', 'foreign_unique' => 'languageId', 'size' => 4, @@ -69,10 +69,10 @@ return [ ], ], 'errorHandling' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.errorHandling', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.errorHandling', 'config' => [ 'type' => 'inline', - 'foreign_table' => 'sys_site_errorhandling', + 'foreign_table' => 'site_errorhandling', 'appearance' => [ 'enabledControls' => [ 'info' => false, @@ -84,8 +84,8 @@ return [ 'types' => [ '0' => [ 'showitem' => 'identifier, rootPageId, base, - --div--;LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.tab.languages, languages, - --div--;LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site.tab.errorHandling, errorHandling', + --div--;LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.tab.languages, languages, + --div--;LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.tab.errorHandling, errorHandling', ], ], ]; diff --git a/typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site_errorhandling.php b/typo3/sysext/backend/Configuration/SiteConfiguration/site_errorhandling.php similarity index 81% rename from typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site_errorhandling.php rename to typo3/sysext/backend/Configuration/SiteConfiguration/site_errorhandling.php index c90677310a2e908093b9eb9a69f24d426669d7c0..71e9ed5120ec3dcbb76597c73b8c98dc75f6fbd8 100644 --- a/typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site_errorhandling.php +++ b/typo3/sysext/backend/Configuration/SiteConfiguration/site_errorhandling.php @@ -3,7 +3,7 @@ return [ 'ctrl' => [ 'label' => 'errorCode', - 'title' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.ctrl.title', + 'title' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.ctrl.title', 'type' => 'errorHandler', 'typeicon_column' => 'errorHandler', 'typeicon_classes' => [ @@ -15,7 +15,7 @@ return [ ], 'columns' => [ 'errorCode' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorCode', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorCode', 'config' => [ 'type' => 'input', 'eval' => 'required, trim, int', @@ -27,12 +27,12 @@ return [ 'valuePicker' => [ 'mode' => '', 'items' => [ - ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorCode.404', '404'], - ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorCode.403', '403'], - ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorCode.401', '401'], - ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorCode.500', '500'], - ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorCode.503', '503'], - ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorCode.0', '0'], + ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorCode.404', '404'], + ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorCode.403', '403'], + ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorCode.401', '401'], + ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorCode.500', '500'], + ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorCode.503', '503'], + ['LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorCode.0', '0'], ], ], 'fieldInformation' => [ @@ -43,7 +43,7 @@ return [ ], ], 'errorHandler' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorHandler', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorHandler', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', @@ -61,7 +61,7 @@ return [ ], ], 'errorFluidTemplate' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorFluidTemplate', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorFluidTemplate', 'config' => [ 'type' => 'input', 'eval' => 'required', @@ -73,7 +73,7 @@ return [ ], ], 'errorFluidTemplatesRootPath' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorFluidTemplatesRootPath', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorFluidTemplatesRootPath', 'config' => [ 'type' => 'input', 'fieldInformation' => [ @@ -84,7 +84,7 @@ return [ ], ], 'errorFluidLayoutsRootPath' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorFluidLayoutsRootPath', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorFluidLayoutsRootPath', 'config' => [ 'type' => 'input', 'fieldInformation' => [ @@ -95,7 +95,7 @@ return [ ], ], 'errorFluidPartialsRootPath' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorFluidPartialsRootPath', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorFluidPartialsRootPath', 'config' => [ 'type' => 'input', 'fieldInformation' => [ @@ -106,7 +106,7 @@ return [ ], ], 'errorContentSource' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorContentSource', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorContentSource', 'config' => [ 'type' => 'input', 'renderType' => 'inputLink', @@ -126,7 +126,7 @@ return [ ], ], 'errorPhpClassFQCN' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.errorPhpClassFQCN', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.errorPhpClassFQCN', 'config' => [ 'type' => 'input', 'eval' => 'required', @@ -144,7 +144,7 @@ return [ ], 'Fluid' => [ 'showitem' => 'errorCode, errorHandler, errorFluidTemplate, - --div--;LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_errorhandling.tab.rootpaths, + --div--;LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_errorhandling.tab.rootpaths, errorFluidTemplatesRootPath, errorFluidLayoutsRootPath, errorFluidPartialsRootPath', ], 'Page' => [ diff --git a/typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site_language.php b/typo3/sysext/backend/Configuration/SiteConfiguration/site_language.php similarity index 95% rename from typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site_language.php rename to typo3/sysext/backend/Configuration/SiteConfiguration/site_language.php index db157ee0a66d94c2073839e51b57600f87667cc2..28caf8fda939c4bb3bd6a1b4a5413a7ca5453b26 100644 --- a/typo3/sysext/backend/Configuration/SiteConfigurationTCA/sys_site_language.php +++ b/typo3/sysext/backend/Configuration/SiteConfiguration/site_language.php @@ -3,14 +3,14 @@ return [ 'ctrl' => [ 'label' => 'languageId', - 'title' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.ctrl.title', + 'title' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.ctrl.title', 'typeicon_classes' => [ 'default' => 'mimetypes-x-content-domain', ], ], 'columns' => [ 'languageId' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.language', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.language', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', @@ -29,7 +29,7 @@ return [ ], ], 'title' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.title', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.title', 'config' => [ 'type' => 'input', 'size' => 10, @@ -43,7 +43,7 @@ return [ ], ], 'navigationTitle' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.navigationTitle', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.navigationTitle', 'config' => [ 'type' => 'input', 'size' => 10, @@ -56,7 +56,7 @@ return [ ], ], 'base' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.base', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.base', 'config' => [ 'type' => 'input', 'eval' => 'required', @@ -69,7 +69,7 @@ return [ ], ], 'locale' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.locale', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.locale', 'config' => [ 'type' => 'input', 'eval' => 'required', @@ -82,7 +82,7 @@ return [ ], ], 'iso-639-1' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.iso-639-1', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.iso-639-1', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', @@ -96,7 +96,7 @@ return [ ], ], 'hreflang' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.hreflang', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.hreflang', 'config' => [ 'type' => 'input', 'placeholder' => 'en-US', @@ -108,7 +108,7 @@ return [ ], ], 'direction' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.direction', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.direction', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', @@ -125,7 +125,7 @@ return [ ], ], 'typo3Language' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.typo3Language', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.typo3Language', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', @@ -140,7 +140,7 @@ return [ ], ], 'flag' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.flag', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.flag', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', @@ -412,7 +412,7 @@ return [ ], ], 'fallbackType' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.fallbackType', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.fallbackType', 'displayCond' => 'FIELD:languageId:>:0', 'onChange' => 'reload', 'config' => [ @@ -430,7 +430,7 @@ return [ ], ], 'fallbacks' => [ - 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:sys_site_language.fallbacks', + 'label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site_language.fallbacks', 'displayCond' => 'FIELD:fallbackType:=:fallback', 'config' => [ 'type' => 'select', diff --git a/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf b/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf index f3a5fd2a068dc6524e183e2572eda76c0d439305..a99d4ca776147c0157f6f7d9040044856adb0457 100644 --- a/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf +++ b/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf @@ -3,117 +3,117 @@ <file t3:id="1522785604" source-language="en" datatype="plaintext" original="messages" date="2018-02-27T22:22:32Z" product-name="backend"> <header/> <body> - <trans-unit id="sys_site.ctrl.title"> + <trans-unit id="site.ctrl.title"> <source>Site Configuration</source> </trans-unit> - <trans-unit id="sys_site.identifier"> + <trans-unit id="site.identifier"> <source>Site Identifier</source> </trans-unit> - <trans-unit id="sys_site.rootPageId"> + <trans-unit id="site.rootPageId"> <source>Root Page ID (You must create a page with a site root flag)</source> </trans-unit> - <trans-unit id="sys_site.base"> + <trans-unit id="site.base"> <source>Entry point (can be https://www.mydomain/ or just /, if it is just / you can not rely on TYPO3 creating full URLs)</source> </trans-unit> - <trans-unit id="sys_site.languages"> + <trans-unit id="site.languages"> <source>Available Languages for this site</source> </trans-unit> - <trans-unit id="sys_site.errorHandling"> + <trans-unit id="site.errorHandling"> <source>Error Handling</source> </trans-unit> - <trans-unit id="sys_site.tab.languages"> + <trans-unit id="site.tab.languages"> <source>Languages</source> </trans-unit> - <trans-unit id="sys_site.tab.errorHandling"> + <trans-unit id="site.tab.errorHandling"> <source>Error Handling</source> </trans-unit> - <trans-unit id="sys_site_language.ctrl.title"> + <trans-unit id="site_language.ctrl.title"> <source>Language Configuration for a Site</source> </trans-unit> - <trans-unit id="sys_site_language.language"> + <trans-unit id="site_language.language"> <source>Language</source> </trans-unit> - <trans-unit id="sys_site_language.title"> + <trans-unit id="site_language.title"> <source>Language title (e.g. "English")</source> </trans-unit> - <trans-unit id="sys_site_language.navigationTitle"> + <trans-unit id="site_language.navigationTitle"> <source>Navigation title (e.g. "English", "Deutsch", "Français")</source> </trans-unit> - <trans-unit id="sys_site_language.base"> + <trans-unit id="site_language.base"> <source>Entry point (either https://www.mydomain.fr/ or /fr/)</source> </trans-unit> - <trans-unit id="sys_site_language.locale"> + <trans-unit id="site_language.locale"> <source>Language locale</source> </trans-unit> - <trans-unit id="sys_site_language.iso-639-1"> + <trans-unit id="site_language.iso-639-1"> <source>Two letter ISO code</source> </trans-unit> - <trans-unit id="sys_site_language.hreflang"> + <trans-unit id="site_language.hreflang"> <source>Language tag defined by RFC 1766 / 3066 for "lang" and "hreflang" attributes</source> </trans-unit> - <trans-unit id="sys_site_language.direction"> + <trans-unit id="site_language.direction"> <source>Language direction for "dir" attribute</source> </trans-unit> - <trans-unit id="sys_site_language.typo3Language"> + <trans-unit id="site_language.typo3Language"> <source>Language key for XLF files</source> </trans-unit> - <trans-unit id="sys_site_language.flag"> + <trans-unit id="site_language.flag"> <source>Select flag icon</source> </trans-unit> - <trans-unit id="sys_site_language.fallbackType"> + <trans-unit id="site_language.fallbackType"> <source>Fallback type</source> </trans-unit> - <trans-unit id="sys_site_language.fallbacks"> + <trans-unit id="site_language.fallbacks"> <source>Fallback to other language(s) - order is important!</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.ctrl.title"> + <trans-unit id="site_errorhandling.ctrl.title"> <source>Error Handling</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.tab.rootpaths"> + <trans-unit id="site_errorhandling.tab.rootpaths"> <source>Root Paths (optional)</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode"> + <trans-unit id="site_errorhandling.errorCode"> <source>Error Status Code</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode.404"> + <trans-unit id="site_errorhandling.errorCode.404"> <source>404 (Page not found)</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode.403"> + <trans-unit id="site_errorhandling.errorCode.403"> <source>403 (Forbidden)</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode.401"> + <trans-unit id="site_errorhandling.errorCode.401"> <source>401 (Unauthorized)</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode.500"> + <trans-unit id="site_errorhandling.errorCode.500"> <source>500 (Internal Server Error)</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode.503"> + <trans-unit id="site_errorhandling.errorCode.503"> <source>503 (Service Unavailable)</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode.0"> + <trans-unit id="site_errorhandling.errorCode.0"> <source>any error not defined otherwise</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorHandler"> + <trans-unit id="site_errorhandling.errorHandler"> <source>How to handle errors</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorFluidTemplate"> + <trans-unit id="site_errorhandling.errorFluidTemplate"> <source>Fluid Template File</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorFluidTemplatesRootPath"> + <trans-unit id="site_errorhandling.errorFluidTemplatesRootPath"> <source>Fluid Templates Root Path</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorFluidLayoutsRootPath"> + <trans-unit id="site_errorhandling.errorFluidLayoutsRootPath"> <source>Fluid Layouts Root Path</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorFluidPartialsRootPath"> + <trans-unit id="site_errorhandling.errorFluidPartialsRootPath"> <source>Fluid Partials Root Path</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorContentSource"> + <trans-unit id="site_errorhandling.errorContentSource"> <source>Show Content From Page</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorPhpClassFQCN"> + <trans-unit id="site_errorhandling.errorPhpClassFQCN"> <source>ErrorHandler Class Target (FQCN)</source> </trans-unit> </body> diff --git a/typo3/sysext/backend/Resources/Private/Language/siteconfiguration_fieldinformation.xlf b/typo3/sysext/backend/Resources/Private/Language/siteconfiguration_fieldinformation.xlf index 4f3ae66cf59fe89c29ef27f020a92092e62a19a2..19bc4f57615cf4bb8201d81542ad600eaaf17e01 100644 --- a/typo3/sysext/backend/Resources/Private/Language/siteconfiguration_fieldinformation.xlf +++ b/typo3/sysext/backend/Resources/Private/Language/siteconfiguration_fieldinformation.xlf @@ -3,28 +3,28 @@ <file t3:id="1522923345" source-language="en" datatype="plaintext" original="messages" date="2015-01-02T11:16:11Z" product-name="backend"> <header/> <body> - <trans-unit id="sys_site.identifier"> + <trans-unit id="site.identifier"> <source>This name will be used to create the configuration directory. Mind the recommendations for directory names (only a-z,0-9,_,-) and make it unique.</source> </trans-unit> - <trans-unit id="sys_site.base"> + <trans-unit id="site.base"> <source>Main URL to call the frontend in default language.</source> </trans-unit> - <trans-unit id="sys_site_language.base"> + <trans-unit id="site_language.base"> <source>use / to use keep the main URL as configured at field Entry Point. Add language specific suffixes to use those, or configure complete URLs for independent domains.</source> </trans-unit> - <trans-unit id="sys_site_language.locale"> + <trans-unit id="site_language.locale"> <source>should be something like de_DE or en_US.UTF-8</source> </trans-unit> - <trans-unit id="sys_site_language.typo3Language"> + <trans-unit id="site_language.typo3Language"> <source>Select the language to be used from translation files. Keep default if no translation files are available.</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorCode"> + <trans-unit id="site_errorhandling.errorCode"> <source>make sure to have at least 0 (not defined otherwise) configured in order to serve helpful error messages to your visitors.</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorFluidTemplate"> + <trans-unit id="site_errorhandling.errorFluidTemplate"> <source>absolute or relative path (from site root) to fluid template file</source> </trans-unit> - <trans-unit id="sys_site_errorhandling.errorPhpClassFQCN"> + <trans-unit id="site_errorhandling.errorPhpClassFQCN"> <source>PHP class full qualified name that serves the error page.</source> </trans-unit> </body> diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/SiteDatabaseEditRowTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/SiteDatabaseEditRowTest.php index b01f82973bdaec15ac1e1815e6b126dd775bb797..2cc100c1c73c3750059ee26defef3fa6f4823b78 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/SiteDatabaseEditRowTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/SiteDatabaseEditRowTest.php @@ -76,7 +76,7 @@ class SiteDatabaseEditRowTest extends UnitTestCase { $input = [ 'command' => 'edit', - 'tableName' => 'sys_site', + 'tableName' => 'site', 'vanillaUid' => 23, 'customData' => [ 'siteIdentifier' => 'main', @@ -114,7 +114,7 @@ class SiteDatabaseEditRowTest extends UnitTestCase { $input = [ 'command' => 'edit', - 'tableName' => 'sys_site_errorhandling', + 'tableName' => 'site_errorhandling', 'vanillaUid' => 23, 'inlineTopMostParentUid' => 5, 'inlineParentFieldName' => 'invalid', @@ -140,7 +140,7 @@ class SiteDatabaseEditRowTest extends UnitTestCase { $input = [ 'command' => 'edit', - 'tableName' => 'sys_site_language', + 'tableName' => 'site_language', 'vanillaUid' => 23, 'inlineTopMostParentUid' => 5, 'inlineParentFieldName' => 'invalid', @@ -166,7 +166,7 @@ class SiteDatabaseEditRowTest extends UnitTestCase { $input = [ 'command' => 'edit', - 'tableName' => 'sys_site_language', + 'tableName' => 'site_language', 'vanillaUid' => 23, 'inlineTopMostParentUid' => 5, 'inlineParentFieldName' => 'languages', diff --git a/typo3/sysext/core/Classes/Site/Entity/SiteLanguage.php b/typo3/sysext/core/Classes/Site/Entity/SiteLanguage.php index f4092899afac2e675a0aeaf70eceb7432b588b31..ced7eb505cdd8b9ce479e59f8562f1c383f8d470 100644 --- a/typo3/sysext/core/Classes/Site/Entity/SiteLanguage.php +++ b/typo3/sysext/core/Classes/Site/Entity/SiteLanguage.php @@ -17,7 +17,7 @@ namespace TYPO3\CMS\Core\Site\Entity; */ /** - * Entity representing a sys_sitelanguage configuration of a site object. + * Entity representing a site_language configuration of a site object. */ class SiteLanguage { diff --git a/typo3/sysext/core/Documentation/Changelog/9.2/Feature-84581-SiteHandling.rst b/typo3/sysext/core/Documentation/Changelog/9.2/Feature-84581-SiteHandling.rst index f1d97d799c8defcc53765ab6dae5bbfc503f86da..fd3eea64f1313904fd226d611d61113791a75610 100644 --- a/typo3/sysext/core/Documentation/Changelog/9.2/Feature-84581-SiteHandling.rst +++ b/typo3/sysext/core/Documentation/Changelog/9.2/Feature-84581-SiteHandling.rst @@ -139,6 +139,54 @@ Root pages are identified by one of these two properties: * they have the "Use as Root Page" property in `pages` set to true. +Configuration +============= + +The new backend module relies on FormEngine to render the edit interface. Since the form data is not stored in +database records but in :file:`.yml` files, a couple of details have been extended of the default FormEngine code. + +The render configuration is stored in :file:`typo3/sysext/backend/Configuration/SiteConfiguration/` in a format +syntactically identical to TCA. However, this is **not** loaded into :php:`$GLOBALS['TCA']` scope, and only a small +subset of TCA features is supported. + +**Extending site configuration is experimental** and may change any time. + +In practice the configuration can be extended, but only with very simple fields like the basic config type :php:`input`, +and even for this one not all features are possible, for example the :php:`eval` options are limited. The code throws +exceptions or just ignores settings it does not support. While some of the limits may be relaxed a bit over time, many +will be kept. The goal is to allow developers to extend the site configuration with a couple of simple things like +an input field for a Google API key. However it is **not possible to extend with complex TCA** like inline relations, +database driven select fields, Flex Form handling and similar. + +The example below shows the experimental feature adding a field to site in an extensions file +:file:`Configuration/SiteConfiguration/Overrides/sites.php`. Note the helper methods of class +:php:`TYPO3\CMS\core\Utility\ExtensionManagementUtility` can not be used. + +.. code-block:: php + + <?php + // Experimental example to add a new field to the site configuration + + // Configure a new simple required input field to site + $GLOBALS['SiteConfiguration']['site']['columns']['myNewField'] = [ + 'label' => 'A new custom field', + 'config' => [ + 'type' => 'input', + 'eval' => 'required', + ], + ]; + // And add it to showitem + $GLOBALS['SiteConfiguration']['site']['types']['0']['showitem'] = str_replace( + 'base,', + 'base, myNewField, ', + $GLOBALS['SiteConfiguration']['site']['types']['0']['showitem'] + ); + +The field will be shown in the edit form of the configuration module and it's value stored in the .yml +file. Using the site object :php:`TYPO3\CMS\core\Site\Entity\Site`, the value can be fetched using +:php:`->getConfiguration()['myNewField']`. + + Impact ======