Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
FileType Interface Reference
Inheritance diagram for FileType:
StandardFile UnknownFileType LibraryFile URLFile

Public Member Functions

 getIcon ($role)
 
 getId ()
 
 getFilename ()
 
 getUserId ()
 
 getUserName ()
 
 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 ( )

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

Returns
StandardFile

Implemented in StandardFile, and UnknownFileType.

delete ( )

Deletes that file.

Returns
bool : true on success

Implemented in StandardFile, and UnknownFileType.

getActionmenu ( )

Returns an instance of ActionMenu.

Returns
ActionMenu|null

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

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 (   $column_index)

Returns the content for that additional column, if it exists. You can return null a string or a Flexi_Template as the content.

Parameters
string$column_index
Returns
null|string|Flexi_Template

Implemented in StandardFile, and UnknownFileType.

getDescription ( )

Returns the description of that FileType object.

Returns
string|null

Implemented in StandardFile, and UnknownFileType.

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 ( )

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 ( )

Filename of the FileType-object.

Returns
mixed

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

getFolderType ( )

Returns the FolderTyp of the parent folder.

Returns
FolderType

Implemented in StandardFile, and UnknownFileType.

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 ( )

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 ( 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 ( bool  $include_downloadable_infos = false)

Generates a Flexi_Template 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_Template|null Either a Flexi_Template containing additional information or null if no such information shall be displayed in the information dialog.

Implemented in StandardFile, LibraryFile, UnknownFileType, and URLFile.

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 ( )

Returns the UNIX-timestamp of creation of that file

Returns
integer|null

Implemented in StandardFile, and UnknownFileType.

getMimeType ( )

Returns the mime-type of that FileType-object.

Returns
string

Implemented in StandardFile, UnknownFileType, and URLFile.

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 ( )

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 ( )
Returns
ContentTermsOfUse

Implemented in StandardFile, and UnknownFileType.

getUser ( )
Returns
The User object representing the author.

Implemented in StandardFile, and UnknownFileType.

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 ( )

Return the name of the author as a string.

Returns
string|null

Implemented in StandardFile, and UnknownFileType.

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 (   $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 (   $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 (   $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: