‪TYPO3CMS  10.4
UserFunctions.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 
27 {
33  public function ‪getSiteLanguageTitle(array &$parameters): void
34  {
35  $record = $parameters['row'];
36  $parameters['title'] = sprintf(
37  '%s %s [%d] (%s) Base: %s',
38  $record['enabled'] ? '' : '[' . $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:disabled') . ']',
39  $record['title'],
40  $record['languageId'][0],
41  $record['locale'],
42  $record['base']
43  );
44  }
45 
51  public function ‪getRouteTitle(array &$parameters): void
52  {
53  $record = $parameters['row'];
54  if ($record['type'][0] === 'uri') {
55  $parameters['title'] = sprintf(
56  '%s %s %s',
57  $record['route'],
58  $this->‪getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.routes.irreHeader.redirectsTo'),
59  $record['source'] ?: '[' . $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:undefined') . ']'
60  );
61  } else {
62  $parameters['title'] = $record['route'];
63  }
64  }
65 
70  public function ‪getErrorHandlingTitle(array &$parameters): void
71  {
72  $record = $parameters['row'];
73  $format = '%s: %s';
74  $arguments = [$record['errorCode']];
75  switch ($record['errorHandler'][0]) {
76  case 'Fluid':
77  $arguments[] = $record['errorFluidTemplate'];
78  break;
79  case 'Page':
80  $arguments[] = $record['errorContentSource'];
81  break;
82  case 'PHP':
83  $arguments[] = $record['errorPhpClassFQCN'];
84  break;
85  default:
86  $arguments[] = $record['errorHandler'][0];
87  }
88  $parameters['title'] = sprintf($format, ...$arguments);
89  }
90 
95  {
96  return ‪$GLOBALS['LANG'];
97  }
98 }
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions
Definition: UserFunctions.php:27
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions\getLanguageService
‪LanguageService getLanguageService()
Definition: UserFunctions.php:94
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions\getSiteLanguageTitle
‪getSiteLanguageTitle(array &$parameters)
Definition: UserFunctions.php:33
‪TYPO3\CMS\Backend\Configuration\TCA
Definition: UserFunctions.php:18
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions\getErrorHandlingTitle
‪getErrorHandlingTitle(array &$parameters)
Definition: UserFunctions.php:70
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions\getRouteTitle
‪getRouteTitle(array &$parameters)
Definition: UserFunctions.php:51