◆ __construct()
__construct |
( |
|
$fileref, |
|
|
|
$file = null |
|
) |
| |
StandardFile constructor.
- Parameters
-
| $fileref | |
null | $file | : (optional) Is set if fileref and file are both new and not connected with each other in the database. |
Implements StandardFileInterface.
◆ __get()
magic method for dynamic properties
◆ __isset()
magic method for dynamic properties
◆ __set()
magic method for dynamic properties
◆ addToFolder()
addToFolder |
( |
FolderType |
$standard_folder, |
|
|
|
$filename, |
|
|
|
$user_id = null |
|
) |
| |
◆ convertToStandardFile()
convertToStandardFile |
( |
| ) |
|
◆ create()
static create |
( |
|
$data, |
|
|
|
$user_id = null |
|
) |
| |
|
static |
Creates a prepared file with ids that could be added to a folder
- Parameters
-
array | $data | : ['name': "myfilename", 'type': "mime_type", 'size': "1234", 'tmp_name': "", 'error': null] |
null | string | $user_id | : the id of the user that should own the new file |
- Returns
- FileType|array : FileType (of called class) on success or an array with errors if an error occurred.
◆ delete()
Deletes that file.
- Returns
- bool : true on success
Implements FileType.
◆ getAccessibility()
Returns if a file is accessible or not.
- Returns
- bool
Implements FileType.
◆ getActionmenu()
◆ getAdditionalColumnOrderWeigh()
getAdditionalColumnOrderWeigh |
( |
|
$column_index | ) |
|
Returns an integer or text that marks the value the content of the given column should be ordered by.
- Parameters
-
- Returns
- mixed : order value
Implements FileType.
◆ getContentForAdditionalColumn()
getContentForAdditionalColumn |
( |
|
$column_index | ) |
|
Returns the content for that additional column, if it exists. You can return null a string or a Flexi as the content.
- Parameters
-
- Returns
- null|string|Flexi
Implements FileType.
◆ getDescription()
Returns the description of that FileType object.
- Returns
- string|null
Implements FileType.
◆ getDownloads()
Returns the number of downloads this file already has. Returns null if information is not available.
- Returns
- integer|null
Implements FileType.
◆ getDownloadURL()
Returns the URL to download the file. May be sendfile.php?... or an external link.
- Returns
- string|null
Implements FileType.
◆ getFilename()
Filename of the FileType-object.
- Returns
- mixed
Implements FileType.
◆ getFileRef()
◆ getFolderType()
◆ getIcon()
Returns the name of the icon shape that shall be used with the FileType implementation.
- Parameters
-
- Returns
- Icon icon for the FileType implementation.
Implements FileType.
◆ getId()
Returns the id of the file which is most likely the id of the FileRef object within the FileType object.
- Returns
- mixed
Implements FileType.
◆ getInfoDialogButtons()
getInfoDialogButtons |
( |
array |
$extra_link_params = [] | ) |
|
Returns a list of Stud.IP button objects that represent actions that shall be visible for the file type in the info dialog.
- Parameters
-
array | $extra_link_params | An optional array of URL parameters that should be added to Button URLs, if reasonable. The parameter names are the keys of the array while their values are also the array item values. |
- Returns
- Interactable[] A list of Stud.IP buttons (LinkButton or Button).
Implements FileType.
◆ getInfoTemplate()
getInfoTemplate |
( |
bool |
$include_downloadable_infos = false | ) |
|
Generates a Flexi containing additional information that are displayes in the information dialog of a file.
- Parameters
-
bool | $include_downloadable_infos | Whether to include information like file previews that can be downloaded (true) or to not include them (false). Defaults to false. |
- Returns
- Flexi|null Either a Flexi containing additional information or null if no such information shall be displayed in the information dialog.
Implements FileType.
◆ getLastChangeDate()
Returns the UNIX-Timestamp of the last change or null if this information is unknown.
- Returns
- integer|null
Implements FileType.
◆ getMakeDate()
Returns the UNIX-timestamp of creation of that file
- Returns
- integer|null
Implements FileType.
◆ getMimeType()
Returns the mime-type of that FileType-object.
- Returns
- string
Implements FileType.
◆ getPath()
Returns the (real) file system path for the file. This is only relevant for FileType implementations storing real files on the server disk. Other implementations shall just return an empty string.
- Returns
- The file system path for the file or an empty string if the file doesn't have a path in the file system.
Implements FileType.
◆ getSize()
Returns the size of the file in bytes. If this is null, the file doesn't exist physically - is probably only a weblink or a request for libraries.
- Returns
- integer|null
Implements FileType.
◆ getTermsOfUse()
◆ getUser()
- Returns
- The User object representing the author.
Implements FileType.
◆ getUserId()
The user_id in Stud.IP if the author has Stud.IP account. If it has none, return null.
- Returns
- mixed|null
Implements FileType.
◆ getUserName()
Return the name of the author as a string.
- Returns
- string|null
Implements FileType.
◆ isDownloadable()
isDownloadable |
( |
|
$user_id = null | ) |
|
Determines if a user may download the file.
- Parameters
-
string | $user_id | The user who wishes to download the file. |
- Returns
- boolean True, if the user is permitted to download the file, false otherwise.
Implements FileType.
◆ isEditable()
isEditable |
( |
|
$user_id = null | ) |
|
Determines if a user may edit the file.
- Parameters
-
string | $user_id | The user who wishes to edit the file. |
- Returns
- boolean True, if the user is permitted to edit the file, false otherwise.
Implements FileType.
◆ isVisible()
isVisible |
( |
|
$user_id = null | ) |
|
Determines whether the file is visible for a user.
- Parameters
-
string | $user_id | The user for which the visibility of the file shall be determined. |
- Returns
- boolean True, if the user is permitted to see the file, false otherwise.
Implements FileType.
◆ isWritable()
isWritable |
( |
|
$user_id = null | ) |
|
Determines if a user may write to the file.
- Parameters
-
string | $user_id | The user who wishes to write to the file. |
- Returns
- boolean True, if the user is permitted to write to the file, false otherwise.
Implements FileType.
◆ offsetExists()
ArrayAccess: Check whether the given offset exists.
◆ offsetGet()
ArrayAccess: Get the value at the given offset.
◆ offsetSet()
offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
ArrayAccess: Set the value at the given offset.
◆ offsetUnset()
ArrayAccess: unset the value at the given offset (not applicable)
◆ $file
◆ $fileref
The documentation for this class was generated from the following file: