ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setSize ($a_size)
 Set Size. More...
 
 getSize ()
 Get Size. More...
 
 setFilename ($a_val)
 Set filename value (if filename selection is enabled) More...
 
 getFilename ()
 Get Value. More...
 
 setSuffixes ($a_suffixes)
 Set Accepted Suffixes. More...
 
 getSuffixes ()
 Get Accepted Suffixes. More...
 
 setForbiddenSuffixes ($a_suffixes)
 Set forbidden Suffixes. More...
 
 getForbiddenSuffixes ()
 Get Accepted Suffixes. More...
 
 setPending ($a_val)
 Set pending filename value. More...
 
 getPending ()
 Get pending filename. More...
 
 enableFileNameSelection ($a_post_var)
 If enabled, users get the possibility to enter a filename for the uploaded file. More...
 
 isFileNameSelectionEnabled ()
 Check if filename selection is enabled. More...
 
 getFileNamePostVar ()
 Get file name post var. More...
 
 setALlowDeletion ($a_val)
 Set allow deletion. More...
 
 getALlowDeletion ()
 Get allow deletion. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 render ($a_mode="")
 Render html. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 getDeletionFlag ()
 Get deletion flag. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 

Static Public Member Functions

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

Protected Member Functions

 outputSuffixes ($a_tpl, $a_block="allowed_suffixes")
 
 getMaxFileSizeString ()
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Protected Attributes

 $size = 40
 
 $pending
 
 $allow_deletion
 
 $forbidden_suffixes = array()
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Static Protected Attributes

static $check_wsp_quota
 

Private Attributes

 $filename
 
 $filename_post
 

Detailed Description

This class represents a file property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $lng, ilFormPropertyGUI\setHiddenTitle(), and ilFormPropertyGUI\setType().

36  {
37  global $lng;
38 
39  parent::__construct($a_title, $a_postvar);
40  $this->setType("file");
41  $this->setHiddenTitle("(".$lng->txt("form_file_input").")");
42  }
setType($a_type)
Set Type.
setHiddenTitle($a_val)
Set hidden title (for screenreaders)
global $lng
Definition: privfeed.php:17
+ 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.

Returns
boolean Input ok, true/false

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

References $_POST, $error, $filename, $lng, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getSuffixes(), getValue(), ilStr\normalizeUtf8String(), ilFormPropertyGUI\setAlert(), ilUtil\stripSlashes(), and ilUtil\virusHandling().

242  {
243  global $lng;
244 
245  // #18756
246  if($this->getDisabled())
247  {
248  return true;
249  }
250 
251  // if no information is received, something went wrong
252  // this is e.g. the case, if the post_max_size has been exceeded
253  if (!is_array($_FILES[$this->getPostVar()]))
254  {
255  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
256  return false;
257  }
258 
259  $_FILES[$this->getPostVar()]["name"] = ilUtil::stripSlashes($_FILES[$this->getPostVar()]["name"]);
260 
261  include_once("./Services/Utilities/classes/class.ilStr.php");
262  $_FILES[$this->getPostVar()]["name"] = ilStr::normalizeUtf8String($_FILES[$this->getPostVar()]["name"]);
263 
264  // remove trailing '/'
265  $_FILES[$this->getPostVar()]["name"] = rtrim($_FILES[$this->getPostVar()]["name"], '/');
266 
267  $filename = $_FILES[$this->getPostVar()]["name"];
268  $filename_arr = pathinfo($_FILES[$this->getPostVar()]["name"]);
269  $suffix = $filename_arr["extension"];
270  $mimetype = $_FILES[$this->getPostVar()]["type"];
271  $size_bytes = $_FILES[$this->getPostVar()]["size"];
272  $temp_name = $_FILES[$this->getPostVar()]["tmp_name"];
273  $error = $_FILES[$this->getPostVar()]["error"];
274  $_POST[$this->getPostVar()] = $_FILES[$this->getPostVar()];
275 
276  // error handling
277  if ($error > 0)
278  {
279  switch ($error)
280  {
281  case UPLOAD_ERR_INI_SIZE:
282  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
283  return false;
284  break;
285 
286  case UPLOAD_ERR_FORM_SIZE:
287  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
288  return false;
289  break;
290 
291  case UPLOAD_ERR_PARTIAL:
292  $this->setAlert($lng->txt("form_msg_file_partially_uploaded"));
293  return false;
294  break;
295 
296  case UPLOAD_ERR_NO_FILE:
297  if ($this->getRequired())
298  {
299  if (!strlen($this->getValue()))
300  {
301  $this->setAlert($lng->txt("form_msg_file_no_upload"));
302  return false;
303  }
304  }
305  break;
306 
307  case UPLOAD_ERR_NO_TMP_DIR:
308  $this->setAlert($lng->txt("form_msg_file_missing_tmp_dir"));
309  return false;
310  break;
311 
312  case UPLOAD_ERR_CANT_WRITE:
313  $this->setAlert($lng->txt("form_msg_file_cannot_write_to_disk"));
314  return false;
315  break;
316 
317  case UPLOAD_ERR_EXTENSION:
318  $this->setAlert($lng->txt("form_msg_file_upload_stopped_ext"));
319  return false;
320  break;
321  }
322  }
323 
324  // check suffixes
325  if ($_FILES[$this->getPostVar()]["tmp_name"] != "")
326  {
327  if (is_array($this->forbidden_suffixes) && in_array(strtolower($suffix), $this->forbidden_suffixes))
328  {
329  $this->setAlert($lng->txt("form_msg_file_type_is_not_allowed")." (".$suffix.")");
330  return false;
331  }
332  if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0)
333  {
334  if (!in_array(strtolower($suffix), $this->getSuffixes()))
335  {
336  $this->setAlert($lng->txt("form_msg_file_wrong_file_type"));
337  return false;
338  }
339  }
340  }
341 
342  // virus handling
343  if ($_FILES[$this->getPostVar()]["tmp_name"] != "")
344  {
345  $vir = ilUtil::virusHandling($temp_name, $filename);
346  if ($vir[0] == false)
347  {
348  $this->setAlert($lng->txt("form_msg_file_virus_found")."<br />".$vir[1]);
349  return false;
350  }
351  }
352 
353  return true;
354  }
getSuffixes()
Get Accepted Suffixes.
$error
Definition: Error.php:17
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
getPostVar()
Get Post Variable.
static normalizeUtf8String($a_str)
Normalize UTF8 string.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ enableFileNameSelection()

ilFileInputGUI::enableFileNameSelection (   $a_post_var)

If enabled, users get the possibility to enter a filename for the uploaded file.

public

Parameters
stringpost variable

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

188  {
189  $this->filename_selection = true;
190  $this->filename_post = $a_post_var;
191  }

◆ getALlowDeletion()

ilFileInputGUI::getALlowDeletion ( )

Get allow deletion.

Returns
boolean allow deletion

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

References $allow_deletion.

Referenced by render().

232  {
233  return $this->allow_deletion;
234  }
+ Here is the caller graph for this function:

◆ getDeletionFlag()

ilFileInputGUI::getDeletionFlag ( )

Get deletion flag.

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

References $_POST, and ilFormPropertyGUI\getPostVar().

531  {
532  if ($_POST[$this->getPostVar()."_delete"])
533  {
534  return true;
535  }
536  return false;
537  }
getPostVar()
Get Post Variable.
$_POST["username"]
+ Here is the call graph for this function:

◆ getFilename()

ilFileInputGUI::getFilename ( )

Get Value.

Returns
string Value

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

References $filename.

Referenced by render().

114  {
115  return $this->filename;
116  }
+ Here is the caller graph for this function:

◆ getFileNamePostVar()

ilFileInputGUI::getFileNamePostVar ( )

Get file name post var.

public

Parameters
stringfile name post var

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

References $filename_post.

Referenced by render(), and setValueByArray().

212  {
213  return $this->filename_post;
214  }
+ Here is the caller graph for this function:

◆ getForbiddenSuffixes()

ilFileInputGUI::getForbiddenSuffixes ( )

Get Accepted Suffixes.

Returns
array forbidden Suffixes

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

References $forbidden_suffixes.

156  {
158  }

◆ getMaxFileSizeString()

ilFileInputGUI::getMaxFileSizeString ( )
protected

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

References array.

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

501  {
502  // get the value for the maximal uploadable filesize from the php.ini (if available)
503  $umf = ini_get("upload_max_filesize");
504  // get the value for the maximal post data from the php.ini (if available)
505  $pms = ini_get("post_max_size");
506 
507  //convert from short-string representation to "real" bytes
508  $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
509 
510  $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
511  $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
512 
513  if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
514  if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
515 
516  // use the smaller one as limit
517  $max_filesize = min($umf, $pms);
518 
519  if (!$max_filesize) $max_filesize=max($umf, $pms);
520 
521  //format for display in mega-bytes
522  $max_filesize = sprintf("%.1f MB",$max_filesize/1024/1024);
523 
524  return $max_filesize;
525  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getPending()

ilFileInputGUI::getPending ( )

Get pending filename.

Returns
string Value

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

References $pending.

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

176  {
177  return $this->pending;
178  }
+ Here is the caller graph for this function:

◆ getSize()

ilFileInputGUI::getSize ( )

Get Size.

Returns
int Size

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

References $size.

Referenced by render().

94  {
95  return $this->size;
96  }
+ Here is the caller graph for this function:

◆ getSuffixes()

ilFileInputGUI::getSuffixes ( )

Get Accepted Suffixes.

Returns
array Accepted Suffixes

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

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

136  {
137  return $this->suffixes;
138  }
+ Here is the caller graph for this function:

◆ getToolbarHTML()

ilFileInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

Implements ilToolbarItem.

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

References $html, and render().

543  {
544  $html = $this->render("toolbar");
545  return $html;
546  }
render($a_mode="")
Render html.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getValue()

ilFileInputGUI::getValue ( )

Get Value.

Returns
string Value

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

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

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

◆ insert()

ilFileInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

References $html, and render().

472  {
473  $html = $this->render();
474 
475  $a_tpl->setCurrentBlock("prop_generic");
476  $a_tpl->setVariable("PROP_GENERIC", $html);
477  $a_tpl->parseCurrentBlock();
478  }
render($a_mode="")
Render html.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ isFileNameSelectionEnabled()

ilFileInputGUI::isFileNameSelectionEnabled ( )

Check if filename selection is enabled.

public

Returns
bool enabled/disabled

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

Referenced by render().

200  {
201  return $this->filename_selection ? true : false;
202  }
+ Here is the caller graph for this function:

◆ outputSuffixes()

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

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

References $lng, and getSuffixes().

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

482  {
483  global $lng;
484 
485  if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0)
486  {
487  $suff_str = $delim = "";
488  foreach($this->getSuffixes() as $suffix)
489  {
490  $suff_str.= $delim.".".$suffix;
491  $delim = ", ";
492  }
493  $a_tpl->setCurrentBlock($a_block);
494  $a_tpl->setVariable("TXT_ALLOWED_SUFFIXES",
495  $lng->txt("file_allowed_suffixes")." ".$suff_str);
496  $a_tpl->parseCurrentBlock();
497  }
498  }
getSuffixes()
Get Accepted Suffixes.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

ilFileInputGUI::render (   $a_mode = "")

Render html.

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

References $lng, $pending, getALlowDeletion(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getFilename(), getFileNamePostVar(), getMaxFileSizeString(), getPending(), ilFormPropertyGUI\getPostVar(), getSize(), ilDiskQuotaHandler\getStatusLegend(), getValue(), isFileNameSelectionEnabled(), ilDiskQuotaHandler\isUploadPossible(), and outputSuffixes().

Referenced by getToolbarHTML(), and insert().

360  {
361  global $lng;
362 
363  $quota_exceeded = $quota_legend = false;
364  if(self::$check_wsp_quota)
365  {
366  include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
368  {
369  $lng->loadLanguageModule("file");
370  $quota_exceeded = $lng->txt("personal_workspace_quota_exceeded_warning");
371  }
372  else
373  {
374  $quota_legend = ilDiskQuotaHandler::getStatusLegend();
375  }
376  }
377 
378  $f_tpl = new ilTemplate("tpl.prop_file.html", true, true, "Services/Form");
379 
380 
381  // show filename selection if enabled
382  if($this->isFileNameSelectionEnabled())
383  {
384  $f_tpl->setCurrentBlock('filename');
385  $f_tpl->setVariable('POST_FILENAME',$this->getFileNamePostVar());
386  $f_tpl->setVariable('VAL_FILENAME',$this->getFilename());
387  $f_tpl->setVariable('FILENAME_ID',$this->getFieldId());
388  $f_tpl->setVAriable('TXT_FILENAME_HINT',$lng->txt('if_no_title_then_filename'));
389  $f_tpl->parseCurrentBlock();
390  }
391  else
392  {
393  if (trim($this->getValue() != ""))
394  {
395  if (!$this->getDisabled() && $this->getALlowDeletion())
396  {
397  $f_tpl->setCurrentBlock("delete_bl");
398  $f_tpl->setVariable("POST_VAR_D", $this->getPostVar());
399  $f_tpl->setVariable("TXT_DELETE_EXISTING",
400  $lng->txt("delete_existing_file"));
401  $f_tpl->parseCurrentBlock();
402  }
403 
404  $f_tpl->setCurrentBlock('prop_file_propval');
405  $f_tpl->setVariable('FILE_VAL', $this->getValue());
406  $f_tpl->parseCurrentBlock();
407  }
408  }
409 
410  if ($a_mode != "toolbar")
411  {
412  if(!$quota_exceeded)
413  {
414  $this->outputSuffixes($f_tpl);
415 
416  $f_tpl->setCurrentBlock("max_size");
417  $f_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice")." ".
418  $this->getMaxFileSizeString());
419  $f_tpl->parseCurrentBlock();
420 
421  if($quota_legend)
422  {
423  $f_tpl->setVariable("TXT_MAX_SIZE", $quota_legend);
424  $f_tpl->parseCurrentBlock();
425  }
426  }
427  else
428  {
429  $f_tpl->setCurrentBlock("max_size");
430  $f_tpl->setVariable("TXT_MAX_SIZE", $quota_exceeded);
431  $f_tpl->parseCurrentBlock();
432  }
433  }
434  else if($quota_exceeded)
435  {
436  return $quota_exceeded;
437  }
438 
439  $pending = $this->getPending();
440  if($pending)
441  {
442  $f_tpl->setCurrentBlock("pending");
443  $f_tpl->setVariable("TXT_PENDING", $lng->txt("file_upload_pending").
444  ": ".$pending);
445  $f_tpl->parseCurrentBlock();
446  }
447 
448  if ($this->getDisabled() || $quota_exceeded)
449  {
450  $f_tpl->setVariable("DISABLED",
451  " disabled=\"disabled\"");
452  }
453 
454  $f_tpl->setVariable("POST_VAR", $this->getPostVar());
455  $f_tpl->setVariable("ID", $this->getFieldId());
456  $f_tpl->setVariable("SIZE", $this->getSize());
457 
458 
459  /* experimental: bootstrap'ed file upload */
460  $f_tpl->setVariable("TXT_BROWSE", $lng->txt("select_file"));
461 
462 
463  return $f_tpl->get();
464  }
getPostVar()
Get Post Variable.
getFileNamePostVar()
Get file name post var.
getFilename()
Get Value.
getPending()
Get pending filename.
getALlowDeletion()
Get allow deletion.
isFileNameSelectionEnabled()
Check if filename selection is enabled.
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
static isUploadPossible($a_additional_size=null)
outputSuffixes($a_tpl, $a_block="allowed_suffixes")
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setALlowDeletion()

ilFileInputGUI::setALlowDeletion (   $a_val)

Set allow deletion.

Parameters
boolean$a_valallow deletion

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

Referenced by ilBookingObjectGUI\initForm(), and ilCalendarCategoryGUI\initImportForm().

222  {
223  $this->allow_deletion = $a_val;
224  }
+ Here is the caller graph for this function:

◆ setFilename()

ilFileInputGUI::setFilename (   $a_val)

Set filename value (if filename selection is enabled)

Parameters
string$a_val

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

Referenced by setValueByArray().

104  {
105  $this->filename = $a_val;
106  }
+ Here is the caller graph for this function:

◆ setForbiddenSuffixes()

ilFileInputGUI::setForbiddenSuffixes (   $a_suffixes)

Set forbidden Suffixes.

Parameters
array$a_suffixesforbidden Suffixes

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

146  {
147  $this->forbidden_suffixes = $a_suffixes;
148  }

◆ setPending()

ilFileInputGUI::setPending (   $a_val)

Set pending filename value.

Parameters
string$a_val

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

166  {
167  $this->pending = $a_val;
168  }

◆ setPersonalWorkspaceQuotaCheck()

static ilFileInputGUI::setPersonalWorkspaceQuotaCheck (   $a_value)
static

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

References ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive().

Referenced by ilObjFileGUI\executeCommand(), ilObjPortfolioGUI\executeCommand(), ilObjBlogGUI\executeCommand(), ilObjBlogGUI\initEditCustomForm(), and ilObjPortfolioBaseGUI\initEditCustomForm().

549  {
550  if((bool)$a_value)
551  {
552  include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
554  {
555  self::$check_wsp_quota = true;
556  return;
557  }
558  }
559  self::$check_wsp_quota = false;
560  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSize()

ilFileInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

References size.

Referenced by ilFileSystemGUI\listFiles().

84  {
85  $this->size = $a_size;
86  }
font size
Definition: langcheck.php:162
+ Here is the caller graph for this function:

◆ setSuffixes()

ilFileInputGUI::setSuffixes (   $a_suffixes)

Set Accepted Suffixes.

Parameters
array$a_suffixesAccepted Suffixes

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

Referenced by ilImageFileInputGUI\__construct(), ilFlashFileInputGUI\__construct(), ilSystemStyleIconsGUI\addSelectIconToolbar(), ilObjHelpSettingsGUI\editSettings(), ilUploadDefinitionForm\getForm(), ilObjSurveyQuestionPoolGUI\importQuestionsObject(), ilObjMediaCastGUI\initAddCastItemForm(), ilPCInteractiveImageGUI\initAddOverlaysForm(), ilBadgeManagementGUI\initBadgeForm(), ilObjBibliographicGUI\initCreationForms(), ilObjBibliographicGUI\initEditForm(), ilOrgUnitTypeCustomIconsFormGUI\initForm(), ilStudyProgrammeTypeCustomIconsFormGUI\initForm(), ilObjectPluginGUI\initImportForm(), ilExternalFeedBlockGUI\initImportForm(), ilPermissionGUI\initImportForm(), ilObjContentObjectGUI\initImportForm(), ilObjectGUI\initImportForm(), ilObjQuestionPoolGUI\initImportForm(), ilObjSurveyGUI\initImportForm(), ilObjTestGUI\initImportForm(), ilSkillRootGUI\initInputForm(), ilSkillProfileGUI\initInputForm(), ilExerciseManagementGUI\initMultiFeedbackForm(), ilPageLayoutAdministrationGUI\initPageLayoutImportForm(), ilChatroomAdminSmileyGUI\initSmiliesEditForm(), ilChatroomAdminSmileyGUI\initSmiliesForm(), ilLMImportGUI\initTranslationImportForm(), ilMediaPoolImportGUI\initTranslationImportForm(), ilObjUserFolderGUI\initUserImportForm(), ilExSubmissionFileGUI\initZipUploadForm(), ilObjMediaObjectGUI\listSubtitleFilesObject(), assJavaAppletGUI\populateQuestionSpecificFormPart(), ilLMMultiSrtUploadGUI\uploadMultipleSubtitleFileForm(), and ilObjMediaObjectGUI\uploadMultipleSubtitleFileFormObject().

126  {
127  $this->suffixes = $a_suffixes;
128  }
+ Here is the caller graph for this function:

◆ setValue()

ilFileInputGUI::setValue (   $a_value)

Set Value.

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

Parameters
string$a_valueValue

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

Referenced by ilObjUserFolderGUI\initNewAccountMailForm(), and setValueByArray().

64  {
65  $this->value = $a_value;
66  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilFileInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

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

50  {
51  if (!is_array($a_values[$this->getPostVar()]))
52  {
53  $this->setValue($a_values[$this->getPostVar()]);
54  }
55  $this->setFilename($a_values[$this->getFileNamePostVar()]);
56  }
getPostVar()
Get Post Variable.
getFileNamePostVar()
Get file name post var.
setValue($a_value)
Set Value.
setFilename($a_val)
Set filename value (if filename selection is enabled)
+ Here is the call graph for this function:

Field Documentation

◆ $allow_deletion

ilFileInputGUI::$allow_deletion
protected

◆ $check_wsp_quota

ilFileInputGUI::$check_wsp_quota
staticprotected

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

◆ $filename

◆ $filename_post

ilFileInputGUI::$filename_post
private

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

Referenced by getFileNamePostVar().

◆ $forbidden_suffixes

ilFileInputGUI::$forbidden_suffixes = array()
protected

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

Referenced by getForbiddenSuffixes().

◆ $pending

ilFileInputGUI::$pending
protected

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

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

◆ $size

ilFileInputGUI::$size = 40
protected

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

Referenced by getSize().


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