‪TYPO3CMS  11.5
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 
21 
26 {
33  public static function resolveSpecialFolderNames(array $folders)
34  {
36  $lang = ‪$GLOBALS['LANG'];
38 
39  foreach ($folders as $folder) {
40  $name = $folder->getName();
41  ‪$role = $folder->getRole();
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 
53  }
54 }
‪TYPO3\CMS\Core\Resource\FolderInterface\ROLE_DEFAULT
‪const ROLE_DEFAULT
Definition: FolderInterface.php:26
‪TYPO3\CMS\Core\Resource\Utility\ListUtility\$resolvedFolders
‪if($role !==FolderInterface::ROLE_DEFAULT) $resolvedFolders[$name]
Definition: ListUtility.php:49
‪TYPO3\CMS\Core\Resource\Utility\ListUtility\$role
‪$role
Definition: ListUtility.php:41
‪TYPO3\CMS\Core\Resource\Utility
Definition: ListUtility.php:16
‪TYPO3\CMS\Core\Resource\Utility\ListUtility
Definition: ListUtility.php:26
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:37
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Resource\Utility\ListUtility\$resolvedFolders
‪return $resolvedFolders
Definition: ListUtility.php:52
‪TYPO3\CMS\Core\Resource\FolderInterface
Definition: FolderInterface.php:22
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42