57 $this->lng = $DIC->language();
58 $this->lng->loadLanguageModule(
"form");
59 $this->tpl = $DIC[
"tpl"];
60 parent::__construct($a_title, $a_postvar);
70 $this->imagepath_web = $a_path;
90 $this->filenames = $a_filenames;
110 $this->allowMove = $a_allow_move;
135 if (!is_array($_FILES[$this->
getPostVar()])) {
136 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
142 if (is_array($pictures)) {
148 $filename_arr = pathinfo(
$name);
149 $suffix = $filename_arr[
"extension"];
150 $mimetype = $pictures[
"type"][
$index];
151 $size_bytes = $pictures[
"size"][
$index];
152 $temp_name = $pictures[
"tmp_name"][
$index];
153 $error = $pictures[
"error"][
$index];
155 include_once(
"./Services/Utilities/classes/class.ilStr.php");
162 case UPLOAD_ERR_INI_SIZE:
163 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
164 $uploadcheck =
false;
167 case UPLOAD_ERR_FORM_SIZE:
168 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
169 $uploadcheck =
false;
172 case UPLOAD_ERR_PARTIAL:
173 $this->
setAlert(
$lng->txt(
"form_msg_file_partially_uploaded"));
174 $uploadcheck =
false;
177 case UPLOAD_ERR_NO_FILE:
182 $uploadcheck =
false;
187 case UPLOAD_ERR_NO_TMP_DIR:
188 $this->
setAlert(
$lng->txt(
"form_msg_file_missing_tmp_dir"));
189 $uploadcheck =
false;
192 case UPLOAD_ERR_CANT_WRITE:
193 $this->
setAlert(
$lng->txt(
"form_msg_file_cannot_write_to_disk"));
194 $uploadcheck =
false;
197 case UPLOAD_ERR_EXTENSION:
198 $this->
setAlert(
$lng->txt(
"form_msg_file_upload_stopped_ext"));
199 $uploadcheck =
false;
206 if (!in_array(strtolower($suffix), $this->
getSuffixes())) {
207 $this->
setAlert(
$lng->txt(
"form_msg_file_wrong_file_type"));
208 $uploadcheck =
false;
213 if ($pictures[
"tmp_name"][
$index] !=
"") {
215 if ($vir[0] ==
false) {
216 $this->
setAlert(
$lng->txt(
"form_msg_file_virus_found") .
"<br />" . $vir[1]);
217 $uploadcheck =
false;
239 $tpl =
new ilTemplate(
"tpl.prop_filewizardinput.html",
true,
true,
"Services/Form");
242 foreach ($this->filenames as $value) {
243 if (strlen($value)) {
244 $tpl->setCurrentBlock(
"image");
249 $tpl->parseCurrentBlock();
252 $tpl->setCurrentBlock(
"move");
253 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
254 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
256 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
259 $tpl->parseCurrentBlock();
264 $tpl->setCurrentBlock(
"row");
267 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
268 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
269 $tpl->setVariable(
"ALT_ADD",
$lng->txt(
"add"));
270 $tpl->setVariable(
"ALT_REMOVE",
$lng->txt(
"remove"));
274 " disabled=\"disabled\"" 278 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
284 $tpl->parseCurrentBlock();
289 $a_tpl->setCurrentBlock(
"prop_generic");
290 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
291 $a_tpl->parseCurrentBlock();
294 $main_tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
295 $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