ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Member Functions

 outputSuffixes ($a_tpl, $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 ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Protected Attributes

 $lng
 
 $size = 40
 
 $pending
 
 $allow_deletion
 
 $forbidden_suffixes = array()
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $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
 

Additional Inherited Members

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

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

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilImagemapFileInputGUI, ilDragDropFileInputGUI, ilFileWizardInputGUI, ilFlashFileInputGUI, and ilImageFileInputGUI.

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

41 {
42 global $DIC;
43
44 $this->lng = $DIC->language();
45 $lng = $DIC->language();
46
47 parent::__construct($a_title, $a_postvar);
48 $this->setType("file");
49 $this->setHiddenTitle("(" . $lng->txt("form_file_input") . ")");
50 }
setType($a_type)
Set Type.
setHiddenTitle($a_val)
Set hidden title (for screenreaders)
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ 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

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilImagemapCorrectionsInputGUI, ilImagemapFileInputGUI, ilDragDropFileInputGUI, ilFileStandardDropzoneInputGUI, ilFileWizardInputGUI, and ilFlashFileInputGUI.

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

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

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

+ 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.

@access public

Parameters
stringpost variable

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

195 {
196 $this->filename_selection = true;
197 $this->filename_post = $a_post_var;
198 }

◆ getALlowDeletion()

ilFileInputGUI::getALlowDeletion ( )

Get allow deletion.

Returns
boolean allow deletion

Reimplemented in ilImageFileInputGUI.

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

239 {
241 }

References $allow_deletion.

Referenced by render().

+ Here is the caller graph for this function:

◆ getDeletionFlag()

ilFileInputGUI::getDeletionFlag ( )

Get deletion flag.

Reimplemented in ilFlashFileInputGUI, and ilImageFileInputGUI.

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

519 {
520 if ($_POST[$this->getPostVar() . "_delete"]) {
521 return true;
522 }
523 return false;
524 }

References $_POST, and ilFormPropertyGUI\getPostVar().

+ Here is the call graph for this function:

◆ getFilename()

ilFileInputGUI::getFilename ( )

Get Value.

Returns
string Value

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

121 {
122 return $this->filename;
123 }

References $filename.

Referenced by render().

+ Here is the caller graph for this function:

◆ getFileNamePostVar()

ilFileInputGUI::getFileNamePostVar ( )

Get file name post var.

@access public

Parameters
stringfile name post var

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

219 {
221 }

References $filename_post.

Referenced by render(), and setValueByArray().

+ Here is the caller graph for this function:

◆ getForbiddenSuffixes()

ilFileInputGUI::getForbiddenSuffixes ( )

Get Accepted Suffixes.

Returns
array forbidden Suffixes

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

163 {
165 }

References $forbidden_suffixes.

◆ getMaxFileSizeString()

ilFileInputGUI::getMaxFileSizeString ( )
protected

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

473 {
474 // get the value for the maximal uploadable filesize from the php.ini (if available)
475 $umf = ini_get("upload_max_filesize");
476 // get the value for the maximal post data from the php.ini (if available)
477 $pms = ini_get("post_max_size");
478
479 //convert from short-string representation to "real" bytes
480 $multiplier_a = array("K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024);
481
482 $umf_parts = preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
483 $pms_parts = preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
484
485 if (count($umf_parts) == 2) {
486 $umf = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
487 }
488 if (count($pms_parts) == 2) {
489 $pms = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
490 }
491
492 // use the smaller one as limit
493 $max_filesize = min($umf, $pms);
494
495 if (!$max_filesize) {
496 $max_filesize = max($umf, $pms);
497 }
498
499 //format for display in mega-bytes
500 $max_filesize = sprintf("%.1f MB", $max_filesize / 1024 / 1024);
501
502 return $max_filesize;
503 }

◆ getMaxFileUploads()

ilFileInputGUI::getMaxFileUploads ( )
protected

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

Returns
int

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

511 {
512 return (int) ini_get("max_file_uploads");
513 }

Referenced by ilFileWizardInputGUI\insert().

+ Here is the caller graph for this function:

◆ getPending()

ilFileInputGUI::getPending ( )

Get pending filename.

Returns
string Value

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

183 {
184 return $this->pending;
185 }

References $pending.

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

+ Here is the caller graph for this function:

◆ getSize()

ilFileInputGUI::getSize ( )

Get Size.

Returns
int Size

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

101 {
102 return $this->size;
103 }

References $size.

Referenced by render().

+ Here is the caller graph for this function:

◆ getSuffixes()

ilFileInputGUI::getSuffixes ( )

Get Accepted Suffixes.

Returns
array Accepted Suffixes

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

143 {
144 return $this->suffixes;
145 }

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

+ Here is the caller graph for this function:

◆ getToolbarHTML()

ilFileInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

Implements ilToolbarItem.

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

530 {
531 $html = $this->render("toolbar");
532 return $html;
533 }
render($a_mode="")
Render html.

References render().

+ Here is the call graph for this function:

◆ getValue()

ilFileInputGUI::getValue ( )

Get Value.

Returns
string Value

Reimplemented in ilFlashFileInputGUI.

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

81 {
82 return $this->value;
83 }

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

+ Here is the caller graph for this function:

◆ insert()

ilFileInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Reimplemented in ilImagemapCorrectionsInputGUI, ilImagemapFileInputGUI, ilFileWizardInputGUI, ilFlashFileInputGUI, and ilImageFileInputGUI.

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

444 {
445 $html = $this->render();
446
447 $a_tpl->setCurrentBlock("prop_generic");
448 $a_tpl->setVariable("PROP_GENERIC", $html);
449 $a_tpl->parseCurrentBlock();
450 }

References render().

+ Here is the call graph for this function:

◆ isFileNameSelectionEnabled()

ilFileInputGUI::isFileNameSelectionEnabled ( )

Check if filename selection is enabled.

@access public

Returns
bool enabled/disabled

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

207 {
208 return $this->filename_selection ? true : false;
209 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.

References true.

Referenced by render(), and ilFileStandardDropzoneInputGUI\render().

+ Here is the caller graph for this function:

◆ outputSuffixes()

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

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

454 {
456
457 if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0) {
458 $suff_str = $delim = "";
459 foreach ($this->getSuffixes() as $suffix) {
460 $suff_str .= $delim . "." . $suffix;
461 $delim = ", ";
462 }
463 $a_tpl->setCurrentBlock($a_block);
464 $a_tpl->setVariable(
465 "TXT_ALLOWED_SUFFIXES",
466 $lng->txt("file_allowed_suffixes") . " " . $suff_str
467 );
468 $a_tpl->parseCurrentBlock();
469 }
470 }

References $lng, and getSuffixes().

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

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

◆ render()

ilFileInputGUI::render (   $a_mode = "")

Render html.

Reimplemented in ilDragDropFileInputGUI, and ilFileStandardDropzoneInputGUI.

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

355 {
357
358 $quota_exceeded = $quota_legend = false;
359
360 $f_tpl = new ilTemplate("tpl.prop_file.html", true, true, "Services/Form");
361
362
363 // show filename selection if enabled
364 if ($this->isFileNameSelectionEnabled()) {
365 $f_tpl->setCurrentBlock('filename');
366 $f_tpl->setVariable('POST_FILENAME', $this->getFileNamePostVar());
367 $f_tpl->setVariable('VAL_FILENAME', $this->getFilename());
368 $f_tpl->setVariable('FILENAME_ID', $this->getFieldId());
369 $f_tpl->setVAriable('TXT_FILENAME_HINT', $lng->txt('if_no_title_then_filename'));
370 $f_tpl->parseCurrentBlock();
371 } else {
372 if (trim($this->getValue() != "")) {
373 if (!$this->getDisabled() && $this->getALlowDeletion()) {
374 $f_tpl->setCurrentBlock("delete_bl");
375 $f_tpl->setVariable("POST_VAR_D", $this->getPostVar());
376 $f_tpl->setVariable(
377 "TXT_DELETE_EXISTING",
378 $lng->txt("delete_existing_file")
379 );
380 $f_tpl->parseCurrentBlock();
381 }
382
383 $f_tpl->setCurrentBlock('prop_file_propval');
384 $f_tpl->setVariable('FILE_VAL', $this->getValue());
385 $f_tpl->parseCurrentBlock();
386 }
387 }
388
389 if ($a_mode != "toolbar") {
390 if (!$quota_exceeded) {
391 $this->outputSuffixes($f_tpl);
392
393 $f_tpl->setCurrentBlock("max_size");
394 $f_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " .
395 $this->getMaxFileSizeString());
396 $f_tpl->parseCurrentBlock();
397
398 if ($quota_legend) {
399 $f_tpl->setVariable("TXT_MAX_SIZE", $quota_legend);
400 $f_tpl->parseCurrentBlock();
401 }
402 } else {
403 $f_tpl->setCurrentBlock("max_size");
404 $f_tpl->setVariable("TXT_MAX_SIZE", $quota_exceeded);
405 $f_tpl->parseCurrentBlock();
406 }
407 } elseif ($quota_exceeded) {
408 return $quota_exceeded;
409 }
410
411 $pending = $this->getPending();
412 if ($pending) {
413 $f_tpl->setCurrentBlock("pending");
414 $f_tpl->setVariable("TXT_PENDING", $lng->txt("file_upload_pending") .
415 ": " . htmlentities($pending));
416 $f_tpl->parseCurrentBlock();
417 }
418
419 if ($this->getDisabled() || $quota_exceeded) {
420 $f_tpl->setVariable(
421 "DISABLED",
422 " disabled=\"disabled\""
423 );
424 }
425
426 $f_tpl->setVariable("POST_VAR", $this->getPostVar());
427 $f_tpl->setVariable("ID", $this->getFieldId());
428 $f_tpl->setVariable("SIZE", $this->getSize());
429
430
431 /* experimental: bootstrap'ed file upload */
432 $f_tpl->setVariable("TXT_BROWSE", $lng->txt("select_file"));
433
434
435 return $f_tpl->get();
436 }
outputSuffixes($a_tpl, $a_block="allowed_suffixes")
isFileNameSelectionEnabled()
Check if filename selection is enabled.
getFileNamePostVar()
Get file name post var.
getPending()
Get pending filename.
getALlowDeletion()
Get allow deletion.
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR

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

Referenced by getToolbarHTML(), and insert().

+ 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

Reimplemented in ilImageFileInputGUI.

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

229 {
230 $this->allow_deletion = $a_val;
231 }

◆ setFilename()

ilFileInputGUI::setFilename (   $a_val)

Set filename value (if filename selection is enabled)

Parameters
string$a_val

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

111 {
112 $this->filename = $a_val;
113 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setForbiddenSuffixes()

ilFileInputGUI::setForbiddenSuffixes (   $a_suffixes)

Set forbidden Suffixes.

Parameters
array$a_suffixesforbidden Suffixes

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

153 {
154 $this->forbidden_suffixes = $a_suffixes;
155 }

◆ setPending()

ilFileInputGUI::setPending (   $a_val)

Set pending filename value.

Parameters
string$a_val

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

173 {
174 $this->pending = $a_val;
175 }

◆ setSize()

ilFileInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

91 {
92 $this->size = $a_size;
93 }

◆ setSuffixes()

ilFileInputGUI::setSuffixes (   $a_suffixes)

Set Accepted Suffixes.

Parameters
array$a_suffixesAccepted Suffixes

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

133 {
134 $this->suffixes = $a_suffixes;
135 }

Referenced by ilFlashFileInputGUI\__construct(), ilImageFileInputGUI\__construct(), ilFileStandardDropzoneInputGUI\handleSuffixes(), and ilObjLearningSequenceSettingsGUI\initImgInput().

+ 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

Reimplemented in ilImagemapFileInputGUI, and ilFlashFileInputGUI.

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

71 {
72 $this->value = $a_value;
73 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilFileInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Reimplemented in ilImagemapCorrectionsInputGUI, ilImagemapFileInputGUI, and ilFlashFileInputGUI.

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

58 {
59 if (!is_array($a_values[$this->getPostVar()])) {
60 $this->setValue($a_values[$this->getPostVar()]);
61 }
62 $this->setFilename($a_values[$this->getFileNamePostVar()]);
63 }
setValue($a_value)
Set Value.
setFilename($a_val)
Set filename value (if filename selection is enabled)

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

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

◆ $filename

◆ $filename_post

ilFileInputGUI::$filename_post
private

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

Referenced by getFileNamePostVar().

◆ $forbidden_suffixes

ilFileInputGUI::$forbidden_suffixes = array()
protected

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

Referenced by getForbiddenSuffixes().

◆ $lng

◆ $pending

ilFileInputGUI::$pending
protected

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

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

◆ $size

ilFileInputGUI::$size = 40
protected

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

Referenced by getSize().


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