55 $this->imagepath_web = $a_path;
75 $this->filenames = $a_filenames;
95 $this->allowMove = $a_allow_move;
119 if (is_array($pictures))
121 foreach ($pictures[
'name'] as $index =>
$name)
124 while (substr(
$name, -1) ==
'/')
130 $filename_arr = pathinfo(
$name);
131 $suffix = $filename_arr[
"extension"];
132 $mimetype = $pictures[
"type"][$index];
133 $size_bytes = $pictures[
"size"][$index];
134 $temp_name = $pictures[
"tmp_name"][$index];
135 $error = $pictures[
"error"][$index];
141 case UPLOAD_ERR_INI_SIZE:
142 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
143 $uploadcheck =
false;
146 case UPLOAD_ERR_FORM_SIZE:
147 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
148 $uploadcheck =
false;
151 case UPLOAD_ERR_PARTIAL:
152 $this->
setAlert($lng->txt(
"form_msg_file_partially_uploaded"));
153 $uploadcheck =
false;
156 case UPLOAD_ERR_NO_FILE:
162 $this->
setAlert($lng->txt(
"form_msg_file_no_upload"));
163 $uploadcheck =
false;
168 case UPLOAD_ERR_NO_TMP_DIR:
169 $this->
setAlert($lng->txt(
"form_msg_file_missing_tmp_dir"));
170 $uploadcheck =
false;
173 case UPLOAD_ERR_CANT_WRITE:
174 $this->
setAlert($lng->txt(
"form_msg_file_cannot_write_to_disk"));
175 $uploadcheck =
false;
178 case UPLOAD_ERR_EXTENSION:
179 $this->
setAlert($lng->txt(
"form_msg_file_upload_stopped_ext"));
180 $uploadcheck =
false;
186 if ($pictures[
"tmp_name"][$index] !=
"" && is_array($this->
getSuffixes()))
188 if (!in_array(strtolower($suffix), $this->
getSuffixes()))
190 $this->
setAlert($lng->txt(
"form_msg_file_wrong_file_type"));
191 $uploadcheck =
false;
196 if ($pictures[
"tmp_name"][$index] !=
"")
199 if ($vir[0] ==
false)
201 $this->
setAlert($lng->txt(
"form_msg_file_virus_found").
"<br />".$vir[1]);
202 $uploadcheck =
false;
226 $tpl =
new ilTemplate(
"tpl.prop_filewizardinput.html",
true,
true,
"Services/Form");
229 foreach ($this->filenames as $value)
233 $tpl->setCurrentBlock(
"image");
238 $tpl->parseCurrentBlock();
242 $tpl->setCurrentBlock(
"move");
243 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
244 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
248 $tpl->parseCurrentBlock();
253 $tpl->setCurrentBlock(
"row");
254 $class = ($i % 2 == 0) ?
"even" :
"odd";
255 if ($i == 0) $class .=
" first";
256 if ($i == count($this->filenames)-1) $class .=
" last";
257 $tpl->setVariable(
"ROW_CLASS", $class);
260 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
261 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
262 $tpl->setVariable(
"ALT_ADD", $lng->txt(
"add"));
263 $tpl->setVariable(
"ALT_REMOVE", $lng->txt(
"remove"));
266 $tpl->setVariable(
"DISABLED",
267 " disabled=\"disabled\"");
272 $tpl->parseCurrentBlock();
277 $a_tpl->setCurrentBlock(
"prop_generic");
278 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
279 $a_tpl->parseCurrentBlock();
282 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
284 $tpl->addJavascript(
"./Services/Form/templates/default/filewizard.js");