Stud.IP  5.4
URLFile Class Reference
Inheritance diagram for URLFile:
StandardFile FileType StandardFileInterface

Public Member Functions

 getIcon ($role)
 
 getFilename ()
 
 getSize ()
 
 getMimeType ()
 
 getDownloadURL ()
 
 getPath ()
 
 getActionmenu ()
 
 getInfoDialogButtons (array $extra_link_params=[])
 
 getInfoTemplate (bool $include_downloadable_infos=false)
 
- Public Member Functions inherited from StandardFile
 __construct ($fileref, $file=null)
 
 __get ($name)
 
 __set ($name, $value)
 
 __isset ($name)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIcon ($role)
 
 getId ()
 
 getFilename ()
 
 getUserId ()
 
 getUserName ()
 
 getAccessibility ()
 
 getUser ()
 
 getSize ()
 
 getMimeType ()
 
 getDownloadURL ()
 
 getDownloads ()
 
 getPath ()
 
 getLastChangeDate ()
 
 getMakeDate ()
 
 getDescription ()
 
 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 ()
 
 addToFolder (FolderType $standard_folder, $filename, $user_id=null)
 
 getFileRef ()
 
 getContentForAdditionalColumn ($column_index)
 
 getAdditionalColumnOrderWeigh ($column_index)
 
 getInfoTemplate (bool $include_downloadable_infos=false)
 

Static Public Member Functions

static create ($data, $user_id=null)
 
- Static Public Member Functions inherited from StandardFile
static create ($data, $user_id=null)
 

Additional Inherited Members

- Protected Attributes inherited from StandardFile
 $fileref = null
 
 $file = null
 

Member Function Documentation

◆ create()

static create (   $data,
  $user_id = null 
)
static
Parameters
array$data: ['name' => "myfile", 'access_type': "redirect|proxy", 'url': ""]
string | null$user_id: user-id of the user who should be owner of that file
Returns
array|FileType : the new File, which is already stored but not attached to a folder.

◆ getActionmenu()

getActionmenu ( )

Returns an instance of ActionMenu.

Returns
ActionMenu|null

Implements FileType.

◆ getDownloadURL()

getDownloadURL ( )

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

Returns
string|null

Implements FileType.

◆ getFilename()

getFilename ( )

Filename of the FileType-object.

Returns
mixed

Implements FileType.

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

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_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).

Implements FileType.

◆ getInfoTemplate()

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.

Implements FileType.

◆ getMimeType()

getMimeType ( )

Returns the mime-type of that FileType-object.

Returns
string

Implements FileType.

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

Implements FileType.

◆ 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

Implements FileType.


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