ILIAS  release_8 Revision v8.24
ilFileInputGUI Class Reference

This class represents a file property in a property form. More...

+ Inheritance diagram for ilFileInputGUI:
+ Collaboration diagram for ilFileInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 setValueByArray (array $a_values)
 
 setValue (string $a_value)
 Set Value. More...
 
 getValue ()
 
 setSize (int $a_size)
 
 getSize ()
 
 setFilename (string $a_val)
 
 getFilename ()
 
 setSuffixes (array $a_suffixes)
 
 getSuffixes ()
 
 setForbiddenSuffixes (array $a_suffixes)
 
 getForbiddenSuffixes ()
 
 setPending (string $a_val)
 
 getPending ()
 
 enableFileNameSelection (string $a_post_var)
 
 isFileNameSelectionEnabled ()
 
 getFileNamePostVar ()
 
 setAllowDeletion (bool $a_val)
 
 getALlowDeletion ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 render (string $a_mode="")
 
 insert (ilTemplate $a_tpl)
 
 getDeletionFlag ()
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Member Functions

 outputSuffixes (ilTemplate $a_tpl, string $a_block="allowed_suffixes")
 
 getMaxFileSizeString ()
 
 getMaxFileUploads ()
 Get number of maximum file uploads as declared in php.ini. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Protected Attributes

int $size = 40
 
string $pending = ""
 
bool $allow_deletion = false
 
bool $filename_selection = false
 
array $forbidden_suffixes = []
 
array $suffixes = []
 
string $value = ""
 
ILIAS FileUpload FileUpload $upload_service
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Private Attributes

string $filename = ""
 
string $filename_post = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 

Detailed Description

This class represents a file property in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file class.ilFileInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileInputGUI::__construct ( string  $a_title = "",
string  $a_postvar = "" 
)

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilFileWizardInputGUI, and ilImageFileInputGUI.

Definition at line 41 of file class.ilFileInputGUI.php.

44 {
45 global $DIC;
46
47 $this->lng = $DIC->language();
48 $lng = $DIC->language();
49 $this->upload_service = $DIC->upload();
50
51 parent::__construct($a_title, $a_postvar);
52 $this->setType("file");
53 $this->setHiddenTitle("(" . $lng->txt("form_file_input") . ")");
54 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilFormPropertyGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), ilFormPropertyGUI\setHiddenTitle(), ilFormPropertyGUI\setType(), and ilLanguage\txt().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilFileInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilImagemapCorrectionsInputGUI, ilImagemapFileInputGUI, and ilFileWizardInputGUI.

Definition at line 158 of file class.ilFileInputGUI.php.

158 : bool
159 {
160 if (!$this->upload_service->hasBeenProcessed()) {
161 try {
162 $this->upload_service->process();
163 } catch (IllegalStateException $e) {
164 $this->setAlert($e->getMessage());
165 return false;
166 }
167 }
168
170
171 // #18756
172 if ($this->getDisabled()) {
173 return true;
174 }
175
176 // if no information is received, something went wrong
177 // this is e.g. the case, if the post_max_size has been exceeded
178 if (!isset($_FILES[$this->getPostVar()]) || !is_array($_FILES[$this->getPostVar()])) {
179 $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
180 return false;
181 }
182
183 $_FILES[$this->getPostVar()]["name"] = ilUtil::stripSlashes($_FILES[$this->getPostVar()]["name"]);
184
185 $utf_normal = $this->refinery->string()->utfnormal()->formC();
186 $_FILES[$this->getPostVar()]["name"] = $utf_normal->transform(($_FILES[$this->getPostVar()]["name"]));
187
188 // remove trailing '/'
189 $_FILES[$this->getPostVar()]["name"] = rtrim($_FILES[$this->getPostVar()]["name"], '/');
190
191 $filename = $_FILES[$this->getPostVar()]["name"];
192 $filename_arr = pathinfo($_FILES[$this->getPostVar()]["name"]);
193 $suffix = $filename_arr["extension"] ?? '';
194 $temp_name = $_FILES[$this->getPostVar()]["tmp_name"];
195 $error = $_FILES[$this->getPostVar()]["error"];
196
197 // error handling
198 if ($error > 0) {
199 switch ($error) {
200 case UPLOAD_ERR_FORM_SIZE:
201 case UPLOAD_ERR_INI_SIZE:
202 $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
203 return false;
204
205 case UPLOAD_ERR_PARTIAL:
206 $this->setAlert($lng->txt("form_msg_file_partially_uploaded"));
207 return false;
208
209 case UPLOAD_ERR_NO_FILE:
210 if ($this->getRequired()) {
211 if (!strlen($this->getValue())) {
212 $this->setAlert($lng->txt("form_msg_file_no_upload"));
213 return false;
214 }
215 }
216 break;
217
218 case UPLOAD_ERR_NO_TMP_DIR:
219 $this->setAlert($lng->txt("form_msg_file_missing_tmp_dir"));
220 return false;
221
222 case UPLOAD_ERR_CANT_WRITE:
223 $this->setAlert($lng->txt("form_msg_file_cannot_write_to_disk"));
224 return false;
225
226 case UPLOAD_ERR_EXTENSION:
227 $this->setAlert($lng->txt("form_msg_file_upload_stopped_ext"));
228 return false;
229 }
230 }
231
232 // check suffixes
233 if ($_FILES[$this->getPostVar()]["tmp_name"] != "") {
234 if (is_array($this->forbidden_suffixes) && in_array(strtolower($suffix), $this->forbidden_suffixes)) {
235 $this->setAlert($lng->txt("form_msg_file_type_is_not_allowed") . " (" . $suffix . ")");
236 return false;
237 }
238 if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0) {
239 if (!in_array(strtolower($suffix), $this->getSuffixes())) {
240 $this->setAlert($lng->txt("form_msg_file_wrong_file_type"));
241 return false;
242 }
243 }
244 }
245
246 // virus handling
247 if ($_FILES[$this->getPostVar()]["tmp_name"] != "") {
248 $vir = ilVirusScanner::virusHandling($temp_name, $filename);
249 if ($vir[0] == false) {
250 $this->setAlert($lng->txt("form_msg_file_virus_found") . "<br />" . $vir[1]);
251 return false;
252 }
253 }
254
255 $file_name = $this->str('file_name');
256 if ($file_name === "") {
257 $file_name = $_FILES[$this->getPostVar()]["name"];
258 }
259 $this->setFilename($file_name);
260
261 return true;
262 }
setFilename(string $a_val)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)

References Vendor\Package\$e, $filename, ilFormPropertyGUI\$lng, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getSuffixes(), getValue(), ILIAS\Repository\refinery(), ilFormPropertyGUI\setAlert(), setFilename(), ilFormPropertyGUI\str(), ilUtil\stripSlashes(), ilLanguage\txt(), and ilVirusScanner\virusHandling().

+ Here is the call graph for this function:

◆ enableFileNameSelection()

ilFileInputGUI::enableFileNameSelection ( string  $a_post_var)

Definition at line 132 of file class.ilFileInputGUI.php.

132 : void
133 {
134 $this->filename_selection = true;
135 $this->filename_post = $a_post_var;
136 }

◆ getALlowDeletion()

ilFileInputGUI::getALlowDeletion ( )

Reimplemented in ilImageFileInputGUI.

Definition at line 153 of file class.ilFileInputGUI.php.

153 : bool
154 {
156 }

References $allow_deletion.

Referenced by render().

+ Here is the caller graph for this function:

◆ getDeletionFlag()

ilFileInputGUI::getDeletionFlag ( )

Reimplemented in ilImageFileInputGUI.

Definition at line 425 of file class.ilFileInputGUI.php.

425 : bool
426 {
427 if ($this->int($this->getPostVar() . "_delete")) {
428 return true;
429 }
430 return false;
431 }

◆ getFilename()

ilFileInputGUI::getFilename ( )

Definition at line 95 of file class.ilFileInputGUI.php.

95 : string
96 {
97 return $this->filename;
98 }

References $filename.

Referenced by render().

+ Here is the caller graph for this function:

◆ getFileNamePostVar()

ilFileInputGUI::getFileNamePostVar ( )

Definition at line 143 of file class.ilFileInputGUI.php.

143 : string
144 {
146 }

References $filename_post.

Referenced by render(), and setValueByArray().

+ Here is the caller graph for this function:

◆ getForbiddenSuffixes()

ilFileInputGUI::getForbiddenSuffixes ( )

Definition at line 115 of file class.ilFileInputGUI.php.

115 : array
116 {
118 }

References $forbidden_suffixes.

◆ getInput()

ilFileInputGUI::getInput ( )

Reimplemented in ilImagemapFileInputGUI.

Definition at line 264 of file class.ilFileInputGUI.php.

264 : array
265 {
266 return $_FILES[$this->getPostVar()] ?? [];
267 }

References ilFormPropertyGUI\getPostVar().

+ Here is the call graph for this function:

◆ getMaxFileSizeString()

ilFileInputGUI::getMaxFileSizeString ( )
protected

Definition at line 384 of file class.ilFileInputGUI.php.

384 : string
385 {
386 // get the value for the maximal uploadable filesize from the php.ini (if available)
387 $umf = ini_get("upload_max_filesize");
388 // get the value for the maximal post data from the php.ini (if available)
389 $pms = ini_get("post_max_size");
390
391 //convert from short-string representation to "real" bytes
392 $multiplier_a = array("K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024);
393
394 $umf_parts = preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
395 $pms_parts = preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
396
397 if (count($umf_parts) == 2) {
398 $umf = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
399 }
400 if (count($pms_parts) == 2) {
401 $pms = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
402 }
403
404 // use the smaller one as limit
405 $max_filesize = min($umf, $pms);
406
407 if (!$max_filesize) {
408 $max_filesize = max($umf, $pms);
409 }
410
411 //format for display in mega-bytes
412 $max_filesize = sprintf("%.1f MB", $max_filesize / 1024 / 1024);
413
414 return $max_filesize;
415 }

◆ getMaxFileUploads()

ilFileInputGUI::getMaxFileUploads ( )
protected

Get number of maximum file uploads as declared in php.ini.

Definition at line 420 of file class.ilFileInputGUI.php.

420 : int
421 {
422 return (int) ini_get("max_file_uploads");
423 }

Referenced by ilFileWizardInputGUI\insert().

+ Here is the caller graph for this function:

◆ getPending()

ilFileInputGUI::getPending ( )

Definition at line 126 of file class.ilFileInputGUI.php.

126 : string
127 {
128 return $this->pending;
129 }

References $pending.

Referenced by ilImageFileInputGUI\insert(), and render().

+ Here is the caller graph for this function:

◆ getSize()

ilFileInputGUI::getSize ( )

Definition at line 84 of file class.ilFileInputGUI.php.

84 : int
85 {
86 return $this->size;
87 }

References $size.

Referenced by render().

+ Here is the caller graph for this function:

◆ getSuffixes()

ilFileInputGUI::getSuffixes ( )

Definition at line 105 of file class.ilFileInputGUI.php.

105 : array
106 {
107 return $this->suffixes;
108 }

References $suffixes.

Referenced by ilImagemapFileInputGUI\checkInput(), checkInput(), ilFileWizardInputGUI\checkInput(), and outputSuffixes().

+ Here is the caller graph for this function:

◆ getToolbarHTML()

ilFileInputGUI::getToolbarHTML ( )

Get input item HTML to be inserted into ilToolbarGUI.

Implements ilToolbarItem.

Definition at line 433 of file class.ilFileInputGUI.php.

433 : string
434 {
435 $html = $this->render("toolbar");
436 return $html;
437 }
render(string $a_mode="")

◆ getValue()

ilFileInputGUI::getValue ( )

Definition at line 74 of file class.ilFileInputGUI.php.

74 : string
75 {
76 return $this->value;
77 }

References $value.

Referenced by ilImagemapFileInputGUI\checkInput(), checkInput(), ilImagemapCorrectionsInputGUI\insert(), ilImagemapFileInputGUI\insert(), ilImageFileInputGUI\insert(), and render().

+ Here is the caller graph for this function:

◆ insert()

ilFileInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented in ilImagemapCorrectionsInputGUI, ilImagemapFileInputGUI, ilFileWizardInputGUI, and ilImageFileInputGUI.

Definition at line 353 of file class.ilFileInputGUI.php.

353 : void
354 {
355 $html = $this->render();
356
357 $a_tpl->setCurrentBlock("prop_generic");
358 $a_tpl->setVariable("PROP_GENERIC", $html);
359 $a_tpl->parseCurrentBlock();
360 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)

References ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ isFileNameSelectionEnabled()

ilFileInputGUI::isFileNameSelectionEnabled ( )

Definition at line 138 of file class.ilFileInputGUI.php.

138 : bool
139 {
141 }

References $filename_selection.

Referenced by render().

+ Here is the caller graph for this function:

◆ outputSuffixes()

ilFileInputGUI::outputSuffixes ( ilTemplate  $a_tpl,
string  $a_block = "allowed_suffixes" 
)
protected

Definition at line 363 of file class.ilFileInputGUI.php.

366 : void {
368
369 if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0) {
370 $suff_str = $delim = "";
371 foreach ($this->getSuffixes() as $suffix) {
372 $suff_str .= $delim . "." . $suffix;
373 $delim = ", ";
374 }
375 $a_tpl->setCurrentBlock($a_block);
376 $a_tpl->setVariable(
377 "TXT_ALLOWED_SUFFIXES",
378 $lng->txt("file_allowed_suffixes") . " " . $suff_str
379 );
380 $a_tpl->parseCurrentBlock();
381 }
382 }

References ilFormPropertyGUI\$lng, getSuffixes(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

Referenced by ilImagemapFileInputGUI\insert(), ilFileWizardInputGUI\insert(), ilImageFileInputGUI\insert(), and render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

ilFileInputGUI::render ( string  $a_mode = "")

Definition at line 269 of file class.ilFileInputGUI.php.

269 : string
270 {
272
273 $quota_exceeded = $quota_legend = false;
274
275 $f_tpl = new ilTemplate("tpl.prop_file.html", true, true, "Services/Form");
276
277
278 // show filename selection if enabled
279 if ($this->isFileNameSelectionEnabled()) {
280 $f_tpl->setCurrentBlock('filename');
281 $f_tpl->setVariable('POST_FILENAME', $this->getFileNamePostVar());
282 $f_tpl->setVariable('VAL_FILENAME', $this->getFilename());
283 $f_tpl->setVariable('FILENAME_ID', $this->getFieldId());
284 $f_tpl->setVariable('TXT_FILENAME_HINT', $lng->txt('if_no_title_then_filename'));
285 $f_tpl->parseCurrentBlock();
286 } else {
287 if (trim($this->getValue()) != "") {
288 if (!$this->getDisabled() && $this->getALlowDeletion()) {
289 $f_tpl->setCurrentBlock("delete_bl");
290 $f_tpl->setVariable("POST_VAR_D", $this->getPostVar());
291 $f_tpl->setVariable(
292 "TXT_DELETE_EXISTING",
293 $lng->txt("delete_existing_file")
294 );
295 $f_tpl->parseCurrentBlock();
296 }
297
298 $f_tpl->setCurrentBlock('prop_file_propval');
299 $f_tpl->setVariable('FILE_VAL', $this->getValue());
300 $f_tpl->parseCurrentBlock();
301 }
302 }
303
304 if ($a_mode != "toolbar") {
305 if (!$quota_exceeded) {
306 $this->outputSuffixes($f_tpl);
307
308 $f_tpl->setCurrentBlock("max_size");
309 $f_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " .
310 $this->getMaxFileSizeString());
311 $f_tpl->parseCurrentBlock();
312
313 if ($quota_legend) {
314 $f_tpl->setVariable("TXT_MAX_SIZE", true);
315 $f_tpl->parseCurrentBlock();
316 }
317 } else {
318 $f_tpl->setCurrentBlock("max_size");
319 $f_tpl->setVariable("TXT_MAX_SIZE", $quota_exceeded);
320 $f_tpl->parseCurrentBlock();
321 }
322 } elseif ($quota_exceeded) {
323 return $quota_exceeded;
324 }
325
326 $pending = $this->getPending();
327 if ($pending) {
328 $f_tpl->setCurrentBlock("pending");
329 $f_tpl->setVariable("TXT_PENDING", $lng->txt("file_upload_pending") .
330 ": " . htmlentities($pending));
331 $f_tpl->parseCurrentBlock();
332 }
333
334 if ($this->getDisabled() || $quota_exceeded) {
335 $f_tpl->setVariable(
336 "DISABLED",
337 " disabled=\"disabled\""
338 );
339 }
340
341 $f_tpl->setVariable("POST_VAR", $this->getPostVar());
342 $f_tpl->setVariable("ID", $this->getFieldId());
343 $f_tpl->setVariable("SIZE", $this->getSize());
344
345
346 /* experimental: bootstrap'ed file upload */
347 $f_tpl->setVariable("TXT_BROWSE", $lng->txt("select_file"));
348
349
350 return $f_tpl->get();
351 }
outputSuffixes(ilTemplate $a_tpl, string $a_block="allowed_suffixes")
special template class to simplify handling of ITX/PEAR

References ilFormPropertyGUI\$lng, $pending, getALlowDeletion(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getFilename(), getFileNamePostVar(), getPending(), ilFormPropertyGUI\getPostVar(), getSize(), getValue(), isFileNameSelectionEnabled(), outputSuffixes(), and ilLanguage\txt().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAllowDeletion()

ilFileInputGUI::setAllowDeletion ( bool  $a_val)

Reimplemented in ilImageFileInputGUI.

Definition at line 148 of file class.ilFileInputGUI.php.

148 : void
149 {
150 $this->allow_deletion = $a_val;
151 }

◆ setFilename()

ilFileInputGUI::setFilename ( string  $a_val)

Definition at line 90 of file class.ilFileInputGUI.php.

90 : void
91 {
92 $this->filename = $a_val;
93 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setForbiddenSuffixes()

ilFileInputGUI::setForbiddenSuffixes ( array  $a_suffixes)

Definition at line 110 of file class.ilFileInputGUI.php.

110 : void
111 {
112 $this->forbidden_suffixes = $a_suffixes;
113 }

◆ setPending()

ilFileInputGUI::setPending ( string  $a_val)

Definition at line 121 of file class.ilFileInputGUI.php.

121 : void
122 {
123 $this->pending = $a_val;
124 }

◆ setSize()

ilFileInputGUI::setSize ( int  $a_size)

Definition at line 79 of file class.ilFileInputGUI.php.

79 : void
80 {
81 $this->size = $a_size;
82 }

◆ setSuffixes()

ilFileInputGUI::setSuffixes ( array  $a_suffixes)

Definition at line 100 of file class.ilFileInputGUI.php.

100 : void
101 {
102 $this->suffixes = $a_suffixes;
103 }

Referenced by ilImageFileInputGUI\__construct().

+ Here is the caller graph for this function:

◆ setValue()

ilFileInputGUI::setValue ( string  $a_value)

Set Value.

(used for displaying file title of existing file below input field)

Definition at line 69 of file class.ilFileInputGUI.php.

69 : void
70 {
71 $this->value = $a_value;
72 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilFileInputGUI::setValueByArray ( array  $a_values)

Reimplemented in ilImagemapCorrectionsInputGUI, and ilImagemapFileInputGUI.

Definition at line 56 of file class.ilFileInputGUI.php.

56 : void
57 {
58 $value = $a_values[$this->getPostVar()] ?? null;
59 if (!is_array($value)) {
60 $this->setValue((string) $value);
61 }
62 $filenam = $a_values[$this->getFileNamePostVar()] ?? '';
63 $this->setFilename($filenam);
64 }
setValue(string $a_value)
Set Value.

References $value, getFileNamePostVar(), ilFormPropertyGUI\getPostVar(), setFilename(), and setValue().

+ Here is the call graph for this function:

Field Documentation

◆ $allow_deletion

bool ilFileInputGUI::$allow_deletion = false
protected

◆ $filename

string ilFileInputGUI::$filename = ""
private

◆ $filename_post

string ilFileInputGUI::$filename_post = ""
private

Definition at line 31 of file class.ilFileInputGUI.php.

Referenced by getFileNamePostVar().

◆ $filename_selection

bool ilFileInputGUI::$filename_selection = false
protected

Definition at line 35 of file class.ilFileInputGUI.php.

Referenced by isFileNameSelectionEnabled().

◆ $forbidden_suffixes

array ilFileInputGUI::$forbidden_suffixes = []
protected

Definition at line 36 of file class.ilFileInputGUI.php.

Referenced by getForbiddenSuffixes().

◆ $pending

string ilFileInputGUI::$pending = ""
protected

Definition at line 33 of file class.ilFileInputGUI.php.

Referenced by getPending(), ilImageFileInputGUI\insert(), and render().

◆ $size

int ilFileInputGUI::$size = 40
protected

Definition at line 32 of file class.ilFileInputGUI.php.

Referenced by getSize().

◆ $suffixes

array ilFileInputGUI::$suffixes = []
protected

Definition at line 37 of file class.ilFileInputGUI.php.

Referenced by getSuffixes().

◆ $upload_service

ILIAS FileUpload FileUpload ilFileInputGUI::$upload_service
protected

Definition at line 39 of file class.ilFileInputGUI.php.

◆ $value

string ilFileInputGUI::$value = ""
protected

Definition at line 38 of file class.ilFileInputGUI.php.

Referenced by getValue(), ilFileWizardInputGUI\insert(), and setValueByArray().


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