19 declare(strict_types=1);
40 string $a_postvar =
"" 44 $this->
lng = $DIC->language();
45 $this->
lng->loadLanguageModule(
"form");
46 $this->tpl = $DIC[
"tpl"];
47 $this->ui_factory = $DIC->ui()->factory();
48 $this->ui_renderer = $DIC->ui()->renderer();
54 $this->imagepath_web = $a_path;
64 $this->filenames = $a_filenames;
74 $this->allowMove = $a_allow_move;
96 if (is_array($pictures)) {
97 foreach ($pictures[
'name'] as $index => $name) {
99 $name = rtrim($name,
'/');
102 $filename_arr = pathinfo($name);
103 $suffix = $filename_arr[
"extension"] ??
"";
104 $temp_name = $pictures[
"tmp_name"][$index];
105 $error = $pictures[
"error"][$index];
107 $_FILES[$this->
getPostVar()][
"name"][$index] = Util::sanitizeFileName($_FILES[$this->
getPostVar()][
"name"][$index]);
113 case UPLOAD_ERR_FORM_SIZE:
114 case UPLOAD_ERR_INI_SIZE:
116 $uploadcheck =
false;
119 case UPLOAD_ERR_PARTIAL:
121 $uploadcheck =
false;
124 case UPLOAD_ERR_NO_FILE:
129 $uploadcheck =
false;
134 case UPLOAD_ERR_NO_TMP_DIR:
136 $uploadcheck =
false;
139 case UPLOAD_ERR_CANT_WRITE:
141 $uploadcheck =
false;
144 case UPLOAD_ERR_EXTENSION:
146 $uploadcheck =
false;
152 if ($pictures[
"tmp_name"][$index] !=
"" && is_array($this->
getSuffixes()) && count($this->
getSuffixes()) > 0) {
153 if (!in_array(strtolower($suffix), $this->
getSuffixes())) {
155 $uploadcheck =
false;
160 if ($pictures[
"tmp_name"][$index] !=
"") {
162 if ($vir[0] ==
false) {
163 $this->
setAlert(
$lng->
txt(
"form_msg_file_virus_found") .
"<br />" . $vir[1]);
164 $uploadcheck =
false;
181 $tpl =
new ilTemplate(
"tpl.prop_filewizardinput.html",
true,
true,
"components/ILIAS/Form");
184 foreach ($this->filenames as
$value) {
185 if (strlen($value)) {
205 $this->ui_renderer->render(
206 $this->ui_factory->symbol()->glyph()->up()
211 $this->ui_renderer->render(
212 $this->ui_factory->symbol()->glyph()->down()
230 " disabled=\"disabled\"" 236 $this->ui_renderer->render(
237 $this->ui_factory->symbol()->glyph()->add()
242 $this->ui_renderer->render(
243 $this->ui_factory->symbol()->glyph()->remove()
259 $main_tpl->addJavascript(
"assets/js/ServiceFormWizardInput.js");
260 $main_tpl->addJavascript(
"assets/js/filewizard.js");
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setVariable($variable, $value='')
Sets a variable value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)