45 parent::__construct($a_title, $a_postvar);
55 $this->imagepath_web = $a_path;
75 $this->filenames = $a_filenames;
95 $this->allowMove = $a_allow_move;
122 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
128 if (is_array($pictures))
130 foreach ($pictures[
'name'] as $index => $name)
133 $name = rtrim($name,
'/');
136 $filename_arr = pathinfo($name);
137 $suffix = $filename_arr[
"extension"];
138 $mimetype = $pictures[
"type"][$index];
139 $size_bytes = $pictures[
"size"][$index];
140 $temp_name = $pictures[
"tmp_name"][$index];
141 $error = $pictures[
"error"][$index];
143 include_once(
"./Services/Utilities/classes/class.ilStr.php");
152 case UPLOAD_ERR_INI_SIZE:
153 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
154 $uploadcheck =
false;
157 case UPLOAD_ERR_FORM_SIZE:
158 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
159 $uploadcheck =
false;
162 case UPLOAD_ERR_PARTIAL:
163 $this->
setAlert($lng->txt(
"form_msg_file_partially_uploaded"));
164 $uploadcheck =
false;
167 case UPLOAD_ERR_NO_FILE:
173 $this->
setAlert($lng->txt(
"form_msg_file_no_upload"));
174 $uploadcheck =
false;
179 case UPLOAD_ERR_NO_TMP_DIR:
180 $this->
setAlert($lng->txt(
"form_msg_file_missing_tmp_dir"));
181 $uploadcheck =
false;
184 case UPLOAD_ERR_CANT_WRITE:
185 $this->
setAlert($lng->txt(
"form_msg_file_cannot_write_to_disk"));
186 $uploadcheck =
false;
189 case UPLOAD_ERR_EXTENSION:
190 $this->
setAlert($lng->txt(
"form_msg_file_upload_stopped_ext"));
191 $uploadcheck =
false;
197 if ($pictures[
"tmp_name"][$index] !=
"" && is_array($this->
getSuffixes()))
199 if (!in_array(strtolower($suffix), $this->
getSuffixes()))
201 $this->
setAlert($lng->txt(
"form_msg_file_wrong_file_type"));
202 $uploadcheck =
false;
207 if ($pictures[
"tmp_name"][$index] !=
"")
210 if ($vir[0] ==
false)
212 $this->
setAlert($lng->txt(
"form_msg_file_virus_found").
"<br />".$vir[1]);
213 $uploadcheck =
false;
237 $tpl =
new ilTemplate(
"tpl.prop_filewizardinput.html",
true,
true,
"Services/Form");
240 foreach ($this->filenames as $value)
244 $tpl->setCurrentBlock(
"image");
249 $tpl->parseCurrentBlock();
253 $tpl->setCurrentBlock(
"move");
254 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
255 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
257 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
260 $tpl->parseCurrentBlock();
265 $tpl->setCurrentBlock(
"row");
268 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
269 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
270 $tpl->setVariable(
"ALT_ADD", $lng->txt(
"add"));
271 $tpl->setVariable(
"ALT_REMOVE", $lng->txt(
"remove"));
274 $tpl->setVariable(
"DISABLED",
275 " disabled=\"disabled\"");
278 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
282 $tpl->parseCurrentBlock();
287 $a_tpl->setCurrentBlock(
"prop_generic");
288 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
289 $a_tpl->parseCurrentBlock();
292 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
293 $tpl->addJavascript(
"./Services/Form/templates/default/filewizard.js");
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
static normalizeUtf8String($a_str)
Normalize UTF8 string.
static get($a_glyph, $a_text="")
Get glyph html.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.