ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 Check input, strip slashes etc. More...
 
 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)
 Get item by post var. More...
 
- 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...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Member Functions

 outputSuffixes (ilTemplate $a_tpl, string $a_block="allowed_suffixes")
 
 getMaxFileSizeString ()
 
 getMaxFileUploads ()
 Get number of maximum file uploads as declared in php.ini. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Protected Attributes

int $size = 40
 
string $pending = ""
 
bool $allow_deletion = false
 
bool $filename_selection = false
 
array $forbidden_suffixes = []
 
array $suffixes = []
 
string $value = ""
 
FileUpload $upload_service
 
UploadLimitResolver $upload_limit
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Private Attributes

string $filename = ""
 
string $filename_post = ""
 

Additional Inherited Members

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

Detailed Description

This class represents a file property in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
12 This component will be removed with ILIAS 12

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilFileWizardInputGUI, and ilImageFileInputGUI.

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

48 {
49 global $DIC;
50
51 $this->lng = $DIC->language();
52 $this->lng->loadLanguageModule('form');
53
54 $this->upload_service = $DIC->upload();
55 $this->upload_limit = $DIC['ui.upload_limit_resolver'];
56
57 parent::__construct($a_title, $a_postvar);
58 $this->setType("file");
59 $this->setHiddenTitle("(" . $this->lng->txt("form_file_input") . ")");
60 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\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.

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilFileWizardInputGUI, ilImagemapCorrectionsInputGUI, and ilImagemapFileInputGUI.

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

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

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

+ Here is the call graph for this function:

◆ enableFileNameSelection()

ilFileInputGUI::enableFileNameSelection ( string  $a_post_var)

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

138 : void
139 {
140 $this->filename_selection = true;
141 $this->filename_post = $a_post_var;
142 }

◆ getALlowDeletion()

ilFileInputGUI::getALlowDeletion ( )

Reimplemented in ilImageFileInputGUI.

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

159 : bool
160 {
162 }

References $allow_deletion.

Referenced by render().

+ Here is the caller graph for this function:

◆ getDeletionFlag()

ilFileInputGUI::getDeletionFlag ( )

Reimplemented in ilImageFileInputGUI.

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

401 : bool
402 {
403 if ($this->int($this->getPostVar() . "_delete")) {
404 return true;
405 }
406 return false;
407 }

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getFilename()

ilFileInputGUI::getFilename ( )

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

101 : string
102 {
103 return $this->filename;
104 }

References $filename.

Referenced by render().

+ Here is the caller graph for this function:

◆ getFileNamePostVar()

ilFileInputGUI::getFileNamePostVar ( )

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

149 : string
150 {
152 }

References $filename_post.

Referenced by render(), and setValueByArray().

+ Here is the caller graph for this function:

◆ getForbiddenSuffixes()

ilFileInputGUI::getForbiddenSuffixes ( )

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

121 : array
122 {
124 }

References $forbidden_suffixes.

◆ getInput()

ilFileInputGUI::getInput ( )

Reimplemented in ilImagemapFileInputGUI.

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

268 : array
269 {
270 return $_FILES[$this->getPostVar()];
271 }

References ilFormPropertyGUI\getPostVar().

+ Here is the call graph for this function:

◆ getMaxFileSizeString()

ilFileInputGUI::getMaxFileSizeString ( )
protected

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

387 : string
388 {
389 //format for display in mega-bytes
390 return sprintf("%.1f MB", $this->upload_limit->getPhpUploadLimitInBytes() / 1024 / 1024);
391 }

◆ getMaxFileUploads()

ilFileInputGUI::getMaxFileUploads ( )
protected

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

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

396 : int
397 {
398 return (int) ini_get("max_file_uploads");
399 }

Referenced by ilFileWizardInputGUI\insert().

+ Here is the caller graph for this function:

◆ getPending()

ilFileInputGUI::getPending ( )

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

132 : string
133 {
134 return $this->pending;
135 }

References $pending.

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

+ Here is the caller graph for this function:

◆ getSize()

ilFileInputGUI::getSize ( )

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

90 : int
91 {
92 return $this->size;
93 }

References $size.

Referenced by render().

+ Here is the caller graph for this function:

◆ getSuffixes()

ilFileInputGUI::getSuffixes ( )

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

111 : array
112 {
113 return $this->suffixes;
114 }

References $suffixes.

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

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

409 : string
410 {
411 $html = $this->render("toolbar");
412 return $html;
413 }
render(string $a_mode="")

◆ getValue()

ilFileInputGUI::getValue ( )

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

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

References $value.

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

+ Here is the caller graph for this function:

◆ insert()

ilFileInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented in ilFileWizardInputGUI, ilImageFileInputGUI, ilImagemapCorrectionsInputGUI, and ilImagemapFileInputGUI.

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

358 : void
359 {
360 $html = $this->render();
361
362 $a_tpl->setCurrentBlock("prop_generic");
363 $a_tpl->setVariable("PROP_GENERIC", $html);
364 $a_tpl->parseCurrentBlock();
365 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)

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

+ Here is the call graph for this function:

◆ isFileNameSelectionEnabled()

ilFileInputGUI::isFileNameSelectionEnabled ( )

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

144 : bool
145 {
147 }

References $filename_selection.

Referenced by render().

+ Here is the caller graph for this function:

◆ outputSuffixes()

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

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

371 : void {
372 if (is_array($this->getSuffixes()) && count($this->getSuffixes()) > 0) {
373 $suff_str = $delim = "";
374 foreach ($this->getSuffixes() as $suffix) {
375 $suff_str .= $delim . "." . $suffix;
376 $delim = ", ";
377 }
378 $a_tpl->setCurrentBlock($a_block);
379 $a_tpl->setVariable(
380 "TXT_ALLOWED_SUFFIXES",
381 $this->lng->txt("file_allowed_suffixes") . " " . $suff_str
382 );
383 $a_tpl->parseCurrentBlock();
384 }
385 }

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

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

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

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

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

Referenced by insert().

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

◆ setAllowDeletion()

ilFileInputGUI::setAllowDeletion ( bool  $a_val)

Reimplemented in ilImageFileInputGUI.

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

154 : void
155 {
156 $this->allow_deletion = $a_val;
157 }

◆ setFilename()

ilFileInputGUI::setFilename ( string  $a_val)

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

96 : void
97 {
98 $this->filename = $a_val;
99 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setForbiddenSuffixes()

ilFileInputGUI::setForbiddenSuffixes ( array  $a_suffixes)

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

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

◆ setPending()

ilFileInputGUI::setPending ( string  $a_val)

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

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

◆ setSize()

ilFileInputGUI::setSize ( int  $a_size)

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

85 : void
86 {
87 $this->size = $a_size;
88 }

◆ setSuffixes()

ilFileInputGUI::setSuffixes ( array  $a_suffixes)

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

106 : void
107 {
108 $this->suffixes = $a_suffixes;
109 }

Referenced by ilImageFileInputGUI\__construct().

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

75 : void
76 {
77 $this->value = $a_value;
78 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilFileInputGUI::setValueByArray ( array  $a_values)

Reimplemented in ilImagemapCorrectionsInputGUI, and ilImagemapFileInputGUI.

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

62 : void
63 {
64 $value = $a_values[$this->getPostVar()] ?? null;
65 if (!is_array($value)) {
66 $this->setValue((string) $value);
67 }
68 $filenam = $a_values[$this->getFileNamePostVar()] ?? '';
69 $this->setFilename($filenam);
70 }
setValue(string $a_value)
Set Value.

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

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

Referenced by getFileNamePostVar().

◆ $filename_selection

bool ilFileInputGUI::$filename_selection = false
protected

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

Referenced by isFileNameSelectionEnabled().

◆ $forbidden_suffixes

array ilFileInputGUI::$forbidden_suffixes = []
protected

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

Referenced by getForbiddenSuffixes().

◆ $pending

string ilFileInputGUI::$pending = ""
protected

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

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

◆ $size

int ilFileInputGUI::$size = 40
protected

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

Referenced by getSize().

◆ $suffixes

array ilFileInputGUI::$suffixes = []
protected

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

Referenced by getSuffixes().

◆ $upload_limit

UploadLimitResolver ilFileInputGUI::$upload_limit
protected

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

◆ $upload_service

FileUpload ilFileInputGUI::$upload_service
protected

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

◆ $value

string ilFileInputGUI::$value = ""
protected

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

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


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