ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. 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

 $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
 

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: saml.php:7

References $DIC, $lng, 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 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
$error
Definition: Error.php:17

References $_POST, $error, $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 517 of file class.ilFileInputGUI.php.

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

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

482 {
483 // get the value for the maximal uploadable filesize from the php.ini (if available)
484 $umf = ini_get("upload_max_filesize");
485 // get the value for the maximal post data from the php.ini (if available)
486 $pms = ini_get("post_max_size");
487
488 //convert from short-string representation to "real" bytes
489 $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
490
491 $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
492 $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
493
494 if (count($umf_parts) == 2) {
495 $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]];
496 }
497 if (count($pms_parts) == 2) {
498 $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]];
499 }
500
501 // use the smaller one as limit
502 $max_filesize = min($umf, $pms);
503
504 if (!$max_filesize) {
505 $max_filesize=max($umf, $pms);
506 }
507
508 //format for display in mega-bytes
509 $max_filesize = sprintf("%.1f MB", $max_filesize/1024/1024);
510
511 return $max_filesize;
512 }
sprintf('%.4f', $callTime)
echo;exit;}function LogoutNotification($SessionID){ global $ilDB;$q="SELECT session_id, data FROM usr_session WHERE expires > (\w+)\|/" PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE

References PREG_SPLIT_DELIM_CAPTURE, and sprintf.

◆ 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 528 of file class.ilFileInputGUI.php.

529 {
530 $html = $this->render("toolbar");
531 return $html;
532 }
render($a_mode="")
Render html.
$html
Definition: example_001.php:87

References $html, and 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(), 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 ilImagemapFileInputGUI, ilFileWizardInputGUI, ilFlashFileInputGUI, and ilImageFileInputGUI.

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

453 {
454 $html = $this->render();
455
456 $a_tpl->setCurrentBlock("prop_generic");
457 $a_tpl->setVariable("PROP_GENERIC", $html);
458 $a_tpl->parseCurrentBlock();
459 }

References $html, and 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 }

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

463 {
465
466 if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0) {
467 $suff_str = $delim = "";
468 foreach ($this->getSuffixes() as $suffix) {
469 $suff_str.= $delim . "." . $suffix;
470 $delim = ", ";
471 }
472 $a_tpl->setCurrentBlock($a_block);
473 $a_tpl->setVariable(
474 "TXT_ALLOWED_SUFFIXES",
475 $lng->txt("file_allowed_suffixes") . " " . $suff_str
476 );
477 $a_tpl->parseCurrentBlock();
478 }
479 }

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 if (self::$check_wsp_quota) {
360 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
362 $lng->loadLanguageModule("file");
363 $quota_exceeded = $lng->txt("personal_workspace_quota_exceeded_warning");
364 } else {
365 $quota_legend = ilDiskQuotaHandler::getStatusLegend();
366 }
367 }
368
369 $f_tpl = new ilTemplate("tpl.prop_file.html", true, true, "Services/Form");
370
371
372 // show filename selection if enabled
373 if ($this->isFileNameSelectionEnabled()) {
374 $f_tpl->setCurrentBlock('filename');
375 $f_tpl->setVariable('POST_FILENAME', $this->getFileNamePostVar());
376 $f_tpl->setVariable('VAL_FILENAME', $this->getFilename());
377 $f_tpl->setVariable('FILENAME_ID', $this->getFieldId());
378 $f_tpl->setVAriable('TXT_FILENAME_HINT', $lng->txt('if_no_title_then_filename'));
379 $f_tpl->parseCurrentBlock();
380 } else {
381 if (trim($this->getValue() != "")) {
382 if (!$this->getDisabled() && $this->getALlowDeletion()) {
383 $f_tpl->setCurrentBlock("delete_bl");
384 $f_tpl->setVariable("POST_VAR_D", $this->getPostVar());
385 $f_tpl->setVariable(
386 "TXT_DELETE_EXISTING",
387 $lng->txt("delete_existing_file")
388 );
389 $f_tpl->parseCurrentBlock();
390 }
391
392 $f_tpl->setCurrentBlock('prop_file_propval');
393 $f_tpl->setVariable('FILE_VAL', $this->getValue());
394 $f_tpl->parseCurrentBlock();
395 }
396 }
397
398 if ($a_mode != "toolbar") {
399 if (!$quota_exceeded) {
400 $this->outputSuffixes($f_tpl);
401
402 $f_tpl->setCurrentBlock("max_size");
403 $f_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " .
404 $this->getMaxFileSizeString());
405 $f_tpl->parseCurrentBlock();
406
407 if ($quota_legend) {
408 $f_tpl->setVariable("TXT_MAX_SIZE", $quota_legend);
409 $f_tpl->parseCurrentBlock();
410 }
411 } else {
412 $f_tpl->setCurrentBlock("max_size");
413 $f_tpl->setVariable("TXT_MAX_SIZE", $quota_exceeded);
414 $f_tpl->parseCurrentBlock();
415 }
416 } elseif ($quota_exceeded) {
417 return $quota_exceeded;
418 }
419
420 $pending = $this->getPending();
421 if ($pending) {
422 $f_tpl->setCurrentBlock("pending");
423 $f_tpl->setVariable("TXT_PENDING", $lng->txt("file_upload_pending") .
424 ": " . $pending);
425 $f_tpl->parseCurrentBlock();
426 }
427
428 if ($this->getDisabled() || $quota_exceeded) {
429 $f_tpl->setVariable(
430 "DISABLED",
431 " disabled=\"disabled\""
432 );
433 }
434
435 $f_tpl->setVariable("POST_VAR", $this->getPostVar());
436 $f_tpl->setVariable("ID", $this->getFieldId());
437 $f_tpl->setVariable("SIZE", $this->getSize());
438
439
440 /* experimental: bootstrap'ed file upload */
441 $f_tpl->setVariable("TXT_BROWSE", $lng->txt("select_file"));
442
443
444 return $f_tpl->get();
445 }
static isUploadPossible($a_additional_size=null)
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(), ilDiskQuotaHandler\getStatusLegend(), getValue(), isFileNameSelectionEnabled(), ilDiskQuotaHandler\isUploadPossible(), 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 }

◆ setPersonalWorkspaceQuotaCheck()

static ilFileInputGUI::setPersonalWorkspaceQuotaCheck (   $a_value)
static

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

535 {
536 if ((bool) $a_value) {
537 include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
539 self::$check_wsp_quota = true;
540 return;
541 }
542 }
543 self::$check_wsp_quota = false;
544 }

References ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive().

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

+ 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 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(), and ilFileStandardDropzoneInputGUI\handleSuffixes().

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