ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 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)
 
- 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...
 

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
 symbol ()
 
 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 = ""
 
FileUpload $upload_service
 
UploadLimitResolver $upload_limit
 
- 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 30 of file class.ilFileInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\lng(), ilFormPropertyGUI\setHiddenTitle(), and ilFormPropertyGUI\setType().

47  {
48  global $DIC;
49 
50  $this->lng = $DIC->language();
51  $this->lng->loadLanguageModule('form');
52 
53  $this->upload_service = $DIC->upload();
54  $this->upload_limit = $DIC['ui.upload_limit_resolver'];
55 
56  parent::__construct($a_title, $a_postvar);
57  $this->setType("file");
58  $this->setHiddenTitle("(" . $this->lng->txt("form_file_input") . ")");
59  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilFileInputGUI::checkInput ( )

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

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

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

◆ enableFileNameSelection()

ilFileInputGUI::enableFileNameSelection ( string  $a_post_var)

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

Referenced by ilObjCourseGUI\initInfoEditor().

137  : void
138  {
139  $this->filename_selection = true;
140  $this->filename_post = $a_post_var;
141  }
+ Here is the caller graph for this function:

◆ getALlowDeletion()

ilFileInputGUI::getALlowDeletion ( )

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

References $allow_deletion.

Referenced by render().

158  : bool
159  {
160  return $this->allow_deletion;
161  }
+ Here is the caller graph for this function:

◆ getDeletionFlag()

ilFileInputGUI::getDeletionFlag ( )

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

References ilFormPropertyGUI\getPostVar().

Referenced by checkInput().

400  : bool
401  {
402  if ($this->int($this->getPostVar() . "_delete")) {
403  return true;
404  }
405  return false;
406  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilename()

ilFileInputGUI::getFilename ( )

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

References $filename.

Referenced by render().

100  : string
101  {
102  return $this->filename;
103  }
+ Here is the caller graph for this function:

◆ getFileNamePostVar()

ilFileInputGUI::getFileNamePostVar ( )

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

References $filename_post.

Referenced by render(), and setValueByArray().

148  : string
149  {
150  return $this->filename_post;
151  }
+ Here is the caller graph for this function:

◆ getForbiddenSuffixes()

ilFileInputGUI::getForbiddenSuffixes ( )

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

References $forbidden_suffixes.

120  : array
121  {
123  }

◆ getInput()

ilFileInputGUI::getInput ( )

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

References ilFormPropertyGUI\getPostVar().

267  : array
268  {
269  return $_FILES[$this->getPostVar()];
270  }
+ Here is the call graph for this function:

◆ getMaxFileSizeString()

ilFileInputGUI::getMaxFileSizeString ( )
protected

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

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

386  : string
387  {
388  //format for display in mega-bytes
389  return sprintf("%.1f MB", $this->upload_limit->getPhpUploadLimitInBytes() / 1024 / 1024);
390  }
+ Here is the caller graph for this function:

◆ getMaxFileUploads()

ilFileInputGUI::getMaxFileUploads ( )
protected

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

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

Referenced by ilFileWizardInputGUI\insert().

395  : int
396  {
397  return (int) ini_get("max_file_uploads");
398  }
+ Here is the caller graph for this function:

◆ getPending()

ilFileInputGUI::getPending ( )

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

References $pending.

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

131  : string
132  {
133  return $this->pending;
134  }
+ Here is the caller graph for this function:

◆ getSize()

ilFileInputGUI::getSize ( )

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

References $size.

Referenced by render().

89  : int
90  {
91  return $this->size;
92  }
+ Here is the caller graph for this function:

◆ getSuffixes()

ilFileInputGUI::getSuffixes ( )

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

References $suffixes.

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

110  : array
111  {
112  return $this->suffixes;
113  }
+ 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 408 of file class.ilFileInputGUI.php.

References render().

408  : string
409  {
410  $html = $this->render("toolbar");
411  return $html;
412  }
render(string $a_mode="")
+ Here is the call graph for this function:

◆ getValue()

ilFileInputGUI::getValue ( )

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

References $value.

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

79  : string
80  {
81  return $this->value;
82  }
+ Here is the caller graph for this function:

◆ insert()

ilFileInputGUI::insert ( ilTemplate  $a_tpl)

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

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

357  : void
358  {
359  $html = $this->render();
360 
361  $a_tpl->setCurrentBlock("prop_generic");
362  $a_tpl->setVariable("PROP_GENERIC", $html);
363  $a_tpl->parseCurrentBlock();
364  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:546
render(string $a_mode="")
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ isFileNameSelectionEnabled()

ilFileInputGUI::isFileNameSelectionEnabled ( )

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

References $filename_selection.

Referenced by render().

143  : bool
144  {
146  }
+ Here is the caller graph for this function:

◆ outputSuffixes()

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

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

References getSuffixes(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

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

370  : void {
371  if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0) {
372  $suff_str = $delim = "";
373  foreach ($this->getSuffixes() as $suffix) {
374  $suff_str .= $delim . "." . $suffix;
375  $delim = ", ";
376  }
377  $a_tpl->setCurrentBlock($a_block);
378  $a_tpl->setVariable(
379  "TXT_ALLOWED_SUFFIXES",
380  $this->lng->txt("file_allowed_suffixes") . " " . $suff_str
381  );
382  $a_tpl->parseCurrentBlock();
383  }
384  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:546
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ 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 272 of file class.ilFileInputGUI.php.

References getALlowDeletion(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getFilename(), getFileNamePostVar(), getMaxFileSizeString(), getPending(), ilFormPropertyGUI\getPostVar(), getSize(), getValue(), isFileNameSelectionEnabled(), ILIAS\Repository\lng(), and outputSuffixes().

Referenced by getToolbarHTML(), and insert().

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

◆ setAllowDeletion()

ilFileInputGUI::setAllowDeletion ( bool  $a_val)

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

Referenced by ilObjCmiXapiGUI\initCreateForm(), ilBookingObjectGUI\initForm(), ilCalendarCategoryGUI\initImportForm(), and ilObjUserFolderGUI\initNewAccountMailForm().

153  : void
154  {
155  $this->allow_deletion = $a_val;
156  }
+ Here is the caller graph for this function:

◆ setFilename()

ilFileInputGUI::setFilename ( string  $a_val)

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

Referenced by checkInput(), and setValueByArray().

95  : void
96  {
97  $this->filename = $a_val;
98  }
+ Here is the caller graph for this function:

◆ setForbiddenSuffixes()

ilFileInputGUI::setForbiddenSuffixes ( array  $a_suffixes)

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

115  : void
116  {
117  $this->forbidden_suffixes = $a_suffixes;
118  }

◆ setPending()

ilFileInputGUI::setPending ( string  $a_val)

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

126  : void
127  {
128  $this->pending = $a_val;
129  }

◆ setSize()

ilFileInputGUI::setSize ( int  $a_size)

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

Referenced by ilFileSystemGUI\listFiles().

84  : void
85  {
86  $this->size = $a_size;
87  }
+ Here is the caller graph for this function:

◆ setSuffixes()

ilFileInputGUI::setSuffixes ( array  $a_suffixes)

◆ setValue()

ilFileInputGUI::setValue ( string  $a_value)

Set Value.

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

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

Referenced by setValueByArray().

74  : void
75  {
76  $this->value = $a_value;
77  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilFileInputGUI::setValueByArray ( array  $a_values)

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

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

61  : void
62  {
63  $value = $a_values[$this->getPostVar()] ?? null;
64  if (!is_array($value)) {
65  $this->setValue((string) $value);
66  }
67  $filenam = $a_values[$this->getFileNamePostVar()] ?? '';
68  $this->setFilename($filenam);
69  }
setFilename(string $a_val)
setValue(string $a_value)
Set Value.
+ 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 33 of file class.ilFileInputGUI.php.

Referenced by getFileNamePostVar().

◆ $filename_selection

bool ilFileInputGUI::$filename_selection = false
protected

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

Referenced by isFileNameSelectionEnabled().

◆ $forbidden_suffixes

array ilFileInputGUI::$forbidden_suffixes = []
protected

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

Referenced by getForbiddenSuffixes().

◆ $pending

string ilFileInputGUI::$pending = ""
protected

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

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

◆ $size

int ilFileInputGUI::$size = 40
protected

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

Referenced by getSize().

◆ $suffixes

array ilFileInputGUI::$suffixes = []
protected

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

Referenced by getSuffixes().

◆ $upload_limit

UploadLimitResolver ilFileInputGUI::$upload_limit
protected

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

◆ $upload_service

FileUpload ilFileInputGUI::$upload_service
protected

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

◆ $value

string ilFileInputGUI::$value = ""
protected

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

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


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