Index: branches/2.2/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3856)
+++ branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3873)
@@ -1,5 +1,5 @@
 %1 already exists as a file	filemanager	pt-br	%1 já existe como um arquivo
-
 application	filemanager	pt-br	Aplicação
+Add	filemanager	pt-br	Adição
 Add	filemanager	pt-br	Adicionar
 Add file	filemanager	pt-br	Adicionar arquivo
@@ -33,4 +33,8 @@
 created	filemanager	pt-br	Criado
 created %1	filemanager	pt-br	Criado %1
+Edit	filemanager	pt-br	Edição
+enter the name you want to move %1 to	filemanager	pt-br	Digite o nome que você quer renomear para %1
+Enter the name of folder you want to create	filemanager	pt-br	Digite o nome da pasta que você quer criar
+Delete	filemanager	pt-br	Excluir
 You have no permission to access this file	filemanager	pt-br	Você não tem permissão para acessar este arquivo
 One of the files sent was considered infected	filemanager	pt-bt	Um dos arquivos enviados foi considerado infectado por vírus
@@ -104,4 +108,5 @@
 More files	filemanager	pt-br	Mais arquivos
 No file(s) to send	filemanager	pt-br	Sem arquivo(s) para enviar
+No permission to delete the folder %1	filemanager	pt-br	Sem permissão para excluir a pasta %1
 Notify email	filemanager	pt-br	Notificar os e-mails
 %1 files moved successfuly	filemanager	pt-br	%1 arquivos movidos com sucesso
@@ -126,4 +131,5 @@
 preview of %1	filemanager	pt-br	Visualizar %1
 Previous	filemanager	pt-br	Anterior
+private	filemanager	pt-br	Privado
 quick jump to	filemanager	pt-br	Atalho para:
 reload	filemanager	pt-br	Recarregar
@@ -131,4 +137,5 @@
 Reconstruct	filemanager	pt-br	Reconstruir
 renamed %1 to %2	filemanager	pt-br	Renomeado %1 para %2
+Read	filemanager	pt-br	Leitura
 created new %1	filemanager	pt-br	Criado novo arquivo %1
 save %1	filemanager	pt-br	Salvar %1
@@ -206,3 +213,6 @@
 The file can be accessed by: %1	filemanager	pt-br	O arquivo pode ser acessado pelo endere&ccedil;o: %1
 The following addresses will be notified	filemanager	pt-br	Os endereços abaixo serão notificados
+Users and groups	filemanager	pt-br	Usuários e grupos
 Send Notification email to:	filemanager	pt-br	Enviar email de notificação para:
+set owner	filemanager	pt-br	Redefinir Dono
+set permission	filemanager	pt-br	Definir Permissões
Index: branches/2.2/filemanager/inc/class.uiconfig.inc.php
===================================================================
--- branches/2.2/filemanager/inc/class.uiconfig.inc.php	(revision 3636)
+++ branches/2.2/filemanager/inc/class.uiconfig.inc.php	(revision 3873)
@@ -8,5 +8,5 @@
 	\**************************************************************************/
 
-require_once("load_lang.php");
+//require_once("load_lang.php");
 require_once("class.notifications.inc.php");
 
@@ -21,13 +21,13 @@
 		'folders' 			=> True,
 		'groups_users' 		=> True,		
-		'load_quota'		=> True,
+		'load_quota'			=> True,
 		'notifyUploads'		=> True,
 		'renameFolder'		=> True,
 		'removeFolder'		=> True,
 		'reconstructFolder'	=> True,
-		'search_dir'		=> True,
+		'search_dir'			=> True,
 		'set_owner'			=> True,		
 		'search_user'		=> True,
-		'set_permission'	=> True,
+		'set_permission'		=> True,
 		'update_quota'		=> True,
 		'quota'				=> True
@@ -56,13 +56,9 @@
 		$GLOBALS['phpgw']->common->phpgw_header();
 
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>";
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>";
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/config.js'></script>";
-
-
 		$this->template->set_file(array('config_list' => 'config_folders.tpl'));
 		$this->template->set_block('config_list','body','body');
 		
 		$vars = array( 
+			 			'lang_back'				=> lang('Back'),
 						'lang_directory'	=> lang('directory'),
 						'lang_search' 		=> lang('search'),
@@ -70,5 +66,6 @@
 						'lang_rename' 		=> lang('rename'),
 						'lang_create' 		=> lang('create'),
-						'lang_reconstruct' 	=> lang('reconstruct')
+						'lang_reconstruct' 	=> lang('reconstruct'),
+						'path_filemanager'	=> $GLOBALS['phpgw_info']['flags']['currentapp']
 					);
 
@@ -85,17 +82,19 @@
 		$GLOBALS['phpgw']->common->phpgw_header();
 
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>";
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>";
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/config.js'></script>";
-
 		$this->template->set_file(array('config_list' => 'config_owner.tpl'));
 		$this->template->set_block('config_list','body','body');
 		
 		$vars = array(
-						'lang_directory'		=> lang('directory'),
+						'lang_Add'				=> lang('Add'),
+						'lang_directory'			=> lang('directory'),
+						'lang_Delete'				=> lang('Delete'),
+						'lang_Edit'				=> lang('Edit'),
+						'lang_Read'				=> lang('Read'),
+						'lang_private'			=> lang('private'),		
 						'lang_search'			=> lang('search'),
 						'lang_setowner'			=> lang('set owner'),
 						'lang_setperm'			=> lang('set permission'),
-						'lang_users_and_groups'	=> lang('Users and groups')
+						'lang_users_and_groups'	=> lang('Users and groups'),
+						'path_filemanager'		=> $GLOBALS['phpgw_info']['flags']['currentapp']
 					);
 		
@@ -103,6 +102,6 @@
 		$this->template->pparse('out','body');
 
-        $GLOBALS['phpgw']->common->phpgw_footer();
-        $GLOBALS['phpgw']->common->phpgw_exit();
+		$GLOBALS['phpgw']->common->phpgw_footer();
+		$GLOBALS['phpgw']->common->phpgw_exit();
 	 }
 
@@ -151,5 +150,5 @@
 			 
 		 $this->bo = CreateObject('filemanager.bofilemanager');
-		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_POST['dir']));
 		 if (strlen($name) < 2)
 			 return false;
@@ -172,5 +171,6 @@
 			 }
 		 }
-		 return; 
+		 else
+			 echo lang("No permission to delete the folder %1", $name );
 
 	}
@@ -184,5 +184,5 @@
 			 
 		 $this->bo = CreateObject('filemanager.bofilemanager');
-		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_POST['dir']));
 		 if (strlen($name) < 2)
 			 return false;
@@ -235,8 +235,4 @@
 		$GLOBALS['phpgw']->common->phpgw_header();
 
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>";
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>";
-		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/config.js'></script>";
-
 		$this->template->set_file(array('config_list' => 'config_quota.tpl'));
 		$this->template->set_block('config_list','body','body');
@@ -245,5 +241,6 @@
 						'lang_directory' => lang('directory'),
 						'lang_save' =>lang('save'),						
-						'lang_search' => lang('search')
+						'lang_search' => lang('search'),
+						'path_filemanager'	=> $GLOBALS['phpgw_info']['flags']['currentapp']
 					);
 
@@ -365,18 +362,21 @@
 		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
 		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
-			 
+
+		 $_options = "";
+		 $query = "";
+		 
 		 $name = $GLOBALS['phpgw']->db->db_addslashes($_GET['name']);
-		 $GLOBALS['phpgw']->db->query('SELECT DISTINCT directory FROM phpgw_vfs WHERE (directory like \'%'.$name.'%\') LIMIT 20',__LINE__,__FILE__);
-		 while ($GLOBALS['phpgw']->db->next_record()){
+		 
+		 $query = 'SELECT directory,name from phpgw_vfs WHERE directory = \'/home\' and name like \'%'.$name.'%\' LIMIT 1';
+		 
+		 $GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
+
+		while ($GLOBALS['phpgw']->db->next_record())
+		{
 			 $val = $GLOBALS['phpgw']->db->row();
-			 echo "<option>".$val['directory']."</option>";
-		 }
-		 $GLOBALS['phpgw']->db->query('SELECT directory,name from phpgw_vfs WHERE directory = \'/home\' and name like \'%'.$name.'%\' LIMIT 1',__LINE__,__FILE__);
-		 if ($GLOBALS['phpgw']->db->next_record()){
-			 $val = $GLOBALS['phpgw']->db->row();
-			 echo "<option>".$val['directory']."/".$val['name']."</option>";
-		 }
-		
-
+			 $_options .= "<option>".$val['directory']."/".$val['name']."</option>";
+		}
+
+		echo $_options;
 	}
 	
Index: branches/2.2/filemanager/inc/load_lang.php
===================================================================
--- branches/2.2/filemanager/inc/load_lang.php	(revision 3019)
+++ branches/2.2/filemanager/inc/load_lang.php	(revision 3873)
@@ -1,5 +1,19 @@
 <?php
+
+require_once '../../header.session.inc.php';
+
+/* This single file is used to increase upload_max_filesize and post_max_size using .htaccess*/
+if(!isset($GLOBALS['phpgw_info'])){
+	$GLOBALS['phpgw_info']['flags'] = array(
+		'currentapp' => 'filemanager',
+		'nonavbar'   => true,
+		'noheader'   => true
+	);
+}
+require_once '../../header.inc.php';
+
 	$array_keys = array();
-	$fn = $GLOBALS['phpgw_info']['flags']['currentapp'].'/setup/phpgw_'.$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'].'.lang';
+	$fn = dirname(__FILE__) . '/../setup/phpgw_'.$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'].'.lang';
+
 	if (file_exists($fn)){
 			$fp = fopen($fn,'r');
@@ -10,4 +24,6 @@
 		fclose($fp);
 	}
-	echo "<script type='text/javascript'>var array_lang = new Array(); $script</script>";
+	
+	echo "var array_lang = new Array(); \n$script";
+	
 ?>
Index: branches/2.2/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- branches/2.2/filemanager/inc/class.uifilemanager.inc.php	(revision 3647)
+++ branches/2.2/filemanager/inc/class.uifilemanager.inc.php	(revision 3873)
@@ -325,4 +325,5 @@
 		$GLOBALS['phpgw']->common->phpgw_header();
 		
+		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/inc/load_lang.php'></script>";
 		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/global.js'></script>";
 		echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/main.js'></script>";
@@ -365,6 +366,4 @@
 
 		echo "<script src='./phpgwapi/js/dftree/dftree.js'></script>";
-
-		include('load_lang.php');
 
 		# Page to process users
Index: branches/2.2/filemanager/js/config.js
===================================================================
--- branches/2.2/filemanager/js/config.js	(revision 3019)
+++ branches/2.2/filemanager/js/config.js	(revision 3873)
@@ -1,11 +1,14 @@
 
-function loadq_handler(data){
+function loadq_handler(data)
+{
 	document.getElementById('quota_size').value = data;
 }
-function load_quota(el){
+function load_quota(el)
+{
 	cExecute_('index.php?menuaction=filemanager.uiconfig.load_quota&name='+base64_encode(el.value),loadq_handler);
 }
 
-function set_owner(){
+function set_owner()
+{
 	var dirName = document.getElementById('search1').value;
 	var ownerName = document.getElementById('search2').value;
@@ -39,18 +42,48 @@
 	document.getElementById('search2').innerHTML = data;
 }
+
 var timeO;
-function search_dir(el){
-	if (el.value.length < 4){
-		document.getElementById('span_searching1').innerHTML = get_lang('Type at least 4 chars');
-	}
-	else
+function search_dir()
+{
+	if( arguments.length  > 0 )
 	{
-		document.getElementById('span_searching1').innerHTML = '';
-		if (timeO)
-			clearTimeout(timeO);
-		timeO = setTimeout('cExecute_(\'index.php?menuaction=filemanager.uiconfig.search_dir&name='+el.value+'\',dir_handler)',700);
+		var el	= arguments[0];
+		var ev	= arguments[1];
+		var key	= [8, 27, 37, 38, 39, 40];
+		
+		var dir_handler =  function(data)
+		{
+			document.getElementById("search1").innerHTML = data;
+		}
+		
+		for( var i in key )
+			if( ev.keyCode == key[i] )
+				return false;
+		
+		if( el.value.length < 4 )
+		{
+			document.getElementById("span_searching1").innerHTML = "( Digite mais " + ( 4 - el.value.length ) + " ) ";
+			setTimeout(function(){
+				document.getElementById("span_searching1").innerHTML = "";
+			},2000);
+		}
+		else
+		{
+			document.getElementById("span_searching1").innerHTML = "( Buscando aguarde .... )";
+			
+			if( timeO )
+				clearTimeout( timeO );
+			
+			timeO = setTimeout( function()
+			{
+				cExecute_('index.php?menuaction=filemanager.uiconfig.search_dir', dir_handler, 'name='+el.value );
+				document.getElementById('span_searching1').innerHTML = "";
+			}, 700);
+		}
 	}
 }
-function search_user(el){
+
+function search_user(el)
+{
 	if (el.value.length < 4){
 		document.getElementById('span_searching1').innerHTML = get_lang('Type at least 4 chars');
@@ -64,12 +97,30 @@
 	}
 }
-function delete_folder(){
+
+function delete_folder()
+{
+	var handler_delete = function(data)
+	{
+		var _response	= document.getElementById('result_folders');
+		var _search1	= document.getElementById('search1');
+		
+		_response.innerHTML	= data;
+		_search1.innerHTML		= "";
+		
+		setTimeout( function() { _response.innerHTML = ""; }, 3500 );
+	};
+	
 	var dirName = document.getElementById('search1').value;
-	var okToDel = confirm(get_lang('Are you sure you want to delete')+' '+dirName+'?');
-	if (okToDel){
+	
+	var ok2Del = confirm( get_lang('Are you sure you want to delete')+' '+dirName+'?' );
+	
+	if  ( ok2Del)
+	{
 		var randNum = parseInt((Math.random()*100));
-		var okToDel = prompt(get_lang('Please type the text "%1" to delete',randNum)+': '+dirName);
-		if (okToDel == randNum)
-			cExecute_('index.php?menuaction=filemanager.uiconfig.removeFolder&dir='+base64_encode(dirName),alert);
+		
+		var ok2Del = prompt( get_lang('Please type the text "%1" to delete',randNum)+': '+dirName );
+		
+		if ( ok2Del == randNum )
+			cExecute_('index.php?menuaction=filemanager.uiconfig.removeFolder', handler_delete, 'dir='+base64_encode(dirName) );
 	}
 }
@@ -77,19 +128,34 @@
 function rename_folder(){
 	var dirName = document.getElementById('search1').value;
-	var toName = prompt(get_lang('Enter the name you want to move %1 to:',dirName),dirName);
+	var toName = prompt(get_lang('enter the name you want to move %1 to',dirName),dirName);
 	if (toName.length > 1){
-			cExecute_('index.php?menuaction=filemanager.uiconfig.renameFolder&dir='+base64_encode(dirName)+'&to='+base64_encode(toName),alert);
+		cExecute_('index.php?menuaction=filemanager.uiconfig.renameFolder&dir='+base64_encode(dirName)+'&to='+base64_encode(toName),alert);
 	}
 }
 
-function create_folder(){
-	var toName = prompt(get_lang('Enter the name of folder you want to create:'),'/home/');
-	if (toName.length > 1){
+function create_folder()
+{
+	var toName = prompt( get_lang('Enter the name of folder you want to create'), '/home/' );
+	
+	if (toName.length > 1)
+	{
 		cExecute_('index.php?menuaction=filemanager.uiconfig.createFolder&name='+base64_encode(toName),alert);
 	}
 }
 
-function reconstruct_folder(){
+function reconstruct_folder()
+{
+	var handler_reconstructFolder =  function( data )
+	{
+		var _response	= document.getElementById('result_folders');
+		var _search1	= document.getElementById('search1');
+		
+		_response.innerHTML	= data;
+		_search1.innerHTML		= "";
+		
+		setTimeout( function() { _response.innerHTML = ""; }, 3500 );
+	};
+	
 	var dirName = document.getElementById('search1').value;
-	cExecute_('index.php?menuaction=filemanager.uiconfig.reconstructFolder&dir='+base64_encode(dirName),alert);
+	cExecute_('index.php?menuaction=filemanager.uiconfig.reconstructFolder', handler_reconstructFolder, 'dir='+base64_encode(dirName));
 }
Index: branches/2.2/filemanager/templates/default/config_folders.tpl
===================================================================
--- branches/2.2/filemanager/templates/default/config_folders.tpl	(revision 3534)
+++ branches/2.2/filemanager/templates/default/config_folders.tpl	(revision 3873)
@@ -1,39 +1,54 @@
 <!-- BEGIN body -->
-<table border="0" cellpadding="1" cellspacing="1" style="width: 400px;">
-	<tbody>
-		<tr style="width: 500px;">
-			<td>
-				<b>{lang_search}</b></td>
-			<td>
-				<input onkeyup="search_dir(this)" size="30" type="text" value="" /></td>
-			<td>
-				&nbsp;</td>
-		</tr>
-		<tr>
-			<td>
-				<b>{lang_directory}</b></td>
-			<td>
-				<select id="search1" size="5" style="width: 500px;"></select> </td>
-			<td>
-				&nbsp;</td>
-		</tr>
-		<tr>
-			<td>
-			<td>
-				<input onclick="delete_folder()" type="button" value="{lang_remove}" />
-				<input onclick="reconstruct_folder()" type="button" value="{lang_reconstruct}" />
-				<input onclick="rename_folder()" type="button" value="{lang_rename}" />
-				<input onclick="create_folder()" type="button" value="{lang_create}" />
-			</td>
-			<td>
-			</td>
-		</tr>
-	</tbody>
-</table>
-<p>
-	<br />
-	<font color="red"><span id="span_searching1">&nbsp;</span></font><br />
-	<br />
-	&nbsp;</p>
+<script src='{path_filemanager}/inc/load_lang.php'></script>
+<script src='{path_filemanager}/js/connector.js'></script>
+<script src='{path_filemanager}/js/common_functions.js'></script>
+<script src='{path_filemanager}/js/config.js'></script>
+
+<center>
+	<div style="width:755px;border:1px solid #000;">
+
+		<br/>
+		<div style="width:660px;text-align:left; border:0px solid #000;">
+			<div style=" height:35px;text-align: bottom;">
+				<img src="{path_filemanager}/images/gerenciamento.gif"/>
+				<label style="font-size:12px;font-weight:bold;"> Gerenciamento de Pastas </label>
+			</div>
+			<div style="margin:8px 0px; position:relative;height:5px;">	
+				<label id="result_folders" style="font-size:10pt; color:red; font-weight:bold;">
+				</label>
+			</div>	
+			<br clear="all">
+			<label>{lang_search} .:</label>
+			<input onkeyup="search_dir(this,event);" size="30" type="text" value=""/>
+			<font color="red">
+				<span id="span_searching1"/>
+			</font>
+		</div>
+		<br/>
+		<br/>
+		<div style="width:660px; text-align:left; align:">
+			<div style="position:relative; float:left; width:300px;">
+				<label>:: Resultado da Busca </label><br/>
+				<select name="search1" id="search1" size="5" style="width:500px;"></select>
+			</div>
+		</div>
+
+		<br/>
+
+		<br clear="all">
+		<br clear="all">
+
+		<div style="width:700px; margin:10px;">
+			<input onclick="delete_folder()" type="button" value="{lang_remove}" />
+			<input onclick="reconstruct_folder()" type="button" value="{lang_reconstruct}" />
+			<input onclick="rename_folder()" type="button" value="{lang_rename}" />
+			<input onclick="create_folder()" type="button" value="{lang_create}" />
+			<br/>	
+			<br/>
+			<input type="button" onclick="javascript:history.back();" value="{lang_back}" name="back" />
+		</div>	
+
+	</div>
+</center>
+
 <!-- END body -->
-
Index: branches/2.2/filemanager/templates/default/config_quota.tpl
===================================================================
--- branches/2.2/filemanager/templates/default/config_quota.tpl	(revision 3019)
+++ branches/2.2/filemanager/templates/default/config_quota.tpl	(revision 3873)
@@ -1,3 +1,8 @@
 <!-- BEGIN body -->
+<script src='{path_filemanager}/inc/load_lang.php'></script>
+<script src='{path_filemanager}/js/connector.js'></script>
+<script src='{path_filemanager}/js/common_functions.js'></script>
+<script src='{path_filemanager}/js/config.js'></script>
+
 <table border="0" cellpadding="1" cellspacing="1" style="width: 400px;">
 	<tbody>
Index: branches/2.2/filemanager/templates/default/config_owner.tpl
===================================================================
--- branches/2.2/filemanager/templates/default/config_owner.tpl	(revision 3534)
+++ branches/2.2/filemanager/templates/default/config_owner.tpl	(revision 3873)
@@ -1,3 +1,8 @@
 <!-- BEGIN body -->
+<script src='{path_filemanager}/inc/load_lang.php'></script>
+<script src='{path_filemanager}/js/connector.js'></script>
+<script src='{path_filemanager}/js/common_functions.js'></script>
+<script src='{path_filemanager}/js/config.js'></script>
+
 <table border="0" cellpadding="1" cellspacing="1" style="width: 400px;">
 	<tbody>
@@ -41,23 +46,22 @@
 				<tbody><tr>
 					<td><input name="checkAttr" id="egw_read" type="checkbox"></td>
-					<td>Read</td>
+					<td>{lang_Read}</td>
 				</tr>
 				<tr>
 
 					<td><input name="checkAttr" id="egw_add" type="checkbox"></td>
-					<td>Add</td>
+					<td>{lang_Add}</td>
 				</tr>
 				<tr>
 					<td><input name="checkAttr" id="egw_edit" type="checkbox"></td>
-					<td>Edit</td>
+					<td>{lang_Edit}</td>
 				</tr>
 				<tr>
 					<td><input name="checkAttr" id="egw_delete" type="checkbox"></td>
-
-					<td>Delete</td>
+					<td>{lang_Delete}</td>
 				</tr>
 				<tr>
 					<td><input name="checkAttr" id="egw_private" type="checkbox"></td>
-					<td>Private</td>
+					<td>{lang_private}</td>
 				</tr>
 			</tbody></table>
