Changeset 1854
- Timestamp:
- 12/16/09 16:05:13 (14 years ago)
- Location:
- sandbox/filemanager
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.uifilemanager.inc.php
r1846 r1854 348 348 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/drag_area.js'></script>"; 349 349 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/handler.js'></script>"; 350 350 351 include('load_lang.php'); 351 352 -
sandbox/filemanager/inc/class.vfs_functions.inc.php
r1844 r1854 26 26 'rename'=>True, 27 27 'delete'=>True, 28 'archive'=>True, 28 29 'summary' => True 29 30 ); … … 244 245 foreach($this->fileman as $filename) 245 246 { 246 if($this->verifyLock($filename,RELATIVE_ALL) && $this->bo->vfs->delete(array('string' => $filename))) 247 if($this->verifyLock($filename,RELATIVE_ALL) && $this->bo->vfs->rm(array( 248 'string' => $this->path.'/'.$filename, 249 'relatives' => array (RELATIVE_NONE) 250 ))) 247 251 { 248 252 echo $filename.":"; … … 254 258 } 255 259 } 260 } 261 function archive(){ 262 foreach($this->fileman as $filename) 263 { 264 if(!$this->verifyLock($filename,RELATIVE_ALL)) 265 { 266 echo "locked:".$filename; 267 return False; 268 } 269 $command .= " ".escapeshellarg($filename); 270 } 271 $zipFileName=$GLOBALS['phpgw_info']['user']['account_lid'].date("Ymd").".zip"; 272 $zipFilePath=ini_get("session.save_path")."/".$zipFileName; 273 $command = $zipFilePath.$command; 274 275 if (strlen($this->pswd) > 0){ 276 $command = " -P ".(base64_decode($this->pswd) ^ $this->path)." ".$command; 277 } 278 279 exec("cd ".$this->bo->vfs->basedir.$this->path.";".escapeshellcmd("nice -n19 zip -9 ".$command)."; history -c"); 280 281 $this->bo->vfs->cp(array( 282 'from'=> $zipFilePath, 283 'to'=> $zipFileName, 284 'relatives' => array(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) 285 )); 286 $this->bo->vfs->set_attributes(array( 287 'string'=> $zipFileName, 288 'relatives' => array(RELATIVE_ALL), 289 'attributes'=> array( 290 'mime_type' => "application/zip" 291 ) 292 )); 293 exec("rm -f ".escapeshellcmd(escapeshellarg($zipFilePath))); 294 $this->delete(); 256 295 } 257 296 function editComment() -
sandbox/filemanager/js/draw_api.js
r1846 r1854 68 68 for(j in elements) 69 69 { 70 var link = document.createElement( 'A' ); 70 71 if (typeof(elements[j]['img']) != 'undefined'){ 71 72 var img = document.createElement( 'IMG' ); 72 73 img.src = elements[j]['img']; 73 menu.appendChild(img); 74 } 75 var link = document.createElement( 'A' ); 74 link.appendChild(img); 75 } 76 76 link.href = elements[j]['url']; 77 77 link.appendChild( document.createTextNode( elements[j]['text'] ) ); … … 464 464 base64_encode(currentPath)+filesUrl,handler.del); 465 465 break; 466 case 'archive': 467 filesUrl = ""; 468 var one_checked = false; 469 files=document.getElementsByName('fileman'); 470 var j=0; 471 for (i = 0; i < files.length; i++) 472 if (files[i].checked){ 473 one_checked = true; 474 filesUrl += "&fileman["+j+"]="+files[i].value; 475 j++; 476 } 477 if (!one_checked) 478 { 479 write_msg(get_lang('Please select a file')); 480 return; 481 } 482 password = prompt(get_lang('Please, type a strong password (suggestion: at least 8 characters, letters and numbers) or leave it empty to archive only')); 483 if (password.length > 0) 484 { 485 password2 = prompt(get_lang('Please, retype your password')); 486 if (password != password2) 487 { 488 alert(get_lang('Error:')+get_lang('passwords are differents')); 489 return; 490 } 491 } 492 // TODO use DES, or something strong 493 pswd = ""; 494 for (var i=0;i < password.length; i++) 495 { 496 pswd += String.fromCharCode(password.charCodeAt(i) ^ currentPath.charCodeAt(i)); 497 } 498 cExecute('./index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 499 break; 466 500 case 'move_to': 467 501 case 'copy_to': … … 529 563 elements[4]['url'] = "javascript:EditColumns()"; 530 564 elements[4]['img'] = templatePath+'images/editpaste.png'; 565 elements[5] = new Array(); 566 elements[5]['text'] = get_lang('Archive'); 567 elements[5]['url'] = "javascript:toolbar.control('archive')"; 568 elements[5]['img'] = templatePath+'images/button_zip.png'; 531 569 draw_menu(arg,elements); 532 570 break; -
sandbox/filemanager/js/handler.js
r1846 r1854 85 85 write_error("Could not mark as restricted"); 86 86 } 87 handler.prototype.archive = function(data) { 88 toolbar.control('reload'); 89 } 87 90 88 91 var handler = new handler(); -
sandbox/filemanager/setup/phpgw_pt-br.lang
r1841 r1854 94 94 move to: filemanager pt-br Mover para: 95 95 Files moved to %1 successfuly filemanager pt-br Arquivos movidos para %1 com sucesso 96 Archive filemanager pt-br Arquivar 96 97 no files in this directory. filemanager pt-br Nenhum arquivo nesse diretório 97 98 no version history for this file/directory filemanager pt-br Sem histórico de versão para este arquivo/pasta … … 153 154 Impossible to edit this file filemanager pt-br Impossível editar o arquivo selecionado 154 155 Your quota has exceeded the limit filemanager pt-br Sua cota excedeu o limite 156 Please, type a strong password (suggestion: at least 8 characters, letters and numbers) or leave it empty to archive only filemanager pt-br Por favor, digite uma senha segura (sugestão: pelo menos 8 caracteres com letras e números) ou deixe o campo vazio para somente arquivar 157 Please, retype your password filemanager pt-br Por favor, redigite sua senha 158 passwords are differents filemanager pt-br as senhas diferem 155 159 Enter with the name of new file/directory filemanager pt-br Insira o nome do novo arquivo/diretório 156 160 File extension forbidden or invalid file filemanager pt-br Formato de arquivo inválido
Note: See TracChangeset
for help on using the changeset viewer.