Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?php
interface FileType
{
/**
* Returns the name of the icon shape that shall be used with the FileType implementation.
*
* @param string $role role of icon
* @return Icon icon for the FileType implementation.
*/
public function getIcon($role);
/**
* Returns the id of the file which is most likely the id of the FileRef object
* within the FileType object.
* @return mixed
*/
public function getId();
/**
* Filename of the FileType-object.
* @return mixed
*/
public function getFilename();
/**
* The user_id in Stud.IP if the author has Stud.IP account. If it has none, return null.
* @return mixed|null
*/
public function getUserId();
/**
* Return the name of the author as a string.
* @return string|null
*/
public function getUserName();
/**
* @returns The User object representing the author.
*/
public function getUser();
/**
* 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.
* @return integer|null
*/
public function getSize();
/**
* Returns the URL to download the file. May be sendfile.php?... or an external link.
* @return string|null
*/
public function getDownloadURL();
/**
* Returns the number of downloads this file already has. Returns null if information is not available.
* @return integer|null
*/
public function getDownloads();
/**
* 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.
*/
public function getPath() : string;
/**
* Returns the UNIX-Timestamp of the last change or null if this information is unknown.
* @return integer|null
*/
public function getLastChangeDate();
/**
* Returns the UNIX-timestamp of creation of that file
* @return integer|null
*/
public function getMakeDate();
/**
* Returns the description of that FileType object.
* @return string|null
*/
public function getDescription();
/**
* Returns the mime-type of that FileType-object.
* @return string
*/
public function getMimeType();
/**
* @return ContentTermsOfUse
*/
public function getTermsOfUse();
/**
* Returns an instance of ActionMenu.
* @return ActionMenu|null
*/
public function getActionmenu();
/**
* Returns a list of Stud.IP button objects that represent actions
* that shall be visible for the file type in the info dialog.
*
* @param array $extra_link_params An 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).
*/
public function getInfoDialogButtons(array $extra_link_params = []) : array;
/**
* Deletes that file.
* @return bool : true on success
*/
public function delete();
/**
* Returns the FolderTyp of the parent folder.
* @return FolderType
*/
public function getFolderType();
/**
* Determines whether the file is visible for a user.
*
* @param string $user_id The user for which the visibility of the file
* shall be determined.
*
* @return boolean True, if the user is permitted to see the file, false otherwise.
*/
public function isVisible($user_id = null);
/**
* Determines if a user may download the file.
* @param string $user_id The user who wishes to download the file.
* @return boolean True, if the user is permitted to download the file, false otherwise.
*/
public function isDownloadable($user_id = null);
/**
* Determines if a user may edit the file.
* @param string $user_id The user who wishes to edit the file.
* @return boolean True, if the user is permitted to edit the file, false otherwise.
*/
public function isEditable($user_id = null);
/**
* Determines if a user may write to the file.
* @param string $user_id The user who wishes to write to the file.
* @return boolean True, if the user is permitted to write to the file, false otherwise.
*/
public function isWritable($user_id = null);
/**
* Returns an object of the class StandardFile or a derived class.
* @return StandardFile
*/
public function convertToStandardFile();
/**
* Returns the content for that additional column, if it exists. You can return null a string
* or a Flexi_Template as the content.
* @param string $column_index
* @return null|string|Flexi_Template
*/
public function getContentForAdditionalColumn($column_index);
/**
* Returns an integer that marks the value the content of the given column should be
* ordered by.
* @param string $column_index
* @return integer : order value
*/
public function getAdditionalColumnOrderWeigh($column_index);
/**
* Generates a Flexi_Template containing additional information that are
* displayes in the information dialog of a file.
*
* @param bool $include_downloadable_infos Whether 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.
*/
public function getInfoTemplate(bool $include_downloadable_infos = false);
}