* @copyright 2016 Stud.IP Core-Group * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 * @category Stud.IP * * @property string user_id database column: owner of folder * @property string parent_id database column: parent folder * @property string range_id database column: user-ID, course-ID, institute-ID etc. * @property string range_type 'course', 'institute', 'user', ... * @property string name folder name * @property string mkdate unix timestamp * @property string chdate unix timestamp */ interface FolderType { /** * Returns a human-friendly representation of the FolderType's name. * * @return string A human-friendly name for the FolderType implementation. */ public static function getTypeName(); /** * 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. * * @param string|Object $range_id_or_object id or object of type "course", "user", "institute", "message" * @param string $user_id * @return boolean True, if creatable, false otherwise. */ public static function availableInRange($range_id_or_object, $user_id); /** * Returns the name of the icon shape that shall be used with the FolderType implementation. * * @param string $role role of icon * @return Icon icon for the FolderType implementation. */ public function getIcon($role); /** * Returns the ID of the folder that is managed from this FolderType instance. * @return string ID of the folder. */ public function getId(); /** * Determines if a user may see the folder. * * @param $user_id * @return boolean */ public function isVisible($user_id); /** * Determines if a user may read the content of the folder. * @param string $user_id The user who wishes to read the folder's content. * @return boolean True, if the user is permitted to read the folder, false otherwise. */ public function isReadable($user_id); /** * Determines if a user may have write permissions for the folder. * @param string $user_id The user who wishes to write into the folder. * @return boolean True, if the user is permitted to write into the folder, false otherwise. */ public function isWritable($user_id); /** * Determines if a user may have edit permissions for the folder. * @param string $user_id The user who wishes to edit the folder. * @return boolean True, if the user is permitted to edit the folder, false otherwise. */ public function isEditable($user_id); /** * Determines if a user may create a subfolder in this folder. * @param string $user_id The user who wishes to create a subfolder. * @return boolean True, if the user is permitted to create a subfolder, false otherwise. */ public function isSubfolderAllowed($user_id); /** * returns description of the folder * * @return Flexi_Template | string */ public function getDescriptionTemplate(); /** * Returns a list of subfolders of this folder. * @return FolderType[] List of folder objects */ public function getSubfolders(); /** * Returns a list of files of this folder. * @return FileRef[] List of FileRef objects */ public function getFiles(); /** * Returns the FolderType of the parent folder or null if this is the top folder. * @return null|FolderType */ public function getParent(); /** * returns template form, must not contain opening and closing