‪TYPO3CMS  11.5
TYPO3\CMS\Backend\Tree\FileStorageTreeProvider Class Reference

Public Member Functions

 prepareFolderInformation (Folder $folder, ?string $alternativeName=null)
 
array getRootNodes (BackendUserAuthentication $user)
 
FolderInterface[] getFilteredTree (BackendUserAuthentication $user, string $search)
 
 getSubfoldersRecursively (Folder $folderObject, int $currentDepth)
 

Protected Member Functions

array getFoldersInStorage (ResourceStorage $resourceStorage, BackendUserAuthentication $user)
 
array array[] getMountsInStorage (ResourceStorage $resourceStorage, BackendUserAuthentication $user)
 
string getStateIdentifier (Folder $folder)
 
bool isExpanded (Folder $folder, bool $fallback=false)
 

Protected Attributes

array $expandedState = null
 
string $userSettingsIdentifier = 'BackendComponents.States.FileStorageTree'
 

Detailed Description

Responsible for fetching a tree-structure of folders.

not part of TYPO3 Core API due to the specific use case for the FileStorageTree component.

Definition at line 38 of file FileStorageTreeProvider.php.

Member Function Documentation

◆ getFilteredTree()

FolderInterface [] TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::getFilteredTree ( BackendUserAuthentication  $user,
string  $search 
)

Filter a tree by a search word

Parameters
BackendUserAuthentication$user
string$search
Returns
‪FolderInterface[]
Exceptions

Definition at line 140 of file FileStorageTreeProvider.php.

References TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getFileStorages(), TYPO3\CMS\Core\Resource\Folder\getParentFolder(), and TYPO3\CMS\Core\Resource\ResourceStorage\getProcessingFolders().

◆ getFoldersInStorage()

array TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::getFoldersInStorage ( ResourceStorage  $resourceStorage,
BackendUserAuthentication  $user 
)
protected

◆ getMountsInStorage()

array array [] TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::getMountsInStorage ( ResourceStorage  $resourceStorage,
BackendUserAuthentication  $user 
)
protected

Fetches all "root level folders" of a storage. If a user has filemounts in this storage, they are properly resolved.

Parameters
ResourceStorage$resourceStorage
BackendUserAuthentication$user
Returns
‪array|array[]

Definition at line 238 of file FileStorageTreeProvider.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getFileMounts(), TYPO3\CMS\Core\Resource\ResourceStorage\getName(), TYPO3\CMS\Core\Resource\ResourceStorage\getRootLevelFolder(), and TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isAdmin().

Referenced by TYPO3\CMS\Backend\Tree\FileStorageTreeProvider\getFoldersInStorage().

◆ getRootNodes()

array TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::getRootNodes ( BackendUserAuthentication  $user)

Fetch all file storages / file mounts visible for a user.

Parameters
BackendUserAuthentication$user
Returns
‪array

Definition at line 88 of file FileStorageTreeProvider.php.

References TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getFileStorages(), and TYPO3\CMS\Backend\Tree\FileStorageTreeProvider\getFoldersInStorage().

◆ getStateIdentifier()

string TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::getStateIdentifier ( Folder  $folder)
protected

The state identifier is the folder stored in the user settings, and also used to uniquely identify a folder throughout the folder tree structure.

Parameters
Folder$folder
Returns
‪string

Definition at line 268 of file FileStorageTreeProvider.php.

References TYPO3\CMS\Core\Resource\Folder\getIdentifier(), TYPO3\CMS\Core\Resource\Folder\getStorage(), and TYPO3\CMS\Core\Resource\ResourceStorage\getUid().

Referenced by TYPO3\CMS\Backend\Tree\FileStorageTreeProvider\isExpanded(), and TYPO3\CMS\Backend\Tree\FileStorageTreeProvider\prepareFolderInformation().

◆ getSubfoldersRecursively()

TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::getSubfoldersRecursively ( Folder  $folderObject,
int  $currentDepth 
)

◆ isExpanded()

bool TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::isExpanded ( Folder  $folder,
bool  $fallback = false 
)
protected

Checks if a folder was previously opened by the user.

Parameters
Folder$folder
bool$fallback
Returns
‪bool

Definition at line 280 of file FileStorageTreeProvider.php.

References TYPO3\CMS\Backend\Tree\FileStorageTreeProvider\getStateIdentifier().

Referenced by TYPO3\CMS\Backend\Tree\FileStorageTreeProvider\getFoldersInStorage(), and TYPO3\CMS\Backend\Tree\FileStorageTreeProvider\getSubfoldersRecursively().

◆ prepareFolderInformation()

Member Data Documentation

◆ $expandedState

array TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::$expandedState = null
protected

Definition at line 40 of file FileStorageTreeProvider.php.

◆ $userSettingsIdentifier

string TYPO3\CMS\Backend\Tree\FileStorageTreeProvider::$userSettingsIdentifier = 'BackendComponents.States.FileStorageTree'
protected

Definition at line 41 of file FileStorageTreeProvider.php.