‪TYPO3CMS  10.4
ListUtility.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
25 {
32  public static function ‪resolveSpecialFolderNames(array $folders)
33  {
35  $lang = ‪$GLOBALS['LANG'];
36  $resolvedFolders = [];
37 
39  foreach ($folders as $folder) {
40  $name = $folder->getName();
41  $role = $folder->getRole();
42  if ($role !== ‪FolderInterface::ROLE_DEFAULT) {
43  $tempName = htmlspecialchars($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_file.xlf:role_folder_' . $role));
44  if (!empty($tempName) && ($tempName !== $name)) {
45  // Set new name and append original name
46  $name = $tempName . ' (' . $name . ')';
47  }
48  }
49  $resolvedFolders[$name] = $folder;
50  }
51 
52  return $resolvedFolders;
53  }
54 }
‪TYPO3\CMS\Core\Resource\FolderInterface\ROLE_DEFAULT
‪const ROLE_DEFAULT
Definition: FolderInterface.php:26
‪TYPO3\CMS\Core\Resource\Utility
Definition: ListUtility.php:16
‪TYPO3\CMS\Core\Resource\Utility\ListUtility
Definition: ListUtility.php:25
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Resource\FolderInterface
Definition: FolderInterface.php:22
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Resource\Utility\ListUtility\resolveSpecialFolderNames
‪static array resolveSpecialFolderNames(array $folders)
Definition: ListUtility.php:32