Stud.IP  6.0
ResourceFolder Class Reference
Inheritance diagram for ResourceFolder:
StandardFolder FolderType

Public Member Functions

 getIcon ($role=Icon::DEFAULT_ROLE)
 
 isVisible ($user_id)
 
 isReadable ($user_id)
 
 isWritable ($user_id)
 
 isEditable ($user_id)
 
 isSubfolderAllowed ($user_id)
 
 getSubfolder ()
 
 getEditTemplate ()
 
 setDataFromEditTemplate ($folderdata)
 
 createSubfolder (FolderType $foldertype)
 
 deleteSubfolder ($subfolder_id)
 
 isFileDownloadable ($file_ref_id, $user_id)
 
 isFileEditable ($file_ref_id, $user_id)
 
 isFileWritable ($file_ref_id, $user_id)
 
- Public Member Functions inherited from StandardFolder
 __construct ($folderdata=null)
 
 getIcon ($role=Icon::DEFAULT_ROLE)
 
 getId ()
 
 __get ($attribute)
 
 __set ($name, $value)
 
 isVisible ($user_id)
 
 isReadable ($user_id)
 
 isWritable ($user_id)
 
 isEditable ($user_id)
 
 isSubfolderAllowed ($user_id)
 
 getDescriptionTemplate ()
 
 getEditTemplate ()
 
 setDataFromEditTemplate ($request)
 
 store ()
 
 validateUpload (FileType $file, $user_id)
 
 getSubfolders ()
 
 getFiles ()
 
 getParent ()
 
 addFile (FileType $file, $user_id=null)
 
 deleteFile ($file_ref_id)
 
 createSubfolder (FolderType $foldertype)
 
 deleteSubfolder ($subfolder_id)
 
 delete ()
 
 isFileDownloadable ($fileref_or_id, $user_id)
 
 isFileEditable ($fileref_or_id, $user_id)
 
 isFileWritable ($fileref_or_id, $user_id)
 
 getRangeObject ()
 
 getAdditionalColumns ()
 
 getContentForAdditionalColumn ($column_index)
 
 getAdditionalColumnOrderWeigh ($column_index)
 
 getAdditionalActionButtons ()
 
 copySettings ()
 

Static Public Member Functions

static getTypeName ()
 
static availableInRange ($range_id_or_object, $user_id)
 
- Static Public Member Functions inherited from StandardFolder
static getTypeName ()
 
static availableInRange ($range_id_or_object, $user_id)
 

Additional Inherited Members

- Static Public Attributes inherited from StandardFolder
static $sorter = 0
 
- Protected Member Functions inherited from StandardFolder
 isVisibleNonRecursive ($user_id)
 
 getValidationMessages ($upload_type, $newfile)
 
- Protected Attributes inherited from StandardFolder
 $folderdata
 

Detailed Description

This is a folder type for files associated with Resource objects. Its purpose is to allow users to link or add relevant files to a Resource. An an example, one could attach a fire escape plan to a Building resource.

Member Function Documentation

◆ availableInRange()

static availableInRange (   $range_id_or_object,
  $user_id 
)
static

This method tells if the FolderType implementation can be created in a specific range type.

Some FolderType implementations aren't useful in conjunction with a specific range type. An FolderType implementation therefore must provide this method so that other parts of the file area system can easily check if folders of the FolderType implementation can be placed inside standard folders.

Parameters
string | Object$range_id_or_objectid or object of type "course", "user", "institute", "message"
string$user_id
Returns
boolean True, if creatable, false otherwise.

Implements FolderType.

◆ createSubfolder()

createSubfolder ( FolderType  $foldertype)
Parameters
$foldertypeFolderType
Returns
FolderType|null A FolderType instance representing the created subfolder or null on failure.

Implements FolderType.

◆ deleteSubfolder()

deleteSubfolder (   $subfolder_id)

Deletes a subfolder in this folder.

Parameters
string$subfolder_idThe ID of the subfolder that shall be deleted.
Returns
bool True on success, False on failure.

Implements FolderType.

◆ getEditTemplate()

getEditTemplate ( )

returns template form, must not contain opening and closing <form> tags

Returns
Flexi | string

Implements FolderType.

◆ getIcon()

getIcon (   $role = Icon::DEFAULT_ROLE)

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

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

Implements FolderType.

◆ getSubfolder()

getSubfolder ( )

◆ getTypeName()

static getTypeName ( )
static

Returns a human-friendly representation of the FolderType's name.

Returns
string A human-friendly name for the FolderType implementation.

Implements FolderType.

◆ isEditable()

isEditable (   $user_id)

Determines if a user may have edit permissions for the folder.

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

Implements FolderType.

◆ isFileDownloadable()

isFileDownloadable (   $file_ref_id,
  $user_id 
)

Determines if a user may download the file.

Parameters
string$file_ref_idThe ID of the FileRef object of a file that shall be downloaded.
string$user_idThe user who wishes to download the file.
Returns
boolean True, if the user is permitted to download the file, false otherwise.

Implements FolderType.

◆ isFileEditable()

isFileEditable (   $file_ref_id,
  $user_id 
)

Determines if a user may edit the file.

Parameters
string$file_ref_idThe ID of the FileRef object of a file that shall be edited.
string$user_idThe user who wishes to edit the file.
Returns
boolean True, if the user is permitted to edit the file, false otherwise.

Implements FolderType.

◆ isFileWritable()

isFileWritable (   $file_ref_id,
  $user_id 
)

Determines if a user may write to the file.

Parameters
string$file_idThe FileRef object of a file that shall be written.
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.

Implements FolderType.

◆ isReadable()

isReadable (   $user_id)

Determines if a user may read the content of the folder.

Parameters
string$user_idThe user who wishes to read the folder's content.
Returns
boolean True, if the user is permitted to read the folder, false otherwise.

Implements FolderType.

◆ isSubfolderAllowed()

isSubfolderAllowed (   $user_id)

Determines if a user may create a subfolder in this folder.

Parameters
string$user_idThe user who wishes to create a subfolder.
Returns
boolean True, if the user is permitted to create a subfolder, false otherwise.

Implements FolderType.

◆ isVisible()

isVisible (   $user_id)

Determines if a user may see the folder.

Parameters
$user_id
Returns
boolean

Implements FolderType.

◆ isWritable()

isWritable (   $user_id)

Determines if a user may have write permissions for the folder.

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

Implements FolderType.

◆ setDataFromEditTemplate()

setDataFromEditTemplate (   $folderdata)

gets data from edit form

Parameters
ArrayAccess | Request$folderdata
Returns
FolderType|MessageBox FolderType instance on success, a MessageBox object with an error message on failure.

Implements FolderType.


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