TYPO3
7.6
|
Public Member Functions | |
__construct (ResourceStorage $storage, $identifier, $name) | |
getName () | |
getReadablePath ($rootId=null) | |
setName ($name) | |
getStorage () | |
getIdentifier () | |
getHashedIdentifier () | |
getCombinedIdentifier () | |
getPublicUrl ($relativeToCurrentScript=false) | |
getFiles ($start=0, $numberOfItems=0, $filterMode=self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive=false, $sort= '', $sortRev=false) | |
getFileCount (array $filterMethods=array(), $recursive=false) | |
getSubfolder ($name) | |
getSubfolders ($start=0, $numberOfItems=0, $filterMode=self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive=false) | |
addFile ($localFilePath, $fileName=null, $conflictMode=DuplicationBehavior::CANCEL) | |
addUploadedFile (array $uploadedFileData, $conflictMode=DuplicationBehavior::CANCEL) | |
rename ($newName) | |
delete ($deleteRecursively=true) | |
createFile ($fileName) | |
createFolder ($folderName) | |
copyTo (Folder $targetFolder, $targetFolderName=null, $conflictMode=DuplicationBehavior::RENAME) | |
moveTo (Folder $targetFolder, $targetFolderName=null, $conflictMode=DuplicationBehavior::RENAME) | |
hasFile ($name) | |
hasFolder ($name) | |
checkActionPermission ($action) | |
updateProperties (array $properties) | |
setFileAndFolderNameFilters (array $filters) | |
getRole () | |
getParentFolder () | |
Public Member Functions inherited from FolderInterface | |
getSubfolders () | |
delete () | |
Public Attributes | |
const | FILTER_MODE_NO_FILTERS = 0 |
const | FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS = 1 |
const | FILTER_MODE_USE_STORAGE_FILTERS = 2 |
const | FILTER_MODE_USE_OWN_FILTERS = 3 |
Public Attributes inherited from FolderInterface | |
const | ROLE_DEFAULT = 'default' |
const | ROLE_RECYCLER = 'recycler' |
const | ROLE_PROCESSING = 'processing' |
const | ROLE_TEMPORARY = 'temporary' |
const | ROLE_USERUPLOAD = 'userupload' |
const | ROLE_MOUNT = 'mount' |
const | ROLE_READONLY_MOUNT = 'readonly-mount' |
const | ROLE_USER_MOUNT = 'user-mount' |
Protected Member Functions | |
prepareFiltersInStorage ($filterMode) | |
restoreBackedUpFiltersInStorage ($backedUpFilters) | |
Protected Attributes | |
$storage | |
$identifier | |
$name | |
$fileAndFolderNameFilters = array() | |
A folder that groups files in a storage. This may be a folder on the local disk, a bucket in Amazon S3 or a user or a tag in Flickr.
This object is not persisted in TYPO3 locally, but created on the fly by storage drivers for the folders they "offer".
Some folders serve as a physical container for files (e.g. folders on the local disk, S3 buckets or Flickr users). Other folders just group files by a certain criterion, e.g. a tag. The way this is implemented depends on the storage driver.
Definition at line 31 of file core/Classes/Resource/Folder.php.
__construct | ( | ResourceStorage | $storage, |
$identifier, | |||
$name | |||
) |
Initialization of the folder
ResourceStorage | $storage | |
$identifier | ||
$name |
Definition at line 81 of file core/Classes/Resource/Folder.php.
References Folder\$identifier, Folder\$name, and Folder\$storage.
addFile | ( | $localFilePath, | |
$fileName = null , |
|||
$conflictMode = DuplicationBehavior::CANCEL |
|||
) |
Adds a file from the local server disk. If the file already exists and overwriting is disabled,
string | $localFilePath | |
string | $fileName | |
string | $conflictMode | a value of the enumeration |
Definition at line 281 of file core/Classes/Resource/Folder.php.
References PathUtility\basename().
Referenced by AbstractOnlineMediaHelper\createNewFile().
addUploadedFile | ( | array | $uploadedFileData, |
$conflictMode = DuplicationBehavior::CANCEL |
|||
) |
Adds an uploaded file into the Storage.
array | $uploadedFileData | contains information about the uploaded file given by $_FILES['file1'] |
string | $conflictMode | a value of the enumeration |
Definition at line 294 of file core/Classes/Resource/Folder.php.
checkActionPermission | ( | $action | ) |
Check if a file operation (= action) is allowed on this folder
string | $action | Action that can be read, write or delete |
Definition at line 397 of file core/Classes/Resource/Folder.php.
References Folder\getStorage().
Referenced by FolderUtilityRenderer\createFolder(), FileLinkHandler\expandFolder(), FileList\getButtonsAndOtherMarkers(), FileList\makeClip(), FileBrowser\renderFilesInFolder(), FolderBrowser\renderFolders(), InlineControlContainer\renderPossibleRecordsSelectorTypeGroupDB(), and FolderUtilityRenderer\uploadForm().
copyTo | ( | Folder | $targetFolder, |
$targetFolderName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Copies folder to a target folder
Folder | $targetFolder | Target folder to copy to. |
string | $targetFolderName | an optional destination fileName |
string | $conflictMode | a value of the enumeration |
Definition at line 351 of file core/Classes/Resource/Folder.php.
References Folder\getStorage().
createFile | ( | $fileName | ) |
Creates a new blank file
string | $fileName |
Definition at line 327 of file core/Classes/Resource/Folder.php.
createFolder | ( | $folderName | ) |
Creates a new folder
string | $folderName |
Definition at line 338 of file core/Classes/Resource/Folder.php.
delete | ( | $deleteRecursively = true | ) |
Deletes this folder from its storage. This also means that this object becomes useless.
bool | $deleteRecursively |
Definition at line 316 of file core/Classes/Resource/Folder.php.
getCombinedIdentifier | ( | ) |
Returns a combined identifier of this folder, i.e. the storage UID and the folder identifier separated by a colon ":".
Definition at line 172 of file core/Classes/Resource/Folder.php.
References Folder\getIdentifier(), and Folder\getStorage().
Referenced by FolderUtilityRenderer\createFolder(), FileLinkHandler\expandFolder(), FileList\getButtonsAndOtherMarkers(), ResourceStorage\isProcessingFolder(), FileList\linkWrapDir(), FolderBrowser\renderFolders(), and FolderUtilityRenderer\uploadForm().
getFileCount | ( | array | $filterMethods = array() , |
$recursive = false |
|||
) |
Returns amount of all files within this folder, optionally filtered by the given pattern
array | $filterMethods | |
bool | $recursive |
Exception\InsufficientFolderAccessPermissionsException |
Definition at line 235 of file core/Classes/Resource/Folder.php.
getFiles | ( | $start = 0 , |
|
$numberOfItems = 0 , |
|||
$filterMode = self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS , |
|||
$recursive = false , |
|||
$sort = '' , |
|||
$sortRev = false |
|||
) |
Returns a list of files in this folder, optionally filtered. There are several filter modes available, see the FILTER_MODE_* constants for more information.
For performance reasons the returned items can also be limited to a given range
int | $start | The item to start at |
int | $numberOfItems | The number of items to return |
int | $filterMode | The filter mode to use for the filelist. |
bool | $recursive | |
string | $sort | Property name used to sort the items. Among them may be: '' (empty, no sorting), name, fileext, size, tstamp and rw. If a driver does not support the given property, it should fall back to "name". |
bool | $sortRev | TRUE to indicate reverse sorting (last to first) |
Definition at line 209 of file core/Classes/Resource/Folder.php.
References Folder\prepareFiltersInStorage(), and Folder\restoreBackedUpFiltersInStorage().
getHashedIdentifier | ( | ) |
Get hashed identifier
Implements ResourceInterface.
Definition at line 161 of file core/Classes/Resource/Folder.php.
Referenced by AbstractOnlineMediaHelper\findExistingFileByOnlineMediaId().
getIdentifier | ( | ) |
Returns the path of this folder inside the storage. It depends on the type of storage whether this is a real path or just some unique identifier.
Implements ResourceInterface.
Definition at line 151 of file core/Classes/Resource/Folder.php.
References Folder\$identifier.
Referenced by ResourceStorage\addFile(), ResourceStorage\assureFileCopyPermissions(), ResourceStorage\assureFileMovePermissions(), ResourceStorage\countFilesInFolder(), ResourceStorage\countFoldersInFolder(), ResourceStorage\createFile(), FolderUtilityRenderer\createFolder(), FileLinkHandler\expandFolder(), ElementBrowserFolderTreeView\ext_isLinkable(), Folder\getCombinedIdentifier(), ResourceStorage\getFileInFolder(), ResourceStorage\getFilesInFolder(), ResourceStorage\getFolderInFolder(), ResourceStorage\getFoldersInFolder(), Folder\getParentFolder(), ResourceStorage\getUniqueName(), ResourceStorage\hasFileInFolder(), ResourceStorage\hasFolderInFolder(), ResourceStorage\isWithinFolder(), ResourceStorage\moveFolder(), FileBrowser\renderFilesInFolder(), and FolderUtilityRenderer\uploadForm().
getName | ( | ) |
Returns the name of this folder.
Implements ResourceInterface.
Definition at line 93 of file core/Classes/Resource/Folder.php.
References Folder\$name.
Referenced by ResourceStorage\assureFolderDeletePermission(), ResourceStorage\moveFolder(), and FolderBrowser\renderFolders().
getParentFolder | ( | ) |
Returns the parent folder.
In non-hierarchical storages, that always is the root folder.
The parent folder of the root folder is the root folder.
Implements ResourceInterface.
Definition at line 511 of file core/Classes/Resource/Folder.php.
References Folder\getIdentifier(), and Folder\getStorage().
Referenced by Folder\getReadablePath(), and ResourceStorage\moveFolder().
getPublicUrl | ( | $relativeToCurrentScript = false | ) |
Returns a publicly accessible URL for this folder
WARNING: Access to the folder may be restricted by further means, e.g. some web-based authentication. You have to take care of this yourself.
bool | $relativeToCurrentScript | Determines whether the URL returned should be relative to the current script, in case it is relative at all (only for the LocalDriver) |
Definition at line 186 of file core/Classes/Resource/Folder.php.
References Folder\getStorage().
getReadablePath | ( | $rootId = null | ) |
Returns the full path of this folder, from the root.
string | $rootId | ID of the root folder, NULL to auto-detect |
Definition at line 105 of file core/Classes/Resource/Folder.php.
References Folder\getParentFolder().
Referenced by FileList\getButtonsAndOtherMarkers(), and FileList\start().
getRole | ( | ) |
Returns the role of this folder (if any). See FolderInterface::ROLE_* constants for possible values.
Definition at line 497 of file core/Classes/Resource/Folder.php.
getStorage | ( | ) |
Returns the storage this folder belongs to.
Implements ResourceInterface.
Definition at line 140 of file core/Classes/Resource/Folder.php.
References Folder\$storage.
Referenced by ResourceStorage\assureFileCopyPermissions(), ResourceStorage\assureFileMovePermissions(), Folder\checkActionPermission(), Folder\copyTo(), AbstractFile\copyTo(), AbstractOnlineMediaHelper\findExistingFileByOnlineMediaId(), FileList\getButtonsAndOtherMarkers(), Folder\getCombinedIdentifier(), Folder\getParentFolder(), Folder\getPublicUrl(), ResourceStorage\isWithinFolder(), FileList\makeClip(), ResourceStorage\moveFolder(), Folder\moveTo(), and AbstractFile\moveTo().
getSubfolder | ( | $name | ) |
Returns the object for a subfolder of the current folder, if it exists.
string | $name | Name of the subfolder |
\InvalidArgumentException |
Implements FolderInterface.
Definition at line 247 of file core/Classes/Resource/Folder.php.
References Folder\$name.
getSubfolders | ( | $start = 0 , |
|
$numberOfItems = 0 , |
|||
$filterMode = self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS , |
|||
$recursive = false |
|||
) |
Returns a list of subfolders
int | $start | The item to start at |
int | $numberOfItems | The number of items to return |
int | $filterMode | The filter mode to use for the filelist. |
bool | $recursive |
Definition at line 264 of file core/Classes/Resource/Folder.php.
References Folder\prepareFiltersInStorage(), and Folder\restoreBackedUpFiltersInStorage().
Referenced by FolderLinkHandler\getFolderContent(), FolderTreeView\getNumberOfSubfolders(), and FolderBrowser\renderFolders().
hasFile | ( | $name | ) |
Checks if a file exists in this folder
string | $name |
Implements FolderInterface.
Definition at line 375 of file core/Classes/Resource/Folder.php.
References Folder\$name.
hasFolder | ( | $name | ) |
Checks if a folder exists in this folder.
string | $name |
Implements FolderInterface.
Definition at line 386 of file core/Classes/Resource/Folder.php.
References Folder\$name.
moveTo | ( | Folder | $targetFolder, |
$targetFolderName = null , |
|||
$conflictMode = DuplicationBehavior::RENAME |
|||
) |
Moves folder to a target folder
Folder | $targetFolder | Target folder to move to. |
string | $targetFolderName | an optional destination fileName |
string | $conflictMode | a value of the enumeration |
Definition at line 364 of file core/Classes/Resource/Folder.php.
References Folder\getStorage().
|
protected |
Prepares the filters in this folder's storage according to a set filter mode.
int | $filterMode | The filter mode to use; one of the FILTER_MODE_* constants |
Definition at line 432 of file core/Classes/Resource/Folder.php.
Referenced by Folder\getFiles(), and Folder\getSubfolders().
rename | ( | $newName | ) |
Renames this folder.
string | $newName |
Implements FolderInterface.
Definition at line 305 of file core/Classes/Resource/Folder.php.
|
protected |
Restores the filters of a storage.
array | $backedUpFilters | The filters to restore; might be NULL if no filters have been backed up, in which case this method does nothing. |
Definition at line 474 of file core/Classes/Resource/Folder.php.
Referenced by Folder\getFiles(), and Folder\getSubfolders().
setFileAndFolderNameFilters | ( | array | $filters | ) |
Sets the filters to use when listing files. These are only used if the filter mode is one of FILTER_MODE_USE_OWN_FILTERS and FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS
array | $filters |
Definition at line 487 of file core/Classes/Resource/Folder.php.
setName | ( | $name | ) |
Sets a new name of the folder currently this does not trigger the "renaming process" as the name is more seen as a label
string | $name | The new name |
Definition at line 130 of file core/Classes/Resource/Folder.php.
References Folder\$name.
updateProperties | ( | array | $properties | ) |
Updates the properties of this folder, e.g. after re-indexing or moving it.
NOTE: This method should not be called from outside the File Abstraction Layer (FAL)!
array | $properties |
Definition at line 415 of file core/Classes/Resource/Folder.php.
|
protected |
Definition at line 61 of file core/Classes/Resource/Folder.php.
|
protected |
Definition at line 47 of file core/Classes/Resource/Folder.php.
Referenced by Folder\__construct(), and Folder\getIdentifier().
|
protected |
Definition at line 54 of file core/Classes/Resource/Folder.php.
Referenced by Folder\__construct(), Folder\getName(), Folder\getSubfolder(), Folder\hasFile(), Folder\hasFolder(), and Folder\setName().
|
protected |
Definition at line 38 of file core/Classes/Resource/Folder.php.
Referenced by Folder\__construct(), and Folder\getStorage().
const FILTER_MODE_NO_FILTERS = 0 |
Modes for filter usage in getFiles()/getFolders()
Definition at line 66 of file core/Classes/Resource/Folder.php.
const FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS = 1 |
Definition at line 68 of file core/Classes/Resource/Folder.php.
Referenced by FileCollector\addFilesFromFolder(), and FolderBasedFileCollection\loadContents().
const FILTER_MODE_USE_OWN_FILTERS = 3 |
Definition at line 72 of file core/Classes/Resource/Folder.php.
const FILTER_MODE_USE_STORAGE_FILTERS = 2 |
Definition at line 70 of file core/Classes/Resource/Folder.php.