Stud.IP  6.0
FileType Interface Reference
Inheritance diagram for FileType:
StandardFile UnknownFileType LibraryFile URLFile

Public Member Functions

 getIcon ($role)
 
 getId ()
 
 getFilename ()
 
 getUserId ()
 
 getUserName ()
 
 getAccessibility ()
 
 getUser ()
 
 getSize ()
 
 getDownloadURL ()
 
 getDownloads ()
 
 getPath ()
 
 getLastChangeDate ()
 
 getMakeDate ()
 
 getDescription ()
 
 getMimeType ()
 
 getTermsOfUse ()
 
 getActionmenu ()
 
 getInfoDialogButtons (array $extra_link_params=[])
 
 delete ()
 
 getFolderType ()
 
 isVisible ($user_id=null)
 
 isDownloadable ($user_id=null)
 
 isEditable ($user_id=null)
 
 isWritable ($user_id=null)
 
 convertToStandardFile ()
 
 getContentForAdditionalColumn ($column_index)
 
 getAdditionalColumnOrderWeigh ($column_index)
 
 getInfoTemplate (bool $include_downloadable_infos=false)
 

Member Function Documentation

◆ convertToStandardFile()

convertToStandardFile ( )

Returns an object of the class StandardFile or a derived class.

Returns
StandardFile

Implemented in StandardFile, and UnknownFileType.

◆ delete()

delete ( )

Deletes that file.

Returns
bool : true on success

Implemented in StandardFile, and UnknownFileType.

◆ getAccessibility()

getAccessibility ( )

Returns if a file is accessible or not.

Returns
bool

Implemented in UnknownFileType, and StandardFile.

◆ getActionmenu()

getActionmenu ( )

Returns an instance of ActionMenu.

Returns
ActionMenu|null

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ getAdditionalColumnOrderWeigh()

getAdditionalColumnOrderWeigh (   $column_index)

Returns an integer that marks the value the content of the given column should be ordered by.

Parameters
string$column_index
Returns
integer : order value

Implemented in StandardFile, and UnknownFileType.

◆ 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
string$column_index
Returns
null|string|Flexi

Implemented in StandardFile, and UnknownFileType.

◆ getDescription()

getDescription ( )

Returns the description of that FileType object.

Returns
string|null

Implemented in StandardFile, and UnknownFileType.

◆ getDownloads()

getDownloads ( )

Returns the number of downloads this file already has. Returns null if information is not available.

Returns
integer|null

Implemented in StandardFile, LibraryFile, and UnknownFileType.

◆ getDownloadURL()

getDownloadURL ( )

Returns the URL to download the file. May be sendfile.php?... or an external link.

Returns
string|null

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ getFilename()

getFilename ( )

Filename of the FileType-object.

Returns
mixed

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ getFolderType()

getFolderType ( )

Returns the FolderTyp of the parent folder.

Returns
FolderType

Implemented in StandardFile, and UnknownFileType.

◆ getIcon()

getIcon (   $role)

Returns the name of the icon shape that shall be used with the FileType implementation.

Parameters
string$rolerole of icon
Returns
Icon icon for the FileType implementation.

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ getId()

getId ( )

Returns the id of the file which is most likely the id of the FileRef object within the FileType object.

Returns
mixed

Implemented in StandardFile, and UnknownFileType.

◆ 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_paramsAn 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).

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ 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_infosWhether 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.

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ getLastChangeDate()

getLastChangeDate ( )

Returns the UNIX-Timestamp of the last change or null if this information is unknown.

Returns
integer|null

Implemented in StandardFile, and UnknownFileType.

◆ getMakeDate()

getMakeDate ( )

Returns the UNIX-timestamp of creation of that file

Returns
integer|null

Implemented in StandardFile, and UnknownFileType.

◆ getMimeType()

getMimeType ( )

Returns the mime-type of that FileType-object.

Returns
string

Implemented in StandardFile, UnknownFileType, and URLFile.

◆ getPath()

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.

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ getSize()

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

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

◆ getTermsOfUse()

getTermsOfUse ( )
Returns
ContentTermsOfUse

Implemented in StandardFile, and UnknownFileType.

◆ getUser()

getUser ( )
Returns
The User object representing the author.

Implemented in StandardFile, and UnknownFileType.

◆ getUserId()

getUserId ( )

The user_id in Stud.IP if the author has Stud.IP account. If it has none, return null.

Returns
mixed|null

Implemented in StandardFile, and UnknownFileType.

◆ getUserName()

getUserName ( )

Return the name of the author as a string.

Returns
string|null

Implemented in StandardFile, and UnknownFileType.

◆ isDownloadable()

isDownloadable (   $user_id = null)

Determines if a user may download the file.

Parameters
string$user_idThe user who wishes to download the file.
Returns
boolean True, if the user is permitted to download the file, false otherwise.

Implemented in StandardFile, and UnknownFileType.

◆ isEditable()

isEditable (   $user_id = null)

Determines if a user may edit the file.

Parameters
string$user_idThe user who wishes to edit the file.
Returns
boolean True, if the user is permitted to edit the file, false otherwise.

Implemented in StandardFile, LibraryFile, and UnknownFileType.

◆ isVisible()

isVisible (   $user_id = null)

Determines whether the file is visible for a user.

Parameters
string$user_idThe 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.

Implemented in StandardFile, and UnknownFileType.

◆ isWritable()

isWritable (   $user_id = null)

Determines if a user may write to the file.

Parameters
string$user_idThe user who wishes to write to the file.
Returns
boolean True, if the user is permitted to write to the file, false otherwise.

Implemented in StandardFile, and UnknownFileType.


The documentation for this interface was generated from the following file: