Changeset 1223
- Timestamp:
- 08/23/07 11:20:59 (1 year ago)
- Files:
-
- devel/mod/file/lib/edit_folder.php (modified) (4 diffs)
- devel/mod/file/lib/files_actions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/mod/file/lib/edit_folder.php
r1114 r1223 192 192 END; 193 193 194 $title = __gettext("Upload a file");194 $title = __gettext("Upload files"); 195 195 196 196 $body = <<< END … … 210 210 $body .= sprintf(__gettext("Used space: %s Mb."),round(($usedquota / 1000000),4)); 211 211 } 212 $fileLabel = __gettext("File to upload:"); //gettext variable213 $fileTitle = __gettext(" File title:"); //gettext variable214 $fileDesc = __gettext("File Description:"); //gettext variable212 $fileLabel = __gettext("Files to upload:"); //gettext variable 213 $fileTitle = __gettext("Title for files:"); //gettext variable 214 $fileDesc = __gettext("File description:"); //gettext variable 215 215 $fileAccess = __gettext("Access restrictions:"); //gettext variable 216 216 $body .= <<< END … … 223 223 </p></td> 224 224 <td><p> 225 <input name="new_file" id="new_file" type="file" /> 225 <input name="new_file1" id="new_file1" type="file" /><br /> 226 <input name="new_file2" id="new_file1" type="file" /><br /> 227 <input name="new_file3" id="new_file1" type="file" /><br /> 228 <input name="new_file4" id="new_file1" type="file" /><br /> 229 <input name="new_file5" id="new_file1" type="file" /> 226 230 </p></td> 227 231 </tr> … … 283 287 $body .= run("metadata:edit"); 284 288 285 $copyright = __gettext("By checking this box, you are asserting that you have the legal right to share th is file, and that you understand you are sharing it with other users of the system."); //gettext variable289 $copyright = __gettext("By checking this box, you are asserting that you have the legal right to share these uploaded files, and that you understand you are sharing it with other users of the system."); //gettext variable 286 290 $upload = __gettext("Upload"); //gettext variable 287 291 $body .= <<< END devel/mod/file/lib/files_actions.php
r1119 r1223 60 60 $max_quota = user_info('file_quota',$page_owner); 61 61 $maxbytes = $max_quota - $total_quota; 62 $um = new upload_manager('new_file',false,true,false,$maxbytes,true); 62 // $um = new upload_manager('new_file',false,true,true,$maxbytes,true); 63 $um = new upload_manager('',false,true,true,$maxbytes,true); 63 64 $reldir = "files/" . $upload_folder . "/" . $ul_username . "/"; 64 65 $dir = $CFG->dataroot .$reldir; 65 66 if ($um->process_file_uploads($dir)) { 66 $f = new StdClass; 67 $f->owner = $USER->ident; 68 $f->files_owner = $page_owner; 69 $f->folder = $folderid; 70 $f->originalname = $um->get_original_filename(); 71 $f->title = $title; 72 $f->description = $description; 73 $f->location = $reldir . $um->get_new_filename(); 74 $f->access = $access; 75 $f->size = $um->get_filesize(); 76 $f->time_uploaded = time(); 77 $f = plugin_hook("file","create",$f); 78 if (!empty($f)) { 79 $file_id = insert_record('files',$f); 80 $f->ident = $file_id; 81 $value = trim(optional_param('new_file_keywords')); 82 insert_tags_from_string ($value, 'file', $file_id, $access, $page_owner); 83 $metadata = optional_param('metadata'); 84 if (is_array($metadata)) { 85 foreach($metadata as $name => $value) { 86 $m = new StdClass; 87 $m->name = trim($name); 88 $m->value = trim($value); 89 $m->file_id = $file_id; 90 insert_record('file_metadata',$m); 67 foreach($um->files as $file) { 68 if ($file['error'] == 0) { 69 $f = new StdClass; 70 $f->owner = $USER->ident; 71 $f->files_owner = $page_owner; 72 $f->folder = $folderid; 73 $f->originalname = $file['originalname']; 74 $f->title = $title; 75 $f->description = $description; 76 $f->location = $reldir . $file['name']; 77 $f->access = $access; 78 $f->size = $file['size']; 79 $f->time_uploaded = time(); 80 $f = plugin_hook("file","create",$f); 81 if (!empty($f)) { 82 $file_id = insert_record('files',$f); 83 $f->ident = $file_id; 84 $value = trim(optional_param('new_file_keywords')); 85 insert_tags_from_string ($value, 'file', $file_id, $access, $page_owner); 86 $metadata = optional_param('metadata'); 87 if (is_array($metadata)) { 88 foreach($metadata as $name => $value) { 89 $m = new StdClass; 90 $m->name = trim($name); 91 $m->value = trim($value); 92 $m->file_id = $file_id; 93 insert_record('file_metadata',$m); 94 } 95 } 96 plugin_hook("file","publish",$f); 97 $rssresult = run("files:rss:publish", array($page_owner, false)); 98 $rssresult = run("profile:rss:publish", array($page_owner, false)); 99 $messages[] = __gettext("{$f->originalname} was successfully uploaded."); 91 100 } 92 101 } 93 plugin_hook("file","publish",$f);94 $rssresult = run("files:rss:publish", array($page_owner, false));95 $rssresult = run("profile:rss:publish", array($page_owner, false));96 $messages[] = __gettext("The file was successfully uploaded.");97 102 } 98 103 } else {
