Stud.IP  4.2 Revision
FolderType Interface Reference
Inheritance diagram for FolderType:
Inheritance graph
Collaboration diagram for FolderType:
Collaboration graph

Public Member Functions

 getIcon ($role)
 
 getId ()
 
 isVisible ($user_id)
 
 isReadable ($user_id)
 
 isWritable ($user_id)
 
 isEditable ($user_id)
 
 isSubfolderAllowed ($user_id)
 
 getDescriptionTemplate ()
 
 getSubfolders ()
 
 getFiles ()
 
 getParent ()
 
 getEditTemplate ()
 
 setDataFromEditTemplate ($folderdata)
 
 validateUpload ($file, $user_id)
 
 createFile ($file)
 
 deleteFile ($file_ref_id)
 
 createSubfolder (FolderType $foldertype)
 
 deleteSubfolder ($subfolder_id)
 
 delete ()
 
 store ()
 
 isFileDownloadable ($file_ref_id, $user_id)
 
 isFileEditable ($file_ref_id, $user_id)
 
 isFileWritable ($file_ref_id, $user_id)
 

Static Public Member Functions

static getTypeName ()
 
static availableInRange ($range_id_or_object, $user_id)
 

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.

Implemented in MessageFolder, InboxOutboxFolder, VirtualFolderType, StandardFolder, UnknownFolderType, TimedFolder, CourseGroupFolder, CourseDateFolder, CoursePublicFolder, PublicFolder, HomeworkFolder, CourseTopicFolder, RootFolder, HiddenFolder, PermissionEnabledFolder, and MaterialFolder.

◆ createFile()

createFile (   $file)

This method is responsible for creating a file and the associated FileRef object.

Parameters
ArrayAccess | Array$fileData which are required to create a file.
Returns
File|MessageBox : File of the created file or MessageBox if an error occured

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, and InboxOutboxFolder.

Here is the caller graph for this function:

◆ createSubfolder()

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

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, and InboxOutboxFolder.

Here is the caller graph for this function:

◆ delete()

delete ( )

Deletes this folder.

Returns
bool True on success, False on failure.

Implemented in StandardFolder, MessageFolder, VirtualFolderType, InboxOutboxFolder, and UnknownFolderType.

Here is the caller graph for this function:

◆ deleteFile()

deleteFile (   $file_ref_id)

Deletes a file in this folder.

Parameters
string$file_ref_idThe ID of the FileRef object of the file that shall be deleted.
Returns
bool True on success, False on failure.

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, and InboxOutboxFolder.

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

Implemented in MessageFolder, StandardFolder, VirtualFolderType, InboxOutboxFolder, and UnknownFolderType.

◆ getDescriptionTemplate()

◆ getEditTemplate()

getEditTemplate ( )

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

Returns
Flexi_Template | string

Implemented in MessageFolder, StandardFolder, InboxOutboxFolder, VirtualFolderType, PublicFolder, UnknownFolderType, TimedFolder, CourseGroupFolder, PermissionEnabledFolder, HomeworkFolder, CourseDateFolder, CourseTopicFolder, HiddenFolder, and MaterialFolder.

◆ getFiles()

getFiles ( )

Returns a list of files of this folder.

Returns
FileRef[] List of FileRef objects

Implemented in StandardFolder, MessageFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, OutboxFolder, and InboxFolder.

Here is the caller graph for this function:

◆ getIcon()

getIcon (   $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.

Implemented in MessageFolder, CourseGroupFolder, TimedFolder, VirtualFolderType, PermissionEnabledFolder, StandardFolder, UnknownFolderType, InboxOutboxFolder, HomeworkFolder, CourseDateFolder, HiddenFolder, CourseTopicFolder, MaterialFolder, OutboxFolder, and InboxFolder.

◆ getId()

getId ( )

Returns the ID of the folder that is managed from this FolderType instance.

Returns
string ID of the folder.

Implemented in MessageFolder, StandardFolder, VirtualFolderType, InboxOutboxFolder, and UnknownFolderType.

Here is the caller graph for this function:

◆ getParent()

getParent ( )

Returns the FolderType of the parent folder or null if this is the top folder.

Returns
null|FolderType

Implemented in StandardFolder, MessageFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, and RootFolder.

Here is the caller graph for this function:

◆ getSubfolders()

getSubfolders ( )

Returns a list of subfolders of this folder.

Returns
FolderType[] List of folder objects

Implemented in StandardFolder, MessageFolder, VirtualFolderType, UnknownFolderType, and InboxOutboxFolder.

Here is the caller graph for this function:

◆ getTypeName()

static getTypeName ( )
static

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

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, and RootFolder.

Here is the caller graph for this function:

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

Implemented in StandardFolder, MessageFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, PermissionEnabledFolder, PublicFolder, and CoursePublicFolder.

Here is the caller graph for this function:

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

Implemented in StandardFolder, MessageFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, PublicFolder, and HomeworkFolder.

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

Implemented in StandardFolder, MessageFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, PublicFolder, and HomeworkFolder.

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

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, PublicFolder, PermissionEnabledFolder, CourseGroupFolder, and CoursePublicFolder.

Here is the caller graph for this function:

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

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, CourseGroupFolder, PermissionEnabledFolder, and HomeworkFolder.

Here is the caller graph for this function:

◆ isVisible()

isVisible (   $user_id)

Determines if a user may see the folder.

Parameters
$user_id
Returns
boolean

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, PermissionEnabledFolder, PublicFolder, CourseGroupFolder, TimedFolder, and CoursePublicFolder.

Here is the caller graph for this function:

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

Implemented in MessageFolder, StandardFolder, VirtualFolderType, UnknownFolderType, InboxOutboxFolder, CourseGroupFolder, PermissionEnabledFolder, and RootFolder.

Here is the caller graph for this function:

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

Implemented in MessageFolder, StandardFolder, InboxOutboxFolder, VirtualFolderType, PublicFolder, UnknownFolderType, TimedFolder, CourseGroupFolder, CourseDateFolder, and CourseTopicFolder.

◆ store()

store ( )
Returns
bool

Implemented in MessageFolder, VirtualFolderType, UnknownFolderType, StandardFolder, InboxOutboxFolder, and RootFolder.

Here is the caller graph for this function:

◆ validateUpload()

validateUpload (   $file,
  $user_id 
)

Validates a file upload.

Parameters
mixedfile The file to be validated.
string$user_idThe ID of the user who uploaded the file.

Implemented in MessageFolder, StandardFolder, InboxOutboxFolder, VirtualFolderType, UnknownFolderType, and PermissionEnabledFolder.

Here is the caller graph for this function:

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