Index: /branches/2.2/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- /branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3415)
+++ /branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3591)
@@ -56,4 +56,5 @@
 delete	filemanager	pt-br	Remover
 deleted %1	filemanager	pt-br	Removido %1
+Directories	filemanager	pt-br	Diretórios
 directory	filemanager	pt-br	Pasta
 directory %1 already exists	filemanager	pt-br	Pasta %1 já existe
Index: /branches/2.2/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- /branches/2.2/filemanager/inc/class.uifilemanager.inc.php	(revision 3586)
+++ /branches/2.2/filemanager/inc/class.uifilemanager.inc.php	(revision 3591)
@@ -814,5 +814,7 @@
 			else
 			{
-				if($this->bo->vfs->mkdir(array('string' => $this->filename)))
+				$this->bo->vfs->cd(array('string' => $this->path, 'relatives' => array(RELATIVE_NONE), 'relative' => False));
+				
+				if( $this->bo->vfs->mkdir(array('string' => $this->filename )) )
 				{
 					echo lang('Created directory %1', $this->disppath.'/'.$this->filename);
Index: /branches/2.2/filemanager/js/draw_api.js
===================================================================
--- /branches/2.2/filemanager/js/draw_api.js	(revision 3588)
+++ /branches/2.2/filemanager/js/draw_api.js	(revision 3591)
@@ -610,5 +610,5 @@
 			
 			last_folder = last_folder ? last_folder : currentPath;
-			current_folder = current_folder ? current_folder : currentPath;
+			current_folder = ( current_folder != "" ) ? current_folder : currentPath;
 			cExecute_('./index.php?menuaction=filemanager.uifilemanager.dir_ls&path='+base64_encode(currentPath)+'&criteria='+criteria+'&otype='+order_type+'&limit='+preferences.files_per_page+'&offset='+offset,folderList.drawFiles);
 			return;
@@ -672,9 +672,10 @@
 function editFolders( operation )
 {
+	
 	if( operation == 'new' || operation == 'remove')
 	{
 		var _selectFolders	= document.getElementById('folders_box');
-		var Dfolder		= "";
-		var parentDir	= "";
+		var Dfolder			= "";
+		var parentDir		= "";
 		
 		for( var i = 0 ; i < _selectFolders.options.length; i++ )
@@ -694,6 +695,10 @@
 		if ( name != null && name != '' )
 		{
-			cExecute_('./index.php?menuaction=filemanager.uifilemanager.createdir&path='+base64_encode(parentDir)+'&filename='+base64_encode(name),handler.refreshDir);
-			currentPath = ( parentDir != "" ) ? parentDir + '/' + name : my_home_filemanager + '/' + name;
+			if( parentDir == "" )
+				parentDir = my_home_filemanager;
+				
+			var parentDir_en = base64_encode( parentDir );
+			cExecute_('./index.php?menuaction=filemanager.uifilemanager.createdir&path='+parentDir_en+'&filename='+base64_encode(name), handler.refreshDir);
+			currentPath = parentDir + '/' + name;
 			close_window();
 		}
@@ -708,8 +713,7 @@
 						Dfolder.replace(my_home_filemanager, get_lang("My folder"))), '') )
 				{
-					//var Dfolder_en = base64_encode( crypt.encode(Dfolder) );
 					var Dfolder_en = base64_encode( Dfolder );
 					
-					cExecute_('./index.php?menuaction=filemanager.uifilemanager.removedir&path=' + Dfolder_en,handler.refreshDir );
+					cExecute_('./index.php?menuaction=filemanager.uifilemanager.removedir&path=' + Dfolder_en ,handler.refreshDir );
 					var lastIndex = Dfolder.lastIndexOf('/');
 					currentPath = Dfolder.substr(0,lastIndex);
@@ -726,5 +730,5 @@
 			var _xml 		= Xtools.xml("root");
 			var _doc		= _xml.documentElement;
-			var _folders	= _xml.createElement("folders") 
+			var _folders	= _xml.createElement("folders");
 			
 			for( var i = 0; i < folders.length; i++ )
@@ -733,5 +737,5 @@
 				{
 					var fd = _xml.createElement('name');
-						fd.setAttribute('value', folders[i]);
+						fd.setAttribute('value', folders[i] );
 						fd.appendChild( _xml.createTextNode(folders[i].replace(my_home_filemanager, get_lang("My folder"))) );
 						_folders.appendChild(fd);
@@ -743,7 +747,7 @@
 			var pArgs =
 			{
-				'lang_new_folder'		: get_lang('new folder'),
-				'lang_remove_folder'	: get_lang('remove folder'),
-				'path_filemanager'		: path_filemanager,
+				'lang_new_folder'			: get_lang('new folder'),
+				'lang_remove_folder'		: get_lang('remove folder'),
+				'path_filemanager'			: path_filemanager,
 				'onclick_new_folder'		: 'editFolders("new")',
 				'onclick_remove_folder'		: 'editFolders("remove")'
Index: /branches/2.2/filemanager/js/handler.js
===================================================================
--- /branches/2.2/filemanager/js/handler.js	(revision 3585)
+++ /branches/2.2/filemanager/js/handler.js	(revision 3591)
@@ -126,5 +126,4 @@
 handler.prototype.draw_folders_list = function (data)
 {
-	
 	toolbar.control('reload');
 	folders_tree = new dFTree({name: 'main'});
@@ -132,5 +131,5 @@
 	folders = unserialize(data);
 	
-	var rootFold = new dNode({id:'root', caption:get_lang("filemanager")});
+	var rootFold = new dNode({id:'root', caption: get_lang("Directories") });
 	folders_tree.add(rootFold,'root');
 	
@@ -144,12 +143,15 @@
 		var parentDir = folders[i].substr(0,lastIndex);
 	
-		if (parentDir == '/home')
+		if ( parentDir == '/home' )
 			parentDir = 'root';
 		
-		var search_child = function(afolders,name)
+		var search_child = function( ListFolders, name )
 		{
-			for (j=0; j < afolders.length; j++)
-				if (afolders[j].indexOf(name+'/') == 0)
+			for ( j = 0 ; j < ListFolders.length; j++ )
+			{
+				if ( ListFolders[j].indexOf( name + '/') > -1 )
 					return true;
+			}
+			
 			return false;
 		}
