Changeset 5327
- Timestamp:
- 01/09/12 09:17:50 (12 years ago)
- Location:
- trunk/filemanager
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/filemanager/inc/after_upload.php
r3610 r5327 21 21 include_once("../../header.inc.php"); 22 22 23 24 function convert_char( $String ) 25 { 26 $String = trim( str_replace( "\'", "", $String) ); 27 $String = str_replace( "'", "", $String ); 28 $String = str_replace( "ç", "c", $String ); 29 $String = str_replace( "Ã", "C", $String ); 30 $String = ereg_replace( "[áà âã]", "a", $String ); 31 $String = ereg_replace( "[ÃÃÃÃ]", "A", $String ); 32 $String = ereg_replace( "[éÚê]", "e", $String ); 33 $String = ereg_replace( "[ÃÃÃ]", "E", $String ); 34 $String = ereg_replace( "[Ãìîï]", "i", $String ); 35 $String = ereg_replace( "[ÃÃÃ]", "I", $String ); 36 $String = ereg_replace( "[óòÎõ]", "o", $String ); 37 $String = ereg_replace( "[ÃÃÃÃ]", "O", $String ); 38 $String = ereg_replace( "[úùû]", "u", $String ); 39 $String = ereg_replace( "[ÃÃÃ]", "U", $String ); 40 41 return $String; 42 } 43 23 44 $bo = CreateObject('filemanager.bofilemanager'); 24 45 25 foreach ($files as $f) { 26 if ($bo->vfs->cp(array( 27 'from'=> $f['fullName'], 28 'to'=> $f['name'], 29 'relatives' => array(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) 30 ))) 46 foreach ($files as $f) 47 { 48 $newName = convert_char( $f['name'] ); 49 50 $_array = array( 51 'from' => $f['fullName'], 52 'to' => $newName, 53 'relatives' => array(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) 54 ); 55 56 if ( $bo->vfs->cp($_array) ) 57 { 58 $bo->vfs->set_attributes(array( 59 'string' => $newName, 60 'relatives' => array( RELATIVE_ALL ), 61 'attributes' => array( 'mime_type' => $f['mimetype'] ) 62 )); 63 64 $fullName = $f['fullName']; 65 66 if( file_exists($fullName) ) 31 67 { 32 $bo->vfs->set_attributes(array( 33 'string'=> $f['name'], 34 'relatives' => array(RELATIVE_ALL), 35 'attributes'=> array( 36 'mime_type' => $f['mimetype'] 37 ) 38 )); 39 exec("rm -f ".escapeshellcmd(escapeshellarg($f['fullName']))); 68 exec("rm -f ".escapeshellcmd(escapeshellarg($fullName))); 40 69 } 70 } 41 71 } 42 72 -
trunk/filemanager/inc/class.uifilemanager.inc.php
r5323 r5327 568 568 else 569 569 $tuple['icon'] = $this->mime_icon($files['mime_type']); 570 $tuple['type'] = $files['type']; 571 $tuple['created'] = $this->vfs_functions->dateString2timeStamp($files['created']); 572 $tuple['modified'] = $this->vfs_functions->dateString2timeStamp($files['modified']); 573 $tuple['size'] = $files['size']; 574 $tuple['mime_type'] = $files['mime_type']; 575 $tuple['pub'] = $files['type']; 576 $tuple['createdby_id'] = $GLOBALS['phpgw']->accounts->id2name($files['createdby_id']); 570 571 $tuple['type'] = $files['type']; 572 $tuple['created'] = $this->vfs_functions->dateString2timeStamp($files['created']); 573 $tuple['modified'] = ( $files['modified'] != "" ) ? $this->vfs_functions->dateString2timeStamp($files['modified']) : ""; 574 $tuple['size'] = $files['size']; 575 $tuple['mime_type'] = $files['mime_type']; 576 $tuple['pub'] = $files['type']; 577 $tuple['createdby_id'] = $GLOBALS['phpgw']->accounts->id2name($files['createdby_id']); 577 578 $tuple['modifiedby_id'] = $files['modifiedby_id'] ? $GLOBALS['phpgw']->accounts->id2name($files['modifiedby_id']) : ''; 578 $tuple['owner'] = $GLOBALS['phpgw']->accounts->id2name($files['owner_id']); 579 $tuple['comment'] = $files['comment']; 580 $tuple['version'] = $files['version']; 579 $tuple['owner'] = $GLOBALS['phpgw']->accounts->id2name($files['owner_id']); 580 $tuple['comment'] = $files['comment']; 581 $tuple['version'] = $files['version']; 582 581 583 $output[] = $tuple; 582 584 } … … 610 612 $return[] = $dir['directory'] . $dir['name']; 611 613 sort(&$return, SORT_STRING); 614 612 615 echo serialize($return); 613 616 } … … 753 756 } 754 757 755 function createdir() { 758 function createdir() 759 { 756 760 if ($this->bo->badchar = $this->bo->bad_chars($this->filename, True, True)) { 757 761 echo lang('Error:') . $this->bo->html_encode(lang('Directory names cannot contain "%1"', $badchar), 1); … … 772 776 $fileinfo = $ls_array[0]; 773 777 774 if ($fileinfo['name']) { 778 if ($fileinfo['name']) 779 { 775 780 if ($fileinfo['mime_type'] != 'Directory') { 776 781 echo lang('Error:') . lang('%1 already exists as a file', $fileinfo['name']); … … 778 783 echo lang('Error:') . lang('Directory %1 already exists', $fileinfo['name']); 779 784 } 780 } else { 785 } 786 else 787 { 781 788 $this->bo->vfs->cd(array('string' => $this->path, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 782 789 783 if ($this->bo->vfs->mkdir(array('string' => $this->filename))) { 784 echo lang('Created directory %1', $this->disppath . '/' . $this->filename); 785 } else { 790 if ($this->bo->vfs->mkdir(array('string' => $this->filename))) 791 { 792 echo "True"; 793 //echo lang('Created directory %1', $this->disppath . '/' . $this->filename); 794 } 795 else 796 { 786 797 echo lang('Error:') . lang('Could not create %1', $this->disppath . '/' . $this->filename); 787 798 } 788 799 } 789 echo lang('Directory created');800 790 801 } 791 802 -
trunk/filemanager/inc/load_lang.php
r3873 r5327 25 25 } 26 26 27 echo "var array_lang = new Array(); \n$script";27 echo "var array_lang = new Array();\n{$script}"; 28 28 29 29 ?> -
trunk/filemanager/inc/upload.php
r3897 r5327 33 33 $path = $_POST['path']; 34 34 $notifUser = $_POST['notifTo']; 35 $show_upload_boxes = count($_FILES['upload_file']['name']);36 $filesUpload 35 $show_upload_boxes = count($_FILES['upload_file']['name']); 36 $filesUpload = $_FILES['upload_file']; 37 37 38 38 function create_summaryImage($file) … … 121 121 { 122 122 $badchar = $bo->bad_chars( $_FILES['upload_file']['name'][$i], True, True ); 123 123 124 124 if( $badchar ) 125 125 { … … 165 165 $bo->vfs->cp($tmp_arr); 166 166 $tmp_arr=array( 167 'string' => $_FILES['upload_file']['name'][$i],168 'relatives' => array(RELATIVE_ALL),167 'string' => $_FILES['upload_file']['name'][$i], 168 'relatives' => array(RELATIVE_ALL), 169 169 'attributes' => array( 170 'owner_id'=> $bo->userinfo['username'],171 172 'size'=> $_FILES['upload_file']['size'][$i],173 'mime_type'=> $_FILES['upload_file']['type'][$i],174 'deleteable'=> 'Y',175 'comment'=> stripslashes($_POST['upload_comment'][$i])170 'owner_id' => $bo->userinfo['username'], 171 'modifiedby_id' => $bo->userinfo['username'], 172 'size' => $_FILES['upload_file']['size'][$i], 173 'mime_type' => $_FILES['upload_file']['type'][$i], 174 'deleteable' => 'Y', 175 'comment' => stripslashes($_POST['upload_comment'][$i]) 176 176 ) 177 177 ); … … 195 195 'relatives' => array(RELATIVE_ALL), 196 196 'attributes' => array( 197 198 197 'mime_type' => $_FILES['upload_file']['type'][$i], 198 'comment' => stripslashes($_POST['upload_comment'][$i]) 199 199 ) 200 200 )); … … 218 218 $bo->vfs->set_attributes(array( 219 219 'string' => $_FILES['upload_file']['name'][$i], 220 'relatives' => array(RELATIVE_ALL),220 'relatives' => array(RELATIVE_ALL), 221 221 'attributes' => array( 222 223 222 'mime_type' => $_FILES['upload_file']['type'][$i], 223 'comment' => stripslashes($_POST['upload_comment'][$i]) 224 224 ) 225 225 )); -
trunk/filemanager/inc/uploadApp.php
r3894 r5327 34 34 'maxFileSize' => $maxFileSize, 35 35 'maxChunkSize' => $maxChunkSize, 36 'archive' 37 'afterUploadURL' 36 'archive' => '../tp/juploader/wjhk.jupload.jar', 37 'afterUploadURL' => 'after_upload.php', 38 38 'sendMD5Sum' => 'true', 39 'showLogWindow' => 'false',40 'debugLevel' 39 'showLogWindow' => 'false', 40 'debugLevel' => 0 41 41 ); 42 42 43 43 $classParameters = array( 44 'demo_mode' => false,44 'demo_mode' => false, 45 45 'allow_subdirs' => true, 46 'destdir' 46 'destdir' => '/tmp' //Where to store the files on the webserver 47 47 ); 48 48 -
trunk/filemanager/js/draw_api.js
r5038 r5327 351 351 var midnight = Date.parse(now.toDateString()); 352 352 var dtString = ""; 353 if (preferences.created =='1') { 354 var created = new Date(); 355 created.setTime(file.created*1000); 356 if (created.getTime() > midnight) 357 if (created.getMinutes() < 10 ) 358 dtString = created.getHours()+":0"+created.getMinutes(); 359 else 360 dtString = created.getHours()+":"+created.getMinutes(); 361 else { 362 dtString = (created.getDate() < 10) ? "0"+created.getDate()+"/" : created.getDate()+"/"; 363 dtString += (created.getMonth() < 9) ? "0" : ""; 364 dtString += (created.getMonth()+1)+"/"+created.getFullYear(); 365 } 366 retBuff += fl.td+dtString+'</td>'; 367 } 368 if (preferences.modified =='1'){ 369 var modified = new Date(); 370 modified.setTime(file.modified*1000); 371 if (file.modified != "") 372 if (modified.getTime() > midnight) 373 if (modified.getMinutes() < 10) 374 dtString = modified.getHours()+":0"+modified.getMinutes(); 375 else 376 dtString = modified.getHours()+":"+modified.getMinutes(); 377 else { 378 dtString = (modified.getDate() < 10) ? "0"+modified.getDate()+"/" : modified.getDate()+"/"; 379 dtString += (modified.getMonth() < 9) ? "0" : ""; 380 dtString += (modified.getMonth()+1)+"/"+modified.getFullYear(); 381 } 382 else 383 dtString = ""; 384 retBuff += fl.td+dtString+'</td>'; 353 354 if (preferences.created =='1') 355 { 356 retBuff += fl.td+file.created+'</td>'; 357 } 358 359 if ( preferences.modified =='1' ) 360 { 361 retBuff += fl.td+file.modified+'</td>'; 385 362 } 386 363 if (preferences.owner =='1'){ … … 521 498 522 499 } 523 toolbar.prototype.getCheckedFiles = function () { 500 501 toolbar.prototype.getCheckedFiles = function() 502 { 524 503 filesUrl = ""; 525 504 var one_checked = false; 526 files=document.getElementsByName('fileman');505 var files = document.getElementsByName('fileman'); 527 506 var j=0; 507 528 508 for (i = 0; i < files.length; i++) 529 if (files[i].checked){ 509 { 510 if (files[i].checked) 511 { 530 512 one_checked = true; 531 513 filesUrl += "&fileman["+j+"]="+base64_encode(files[i].value); 532 514 j++; 533 515 } 516 } 517 534 518 if (!one_checked) 535 519 { … … 537 521 return; 538 522 } 523 539 524 return filesUrl; 540 525 } … … 905 890 } 906 891 menu.innerHTML = content; 907 908 892 menu.style.visibility = 'visible'; 909 893 clearTimeout(menuTimeout); -
trunk/filemanager/js/handler.js
r3924 r5327 12 12 13 13 if (returnVal[0] == 'wpasswd') 14 {15 write_error(get_lang('Wrong password'));16 return;17 }18 else19 write_msg(get_lang('Your operation was successfully executed'));20 21 toolbar.control('reload');14 { 15 write_error(get_lang('Wrong password')); 16 return; 17 } 18 else 19 write_msg(get_lang('Your operation was successfully executed')); 20 21 toolbar.control('reload'); 22 22 } 23 23 … … 79 79 function draw_folders_list(data) 80 80 { 81 var contentFolders = document.getElementById('content_folders'); 82 81 83 toolbar.control('reload'); 82 84 folders_tree = new dFTree({name: 'main'}); 83 84 85 folders = unserialize(data); 85 86 87 contentFolders.innerHTML = ""; 88 86 89 var rootFold = new dNode({id:'root', caption: get_lang("Directories")}); 90 87 91 folders_tree.add(rootFold,'root'); 88 92 … … 118 122 } 119 123 120 document.getElementById('content_folders').innerHTML = ""; 121 122 folders_tree.draw(document.getElementById('content_folders')); 124 folders_tree.draw(contentFolders); 123 125 124 126 folders_tree.openTo(currentPath); 125 127 126 128 folders_tree.getNodeById(currentPath)._select(); 129 127 130 } 128 131 … … 146 149 function refreshDir(data) 147 150 { 148 cExecute_('./index.php?menuaction=filemanager.uifilemanager.get_folders_list', handler.draw_folders_list); 151 if( data.toString() === "True" ) 152 { 153 var _action = './index.php?menuaction=filemanager.uifilemanager.get_folders_list'; 154 155 cExecute_( _action , draw_folders_list ); 156 } 157 else 158 { 159 write_msg( data ); 160 } 149 161 } 150 162 … … 342 354 handler.prototype.draw_folders_list = draw_folders_list; 343 355 handler.prototype.moveto = moveto; 344 handler.prototype.refreshDir 356 handler.prototype.refreshDir = refreshDir; 345 357 handler.prototype.rename = rename; 346 handler.prototype.restricted 347 handler.prototype.updateComment = updateComment;358 handler.prototype.restricted = restricted; 359 handler.prototype.updateComment = updateComment; 348 360 handler.prototype.upload = upload; 349 361
Note: See TracChangeset
for help on using the changeset viewer.