Changeset 4915 for branches/2.2
- Timestamp:
- 08/09/11 17:14:05 (13 years ago)
- Location:
- branches/2.2/filemanager
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/filemanager/inc/after_upload.php
r3610 r4915 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 -
branches/2.2/filemanager/inc/class.uifilemanager.inc.php
r4228 r4915 582 582 $return['files'] = $output; 583 583 $return['quota']['quotaSize'] = ($quota * 1024 * 1024); 584 //echo serialize(htmlspecialchars_decode(htmlentities($return))); 584 585 echo serialize($return); 585 586 } … … 609 610 $return[] = $dir['directory'] . $dir['name']; 610 611 sort(&$return, SORT_STRING); 612 611 613 echo serialize($return); 612 614 } … … 752 754 } 753 755 754 function createdir() { 756 function createdir() 757 { 755 758 if ($this->bo->badchar = $this->bo->bad_chars($this->filename, True, True)) { 756 759 echo lang('Error:') . $this->bo->html_encode(lang('Directory names cannot contain "%1"', $badchar), 1); … … 771 774 $fileinfo = $ls_array[0]; 772 775 773 if ($fileinfo['name']) { 776 if ($fileinfo['name']) 777 { 774 778 if ($fileinfo['mime_type'] != 'Directory') { 775 779 echo lang('Error:') . lang('%1 already exists as a file', $fileinfo['name']); … … 777 781 echo lang('Error:') . lang('Directory %1 already exists', $fileinfo['name']); 778 782 } 779 } else { 783 } 784 else 785 { 780 786 $this->bo->vfs->cd(array('string' => $this->path, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 781 787 782 if ($this->bo->vfs->mkdir(array('string' => $this->filename))) { 783 echo lang('Created directory %1', $this->disppath . '/' . $this->filename); 784 } else { 788 if ($this->bo->vfs->mkdir(array('string' => $this->filename))) 789 { 790 echo "True"; 791 //echo lang('Created directory %1', $this->disppath . '/' . $this->filename); 792 } 793 else 794 { 785 795 echo lang('Error:') . lang('Could not create %1', $this->disppath . '/' . $this->filename); 786 796 } 787 797 } 788 echo lang('Directory created');798 789 799 } 790 800 -
branches/2.2/filemanager/inc/load_lang.php
r3873 r4915 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 ?> -
branches/2.2/filemanager/inc/upload.php
r3897 r4915 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 ); … … 191 191 ))) 192 192 { 193 193 $bo->vfs->set_attributes(array( 194 194 'string' => $_FILES['upload_file']['name'][$i], 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 )); -
branches/2.2/filemanager/inc/uploadApp.php
r3894 r4915 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 -
branches/2.2/filemanager/js/drag_area.js
r3436 r4915 19 19 20 20 counter = 0; 21 DragArea.prototype.dragObj = function(e){ 21 DragArea.prototype.dragObj = function(e) 22 { 22 23 var _event = is_ie ? window.event : e; 23 24 var _target = is_ie ? _event.srcElement : _event.target; -
branches/2.2/filemanager/js/draw_api.js
r3936 r4915 410 410 var contentQuota = document.getElementById('content_quota'); 411 411 if (contentQuota != null) 412 contentQuota.innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background=". ./phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+borkb(usedSpace)+'/'+borkb(quotaSize)+')</span></td></tr></tbody></table></td></tr></table>';412 contentQuota.innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background="./phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+borkb(usedSpace)+'/'+borkb(quotaSize)+')</span></td></tr></tbody></table></td></tr></table>'; 413 413 } 414 414 } … … 820 820 821 821 var parentDir_en = base64_encode( parentDir ); 822 cExecute_('./index.php?menuaction=filemanager.uifilemanager.createdir&path=' 823 + parentDir_en+'&filename='+base64_encode(name), handler.refreshDir); 822 var _action = './index.php?menuaction=filemanager.uifilemanager.createdir&path='+ parentDir_en+'&filename='+base64_encode(name); 823 824 cExecute_( _action , handler.refreshDir ); 824 825 825 826 currentPath = parentDir + '/' + name; … … 836 837 Dfolder.replace(my_home_filemanager, get_lang("My folder"))), '') ) 837 838 { 839 838 840 var Dfolder_en = base64_encode( Dfolder ); 839 840 cExecute_( './index.php?menuaction=filemanager.uifilemanager.removedir&path=' + Dfolder_en ,handler.refreshDir );841 var _action = './index.php?menuaction=filemanager.uifilemanager.removedir&path=' + Dfolder_en; 842 cExecute_( _action , handler.refreshDir ); 841 843 var lastIndex = Dfolder.lastIndexOf('/'); 842 844 currentPath = Dfolder.substr(0,lastIndex); … … 871 873 { 872 874 'lang_new_folder' : get_lang('new folder'), 873 'lang_remove_folder' 875 'lang_remove_folder' : get_lang('remove folder'), 874 876 'path_filemanager' : path_filemanager, 875 'onclick_new_folder' 877 'onclick_new_folder' : 'editFolders("new")', 876 878 'onclick_remove_folder' : 'editFolders("remove")' 877 879 }; -
branches/2.2/filemanager/js/handler.js
r3924 r4915 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 129 132 function moveto(data) 130 133 { 131 returnVal = data.split('|'); 134 var returnVal = data.split('|'); 135 132 136 if (returnVal[0] == 'NODIR') 137 { 133 138 write_error(get_lang('Could not copy file because no destination directory is given')); 134 else if(returnVal[0] == 'SOMEERROR'){ 135 write_error(get_lang('Could not move %1 file(s)',returnVal[1])); 136 } 137 else if(returnVal[0] == 'MOVED'){ 138 if (returnVal[1] == 1) 139 write_msg(get_lang('File moved successfuly')); 140 else 141 write_msg(get_lang('%1 files moved successfuly', returnVal[1])); 142 } 143 handler.refreshDir(); 139 } 140 else if( returnVal[0] == 'SOMEERROR' ) 141 { 142 write_error( get_lang('Could not move %1 file(s)',returnVal[1]) ); 143 } 144 else if( returnVal[0] == 'MOVED') 145 { 146 if ( returnVal[1] == 1 ) 147 { 148 write_msg( get_lang('File moved successfuly') ); 149 toolbar.control('reload'); 150 } 151 else 152 { 153 write_msg( get_lang('%1 files moved successfuly', returnVal[1]) ); 154 } 155 } 144 156 } 145 157 146 158 function refreshDir(data) 147 159 { 148 cExecute_('./index.php?menuaction=filemanager.uifilemanager.get_folders_list', handler.draw_folders_list); 160 if( data.toString() === "True" ) 161 { 162 var _action = './index.php?menuaction=filemanager.uifilemanager.get_folders_list'; 163 164 cExecute_( _action , draw_folders_list ); 165 } 166 else 167 { 168 write_msg( data ); 169 } 149 170 } 150 171 … … 342 363 handler.prototype.draw_folders_list = draw_folders_list; 343 364 handler.prototype.moveto = moveto; 344 handler.prototype.refreshDir 365 handler.prototype.refreshDir = refreshDir; 345 366 handler.prototype.rename = rename; 346 handler.prototype.restricted 347 handler.prototype.updateComment = updateComment;367 handler.prototype.restricted = restricted; 368 handler.prototype.updateComment = updateComment; 348 369 handler.prototype.upload = upload; 349 370 -
branches/2.2/filemanager/js/main.js
r3019 r4915 1 2
Note: See TracChangeset
for help on using the changeset viewer.