Stud.IP  5.4
StandardFolder Class Reference
Inheritance diagram for StandardFolder:
FolderType CourseGroupFolder CoursePublicFolder PublicFolder MessageFolder MVVFolder PermissionEnabledFolder PublicFolder ResourceFolder RootFolder

Public Member Functions

 __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 $newfile, $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 Attributes

static $sorter = 0
 

Protected Member Functions

 isVisibleNonRecursive ($user_id)
 
 getValidationMessages ($upload_type, $newfile)
 

Protected Attributes

 $folderdata
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $folderdata = null)

StandardFolder constructor.

Parameters
Folder | StandardFolder | null$folderdata

Member Function Documentation

◆ __get()

__get (   $attribute)
Parameters
string$attribute
Returns
mixed

◆ __set()

__set (   $name,
  $value 
)
Parameters
string$name
mixed$value
Returns
mixed

◆ addFile()

addFile ( FileType  $file,
  $user_id = null 
)

Adds FileType object to this folder and returns the new FileType object.

Parameters
FileType$file
$user_id: id of the given user
Returns
FileType

Implements FolderType.

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

◆ copySettings()

copySettings ( )

◆ createSubfolder()

createSubfolder ( FolderType  $foldertype)
Parameters
FolderType$foldertype
Returns
FolderType|null

Implements FolderType.

◆ delete()

delete ( )
Returns
int

Implements FolderType.

◆ deleteFile()

deleteFile (   $file_ref_id)
Parameters
string$file_ref_id
Returns
int

Implements FolderType.

◆ deleteSubfolder()

deleteSubfolder (   $subfolder_id)
Parameters
string$subfolder_id
Returns
bool

Implements FolderType.

◆ getAdditionalActionButtons()

getAdditionalActionButtons ( )

Returns an array of Studip or Studip objects that get displayed underneath the files-table.

Returns
array of Studip or Studip

Implements FolderType.

◆ getAdditionalColumnOrderWeigh()

getAdditionalColumnOrderWeigh (   $column_index)

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

Parameters
string$column_index
Returns
mixed : order value

Implements FolderType.

◆ getAdditionalColumns()

getAdditionalColumns ( )

Returns an associative array of additional colums with the index the id of the column and their values as the localized names of the columns

Returns
array('col1' => _("Anfragestatus"))

Implements FolderType.

◆ getContentForAdditionalColumn()

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

Implements FolderType.

◆ getDescriptionTemplate()

getDescriptionTemplate ( )
Returns
string|Flexi_Template

Implements FolderType.

◆ getEditTemplate()

getEditTemplate ( )
Returns
string|Flexi_Template

Implements FolderType.

◆ getFiles()

getFiles ( )
Returns
FileType[]

Implements FolderType.

◆ getIcon()

getIcon (   $role = Icon::DEFAULT_ROLE)
Parameters
string$role
Returns
Icon

Implements FolderType.

◆ getId()

getId ( )
Returns
string

Implements FolderType.

◆ getParent()

getParent ( )

Returns the parent-folder as a StandardFolder

Returns
FolderType

Implements FolderType.

◆ getRangeObject()

getRangeObject ( )

returns the object for the range_id of the folder

Returns
Course|Institute|User

◆ getSubfolders()

getSubfolders ( )
Returns
FolderType[]

Implements FolderType.

◆ getTypeName()

static getTypeName ( )
static
Returns
string

Implements FolderType.

◆ getValidationMessages()

getValidationMessages (   $upload_type,
  $newfile 
)
protected

◆ isEditable()

isEditable (   $user_id)
Parameters
string$user_id
Returns
bool

Implements FolderType.

◆ isFileDownloadable()

isFileDownloadable (   $fileref_or_id,
  $user_id 
)
Parameters
FileRef | string$fileref_or_id
string$user_id
Returns
bool

Implements FolderType.

◆ isFileEditable()

isFileEditable (   $fileref_or_id,
  $user_id 
)
Parameters
FileRef | string$fileref_or_id
string$user_id
Returns
bool

Implements FolderType.

◆ isFileWritable()

isFileWritable (   $fileref_or_id,
  $user_id 
)

Checks if a user has write permissions to a file.

For standard folders write permissions are granted if the user is the owner of the file or if the user has at least tutor permissions on the Stud.IP object specified by range_id (such objects may be courses or institutes for example).

Parameters
FileRef | string$fileref_or_id
string$user_id
Returns
bool

Implements FolderType.

◆ isReadable()

isReadable (   $user_id)
Parameters
string$user_id
Returns
bool

Implements FolderType.

◆ isSubfolderAllowed()

isSubfolderAllowed (   $user_id)
Parameters
string$user_id
Returns
bool

Implements FolderType.

◆ isVisible()

isVisible (   $user_id)
Parameters
string$user_id
Returns
bool

Implements FolderType.

◆ isVisibleNonRecursive()

isVisibleNonRecursive (   $user_id)
protected
Parameters
string$user_id
Returns
bool

◆ isWritable()

isWritable (   $user_id)
Parameters
string$user_id
Returns
bool

Implements FolderType.

◆ setDataFromEditTemplate()

setDataFromEditTemplate (   $request)
Parameters
array$request
Returns
FolderType|MessageBox

Implements FolderType.

◆ store()

store ( )
Returns
bool|number

Implements FolderType.

◆ validateUpload()

validateUpload ( FileType  $newfile,
  $user_id 
)
Parameters
FileType$newfile
string$user_id
Returns
string

Implements FolderType.

Field Documentation

◆ $folderdata

$folderdata
protected

◆ $sorter

$sorter = 0
static

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