ILIAS  release_8 Revision v8.23
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
 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 = "" 
)

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

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

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)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilFileInputGUI::checkInput ( )

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

References Vendor\Package\$e, 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().

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 
169  $lng = $this->lng;
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)
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...
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 132 of file class.ilFileInputGUI.php.

Referenced by ilObjCourseGUI\initInfoEditor().

132  : void
133  {
134  $this->filename_selection = true;
135  $this->filename_post = $a_post_var;
136  }
+ Here is the caller graph for this function:

◆ getALlowDeletion()

ilFileInputGUI::getALlowDeletion ( )

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

References $allow_deletion.

Referenced by render().

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

◆ getDeletionFlag()

ilFileInputGUI::getDeletionFlag ( )

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

References ilFormPropertyGUI\getPostVar().

425  : bool
426  {
427  if ($this->int($this->getPostVar() . "_delete")) {
428  return true;
429  }
430  return false;
431  }
+ Here is the call graph for this function:

◆ getFilename()

ilFileInputGUI::getFilename ( )

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

References $filename.

Referenced by render().

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

◆ getFileNamePostVar()

ilFileInputGUI::getFileNamePostVar ( )

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

References $filename_post.

Referenced by render(), and setValueByArray().

143  : string
144  {
145  return $this->filename_post;
146  }
+ Here is the caller graph for this function:

◆ getForbiddenSuffixes()

ilFileInputGUI::getForbiddenSuffixes ( )

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

References $forbidden_suffixes.

115  : array
116  {
118  }

◆ getInput()

ilFileInputGUI::getInput ( )

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

References ilFormPropertyGUI\getPostVar().

264  : array
265  {
266  return $_FILES[$this->getPostVar()] ?? [];
267  }
+ Here is the call graph for this function:

◆ getMaxFileSizeString()

ilFileInputGUI::getMaxFileSizeString ( )
protected

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

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

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  }
+ 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 420 of file class.ilFileInputGUI.php.

Referenced by ilFileWizardInputGUI\insert().

420  : int
421  {
422  return (int) ini_get("max_file_uploads");
423  }
+ Here is the caller graph for this function:

◆ getPending()

ilFileInputGUI::getPending ( )

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

References $pending.

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

126  : string
127  {
128  return $this->pending;
129  }
+ Here is the caller graph for this function:

◆ getSize()

ilFileInputGUI::getSize ( )

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

References $size.

Referenced by render().

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

◆ getSuffixes()

ilFileInputGUI::getSuffixes ( )

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

References $suffixes.

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

105  : array
106  {
107  return $this->suffixes;
108  }
+ 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.

References render().

433  : string
434  {
435  $html = $this->render("toolbar");
436  return $html;
437  }
render(string $a_mode="")
+ Here is the call graph for this function:

◆ getValue()

ilFileInputGUI::getValue ( )

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

References $value.

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

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

◆ insert()

ilFileInputGUI::insert ( ilTemplate  $a_tpl)

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

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

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  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
render(string $a_mode="")
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ isFileNameSelectionEnabled()

ilFileInputGUI::isFileNameSelectionEnabled ( )

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

References $filename_selection.

Referenced by render().

138  : bool
139  {
141  }
+ 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.

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

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

366  : void {
367  $lng = $this->lng;
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  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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...
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
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 269 of file class.ilFileInputGUI.php.

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

Referenced by getToolbarHTML(), and insert().

269  : string
270  {
271  $lng = $this->lng;
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  }
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...
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 148 of file class.ilFileInputGUI.php.

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

148  : void
149  {
150  $this->allow_deletion = $a_val;
151  }
+ Here is the caller graph for this function:

◆ setFilename()

ilFileInputGUI::setFilename ( string  $a_val)

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

Referenced by checkInput(), and setValueByArray().

90  : void
91  {
92  $this->filename = $a_val;
93  }
+ 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.

Referenced by ilFileSystemGUI\listFiles().

79  : void
80  {
81  $this->size = $a_size;
82  }
+ Here is the caller graph for this function:

◆ setSuffixes()

ilFileInputGUI::setSuffixes ( array  $a_suffixes)

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

Referenced by ilImageFileInputGUI\__construct(), ilDidacticTemplateSettingsGUI\createImportForm(), ilObjHelpSettingsGUI\editSettings(), ilNewsItemGUI\getEditForm(), ilContentStyleImageGUI\getImageForm(), ilObjSurveyQuestionPoolGUI\getImportForm(), ilPCMediaObjectEditorGUI\getUploadForm(), ilObjMediaCastGUI\initAddCastItemForm(), ilPCInteractiveImageGUI\initAddOverlaysForm(), ilBadgeManagementGUI\initBadgeForm(), ilObjBibliographicGUI\initCreationForms(), ilObjBibliographicGUI\initEditForm(), ilOrgUnitTypeCustomIconsFormGUI\initForm(), ilStudyProgrammeTypeCustomIconsFormGUI\initForm(), ilObjectPluginGUI\initImportForm(), ilObjSurveyGUI\initImportForm(), ilObjectGUI\initImportForm(), ilAdvancedMDSettingsGUI\initImportForm(), ilObjQuestionPoolGUI\initImportForm(), ilObjTestGUI\initImportForm(), ilSkillRootGUI\initInputForm(), ilSkillProfileGUI\initInputForm(), ilExerciseManagementGUI\initMultiFeedbackForm(), ilPageLayoutAdministrationGUI\initPageLayoutImportForm(), ilChatroomAdminSmileyGUI\initSmiliesEditForm(), ilChatroomAdminSmileyGUI\initSmiliesForm(), ilMediaPoolImportGUI\initTranslationImportForm(), ilLMImportGUI\initTranslationImportForm(), ilObjUserFolderGUI\initUserImportForm(), ilExSubmissionFileGUI\initZipUploadForm(), ilObjMediaObjectGUI\setPropertiesSubTabs(), ilMobMultiSrtUploadGUI\uploadMultipleSubtitleFileForm(), and ilObjMediaObjectGUI\uploadMultipleSubtitleFileFormObject().

100  : void
101  {
102  $this->suffixes = $a_suffixes;
103  }
+ 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.

Referenced by setValueByArray().

69  : void
70  {
71  $this->value = $a_value;
72  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilFileInputGUI::setValueByArray ( array  $a_values)

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

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

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  }
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 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(), and ilImageFileInputGUI\insert().

◆ $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(), and ilFileWizardInputGUI\insert().


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