‪TYPO3CMS  9.5
UserFunctions.php
Go to the documentation of this file.
1 <?php
2 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 
25 {
31  public function ‪getSiteLanguageTitle(array &$parameters): void
32  {
33  $record = $parameters['row'];
34  $parameters['title'] = sprintf(
35  '%s %s (%s) Base: %s',
36  $record['enabled'] ? '' : '[' . $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:disabled') . ']',
37  $record['title'],
38  $record['locale'],
39  $record['base']
40  );
41  }
42 
48  public function ‪getRouteTitle(array &$parameters): void
49  {
50  $record = $parameters['row'];
51  if ($record['type'][0] === 'uri') {
52  $parameters['title'] = sprintf(
53  '%s %s %s',
54  $record['route'],
55  $this->‪getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf:site.routes.irreHeader.redirectsTo'),
56  $record['source'] ?: '[' . $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:undefined') . ']'
57  );
58  } else {
59  $parameters['title'] = $record['route'];
60  }
61  }
62 
67  public function ‪getErrorHandlingTitle(array &$parameters): void
68  {
69  $record = $parameters['row'];
70  $format = '%s: %s';
71  $arguments = [$record['errorCode']];
72  switch ($record['errorHandler'][0]) {
73  case 'Fluid':
74  $arguments[] = $record['errorFluidTemplate'];
75  break;
76  case 'Page':
77  $arguments[] = $record['errorContentSource'];
78  break;
79  case 'PHP':
80  $arguments[] = $record['errorPhpClassFQCN'];
81  break;
82  default:
83  $arguments[] = $record['errorHandler'][0];
84  }
85  $parameters['title'] = sprintf($format, ...$arguments);
86  }
87 
92  {
93  return ‪$GLOBALS['LANG'];
94  }
95 }
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions
Definition: UserFunctions.php:25
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions\getLanguageService
‪LanguageService getLanguageService()
Definition: UserFunctions.php:91
‪$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:31
‪TYPO3\CMS\Backend\Configuration\TCA
Definition: UserFunctions.php:3
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions\getErrorHandlingTitle
‪getErrorHandlingTitle(array &$parameters)
Definition: UserFunctions.php:67
‪TYPO3\CMS\Backend\Configuration\TCA\UserFunctions\getRouteTitle
‪getRouteTitle(array &$parameters)
Definition: UserFunctions.php:48