4 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
24 return self::$uniqueInc++;
46 $this->archive_suffixes = $a_suffixes;
61 $this->submit_button_name = $a_submit_name;
62 $this->cancel_button_name = $a_cancel_name;
72 $quota_exceeded = $quota_legend =
false;
73 if(self::$check_wsp_quota)
75 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
78 $lng->loadLanguageModule(
"file");
79 return $lng->txt(
"personal_workspace_quota_exceeded_warning");
91 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
95 $this->tpl =
new ilTemplate(
"tpl.prop_dndfiles.html",
true,
true,
"Services/Form");
98 $this->tpl->setVariable(
"UPLOAD_ID", $this->uniqueId);
102 $this->tpl->setVariable(
"TXT_SHOW_ALL_DETAILS", $lng->txt(
'show_all_details'));
103 $this->tpl->setVariable(
"TXT_HIDE_ALL_DETAILS", $lng->txt(
'hide_all_details'));
104 $this->tpl->setVariable(
"TXT_SELECTED_FILES", $lng->txt(
'selected_files'));
105 $this->tpl->setVariable(
"TXT_DRAG_FILES_HERE", $lng->txt(
'drag_files_here'));
106 $this->tpl->setVariable(
"TXT_NUM_OF_SELECTED_FILES", $lng->txt(
'num_of_selected_files'));
107 $this->tpl->setVariable(
"TXT_SELECT_FILES_FROM_COMPUTER", $lng->txt(
'select_files_from_computer'));
108 $this->tpl->setVariable(
"TXT_OR", $lng->txt(
'logic_or'));
112 $this->tpl->setCurrentBlock(
"max_size");
113 $this->tpl->setVariable(
"TXT_MAX_SIZE", $lng->txt(
"file_notice").
" ".$this->
getMaxFileSizeString());
114 $this->tpl->parseCurrentBlock();
118 $this->tpl->setVariable(
"TXT_MAX_SIZE", $quota_legend);
119 $this->tpl->parseCurrentBlock();
125 $upload =
new ilFileUploadGUI(
"ilFileUploadDropZone_" . $this->uniqueId, $this->uniqueId,
false);
126 $upload->enableFormSubmit(
"ilFileUploadInput_" . $this->uniqueId, $this->submit_button_name, $this->cancel_button_name);
127 $upload->setDropAreaId(
"ilFileUploadDropArea_" . $this->uniqueId);
128 $upload->setFileListId(
"ilFileUploadList_" . $this->uniqueId);
129 $upload->setFileSelectButtonId(
"ilFileUploadFileSelect_" . $this->uniqueId);
131 $this->tpl->setVariable(
"FILE_UPLOAD", $upload->getHTML());
133 return $this->tpl->get();
149 $this->
setAlert($lng->txt(
"form_msg_file_size_exceeds"));
156 $this->
setAlert($lng->txt(
"error_upload_was_zero_bytes"));
179 if (is_array($suffixes) && count($suffixes) > 0)
181 foreach($suffixes as $suffix)
183 $list .= $delim .
"." . $suffix;
195 if (is_array($suffixes) && count($suffixes) > 0)
197 foreach($suffixes as $suffix)
199 $list .= $delim .
"\"" . $suffix .
"\"";
210 $umf = ini_get(
"upload_max_filesize");
212 $pms = ini_get(
"post_max_size");
215 $multiplier_a=array(
"K"=>1024,
"M"=>1024*1024,
"G"=>1024*1024*1024);
217 $umf_parts=preg_split(
"/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
218 $pms_parts=preg_split(
"/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
220 if (count($umf_parts) == 2) {
221 $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]];
223 if (count($pms_parts) == 2) {
224 $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]];
228 $max_filesize = min($umf, $pms);
231 $max_filesize=max($umf, $pms);
233 return $max_filesize;