57 $this->lng = $DIC->language();
58 $this->tpl = $DIC[
"tpl"];
59 parent::__construct($a_title, $a_postvar);
69 $this->imagepath_web = $a_path;
89 $this->filenames = $a_filenames;
109 $this->allowMove = $a_allow_move;
134 if (!is_array($_FILES[$this->
getPostVar()])) {
135 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
141 if (is_array($pictures)) {
147 $filename_arr = pathinfo(
$name);
148 $suffix = $filename_arr[
"extension"];
149 $mimetype = $pictures[
"type"][
$index];
150 $size_bytes = $pictures[
"size"][
$index];
151 $temp_name = $pictures[
"tmp_name"][
$index];
154 include_once(
"./Services/Utilities/classes/class.ilStr.php");
161 case UPLOAD_ERR_INI_SIZE:
162 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
163 $uploadcheck =
false;
166 case UPLOAD_ERR_FORM_SIZE:
167 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
168 $uploadcheck =
false;
171 case UPLOAD_ERR_PARTIAL:
172 $this->
setAlert(
$lng->txt(
"form_msg_file_partially_uploaded"));
173 $uploadcheck =
false;
176 case UPLOAD_ERR_NO_FILE:
181 $uploadcheck =
false;
186 case UPLOAD_ERR_NO_TMP_DIR:
187 $this->
setAlert(
$lng->txt(
"form_msg_file_missing_tmp_dir"));
188 $uploadcheck =
false;
191 case UPLOAD_ERR_CANT_WRITE:
192 $this->
setAlert(
$lng->txt(
"form_msg_file_cannot_write_to_disk"));
193 $uploadcheck =
false;
196 case UPLOAD_ERR_EXTENSION:
197 $this->
setAlert(
$lng->txt(
"form_msg_file_upload_stopped_ext"));
198 $uploadcheck =
false;
205 if (!in_array(strtolower($suffix), $this->
getSuffixes())) {
206 $this->
setAlert(
$lng->txt(
"form_msg_file_wrong_file_type"));
207 $uploadcheck =
false;
212 if ($pictures[
"tmp_name"][
$index] !=
"") {
214 if ($vir[0] ==
false) {
215 $this->
setAlert(
$lng->txt(
"form_msg_file_virus_found") .
"<br />" . $vir[1]);
216 $uploadcheck =
false;
238 $tpl =
new ilTemplate(
"tpl.prop_filewizardinput.html",
true,
true,
"Services/Form");
241 foreach ($this->filenames as $value) {
242 if (strlen($value)) {
243 $tpl->setCurrentBlock(
"image");
248 $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"));
273 " disabled=\"disabled\"" 277 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
281 $tpl->parseCurrentBlock();
286 $a_tpl->setCurrentBlock(
"prop_generic");
287 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
288 $a_tpl->parseCurrentBlock();
291 $main_tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
292 $main_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.