Index: sandbox/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1841)
+++ sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1854)
@@ -94,4 +94,5 @@
 move to:	filemanager	pt-br	Mover para:
 Files moved to %1 successfuly	filemanager	pt-br	Arquivos movidos para %1 com sucesso
+Archive	filemanager	pt-br	Arquivar
 no files in this directory.	filemanager	pt-br	Nenhum arquivo nesse diretório
 no version history for this file/directory	filemanager	pt-br	Sem histórico de versão para este arquivo/pasta
@@ -153,4 +154,7 @@
 Impossible to edit this file	filemanager	pt-br	Impossível editar o arquivo selecionado
 Your quota has exceeded the limit	filemanager	pt-br	Sua cota excedeu o limite
+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
+Please, retype your password	filemanager	pt-br	Por favor, redigite sua senha
+passwords are differents	filemanager	pt-br	as senhas diferem
 Enter with the name of new file/directory	filemanager	pt-br	Insira o nome do novo arquivo/diretório
 File extension forbidden or invalid file	filemanager	pt-br	Formato de arquivo inválido
Index: sandbox/filemanager/inc/class.vfs_functions.inc.php
===================================================================
--- sandbox/filemanager/inc/class.vfs_functions.inc.php	(revision 1844)
+++ sandbox/filemanager/inc/class.vfs_functions.inc.php	(revision 1854)
@@ -26,4 +26,5 @@
 			'rename'=>True,
 			'delete'=>True,
+			'archive'=>True,
 			'summary' => True
 		);
@@ -244,5 +245,8 @@
 			foreach($this->fileman as $filename)
 			{
-				if($this->verifyLock($filename,RELATIVE_ALL) && $this->bo->vfs->delete(array('string' => $filename)))
+				if($this->verifyLock($filename,RELATIVE_ALL) && $this->bo->vfs->rm(array(
+					'string' => $this->path.'/'.$filename,
+					'relatives' => array (RELATIVE_NONE)
+				)))
 				{
 					echo $filename.":";
@@ -254,4 +258,39 @@
 				}
 			}
+		}
+		function archive(){
+			foreach($this->fileman as $filename)
+			{
+				if(!$this->verifyLock($filename,RELATIVE_ALL))
+				{
+					echo "locked:".$filename;
+					return False;
+				}
+				$command .= " ".escapeshellarg($filename);
+			}
+			$zipFileName=$GLOBALS['phpgw_info']['user']['account_lid'].date("Ymd").".zip";
+			$zipFilePath=ini_get("session.save_path")."/".$zipFileName;
+			$command = $zipFilePath.$command;
+
+			if (strlen($this->pswd) > 0){
+				$command = " -P ".(base64_decode($this->pswd) ^ $this->path)." ".$command;
+			}
+
+			exec("cd ".$this->bo->vfs->basedir.$this->path.";".escapeshellcmd("nice -n19 zip -9 ".$command)."; history -c");
+
+			$this->bo->vfs->cp(array(
+				'from'=> $zipFilePath,
+				'to'=> $zipFileName,
+				'relatives'     => array(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
+			));
+			$this->bo->vfs->set_attributes(array(
+				'string'=> $zipFileName,
+				'relatives'     => array(RELATIVE_ALL),
+				'attributes'=> array(
+					'mime_type' => "application/zip"
+				)
+			));
+			exec("rm -f ".escapeshellcmd(escapeshellarg($zipFilePath)));
+			$this->delete();
 		}
 		function editComment()
Index: sandbox/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1846)
+++ sandbox/filemanager/inc/class.uifilemanager.inc.php	(revision 1854)
@@ -348,4 +348,5 @@
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/drag_area.js'></script>";
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/handler.js'></script>";
+
 			include('load_lang.php');
 
Index: sandbox/filemanager/js/draw_api.js
===================================================================
--- sandbox/filemanager/js/draw_api.js	(revision 1846)
+++ sandbox/filemanager/js/draw_api.js	(revision 1854)
@@ -68,10 +68,10 @@
 		for(j in elements)
 		{
+			var link = document.createElement( 'A' );
 			if (typeof(elements[j]['img']) != 'undefined'){
 				var img = document.createElement( 'IMG' );
 				img.src = elements[j]['img'];
-				menu.appendChild(img);
-			}
-			var link = document.createElement( 'A' );
+				link.appendChild(img);
+			}
 			link.href = elements[j]['url'];
 			link.appendChild( document.createTextNode( elements[j]['text'] ) );
@@ -464,4 +464,38 @@
 					base64_encode(currentPath)+filesUrl,handler.del);
 			break;
+		case 'archive':
+			filesUrl = "";
+			var one_checked = false;
+			files=document.getElementsByName('fileman');
+			var j=0;
+			for (i = 0; i <  files.length; i++)
+				if (files[i].checked){
+					one_checked = true;
+					filesUrl += "&fileman["+j+"]="+files[i].value;
+					j++;
+				}
+			if (!one_checked)
+			{
+				write_msg(get_lang('Please select a file'));
+				return;
+			}
+			password = prompt(get_lang('Please, type a strong password (suggestion: at least 8 characters, letters and numbers) or leave it empty to archive only'));
+			if (password.length > 0)
+			{
+				password2 = prompt(get_lang('Please, retype your password'));
+				if (password != password2)
+				{
+					alert(get_lang('Error:')+get_lang('passwords are differents'));
+					return;
+				}
+			}
+			// TODO use DES, or something strong
+			pswd = "";
+			for (var i=0;i < password.length; i++)
+			{
+				pswd += String.fromCharCode(password.charCodeAt(i) ^ currentPath.charCodeAt(i));
+			}
+			cExecute('./index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive);
+			break;
 		case 'move_to':
 		case 'copy_to':
@@ -529,4 +563,8 @@
 			elements[4]['url'] = "javascript:EditColumns()";
 			elements[4]['img'] = templatePath+'images/editpaste.png';
+			elements[5] = new Array();
+			elements[5]['text'] = get_lang('Archive');
+			elements[5]['url'] = "javascript:toolbar.control('archive')";
+			elements[5]['img'] = templatePath+'images/button_zip.png';
 			draw_menu(arg,elements);
 			break;
Index: sandbox/filemanager/js/handler.js
===================================================================
--- sandbox/filemanager/js/handler.js	(revision 1846)
+++ sandbox/filemanager/js/handler.js	(revision 1854)
@@ -85,4 +85,7 @@
                 write_error("Could not mark as restricted");
 }
+handler.prototype.archive = function(data) {
+	toolbar.control('reload');
+}
 
 var handler = new handler();
