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 while (substr($name, -1) ==
'/')
135 $name = substr($name, 0, -1);
139 $filename_arr = pathinfo($name);
140 $suffix = $filename_arr[
"extension"];
141 $mimetype = $pictures[
"type"][$index];
142 $size_bytes = $pictures[
"size"][$index];
143 $temp_name = $pictures[
"tmp_name"][$index];
144 $error = $pictures[
"error"][$index];
150 case UPLOAD_ERR_INI_SIZE:
151 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
152 $uploadcheck =
false;
155 case UPLOAD_ERR_FORM_SIZE:
156 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
157 $uploadcheck =
false;
160 case UPLOAD_ERR_PARTIAL:
161 $this->
setAlert($lng->txt(
"form_msg_file_partially_uploaded"));
162 $uploadcheck =
false;
165 case UPLOAD_ERR_NO_FILE:
171 $this->
setAlert($lng->txt(
"form_msg_file_no_upload"));
172 $uploadcheck =
false;
177 case UPLOAD_ERR_NO_TMP_DIR:
178 $this->
setAlert($lng->txt(
"form_msg_file_missing_tmp_dir"));
179 $uploadcheck =
false;
182 case UPLOAD_ERR_CANT_WRITE:
183 $this->
setAlert($lng->txt(
"form_msg_file_cannot_write_to_disk"));
184 $uploadcheck =
false;
187 case UPLOAD_ERR_EXTENSION:
188 $this->
setAlert($lng->txt(
"form_msg_file_upload_stopped_ext"));
189 $uploadcheck =
false;
195 if ($pictures[
"tmp_name"][$index] !=
"" && is_array($this->
getSuffixes()))
197 if (!in_array(strtolower($suffix), $this->
getSuffixes()))
199 $this->
setAlert($lng->txt(
"form_msg_file_wrong_file_type"));
200 $uploadcheck =
false;
205 if ($pictures[
"tmp_name"][$index] !=
"")
208 if ($vir[0] ==
false)
210 $this->
setAlert($lng->txt(
"form_msg_file_virus_found").
"<br />".$vir[1]);
211 $uploadcheck =
false;
235 $tpl =
new ilTemplate(
"tpl.prop_filewizardinput.html",
true,
true,
"Services/Form");
238 foreach ($this->filenames as $value)
242 $tpl->setCurrentBlock(
"image");
247 $tpl->parseCurrentBlock();
251 $tpl->setCurrentBlock(
"move");
252 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
253 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
255 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
258 $tpl->parseCurrentBlock();
263 $tpl->setCurrentBlock(
"row");
266 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
267 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
268 $tpl->setVariable(
"ALT_ADD", $lng->txt(
"add"));
269 $tpl->setVariable(
"ALT_REMOVE", $lng->txt(
"remove"));
272 $tpl->setVariable(
"DISABLED",
273 " disabled=\"disabled\"");
276 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
280 $tpl->parseCurrentBlock();
285 $a_tpl->setCurrentBlock(
"prop_generic");
286 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
287 $a_tpl->parseCurrentBlock();
290 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
291 $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 get($a_glyph, $a_text="")
Get glyph html.
special template class to simplify handling of ITX/PEAR