Index: /sandbox/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- /sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1745)
+++ /sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1787)
@@ -36,4 +36,6 @@
 created by	filemanager	pt-br	Criado por
 Error:	filemanager	pt-br	Erro:
+Are you sure you want to delete	filemanager	pt-br	Você tem certeza que deseja apagar
+Please type the text "%1" to delete	filemanager	pt-br	Por favor, tenha certeza e digite "%1" para apagar
 created directory %1	filemanager	pt-br	Criada pasta %1
 date	filemanager	pt-br	Data
Index: /sandbox/filemanager/inc/class.uiconfig.inc.php
===================================================================
--- /sandbox/filemanager/inc/class.uiconfig.inc.php	(revision 1726)
+++ /sandbox/filemanager/inc/class.uiconfig.inc.php	(revision 1787)
@@ -14,9 +14,75 @@
 			'update_quota' => True,
 			'load_quota' => True,
-			'quota' => True
+			'quota' => True,
+			'removeFolder' => True,
+			'folders' => True
 		 );
 
 		function vfs_functions(){
 		}
+		 function folders(){
+			 $GLOBALS['phpgw_info']['flags'] = array
+				 (
+					 'currentapp'    => 'filemanager',
+					 'noheader'      => False,
+					 'nonavbar' => False,
+					 'nofooter'      => False,
+					 'noappheader'   => False,
+					 'enable_browser_class'  => True
+				 );
+
+			 $GLOBALS['phpgw']->common->phpgw_header();
+			include('load_lang.php');
+			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>";
+			$t = $GLOBALS['phpgw']->template;
+			$t->set_file(array('config_list' => 'config_folders.tpl'));
+			$t->set_block('config_list','body','body');
+			$vars[lang_directory]=lang('directory');
+			$vars[lang_search]=lang('search');
+			$vars[lang_remove]=lang('remove');
+
+			$t->set_var($vars);
+			$t->pparse('out','body');
+                        $GLOBALS['phpgw']->common->phpgw_footer();
+                        $GLOBALS['phpgw']->common->phpgw_exit();
+
+		 }
+		 function removeFolder(){
+			 $GLOBALS['phpgw_info']['flags'] = array
+				 (
+					 'currentapp'    => 'filemanager',
+					 'noheader'      => True,
+					 'nonavbar' => True,
+					 'nofooter'      => True,
+					 'noappheader'   => True,
+					 'enable_browser_class'  => True
+				 );
+			 $bo = CreateObject('filemanager.bofilemanager');
+			 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+			 if (strlen($name) < 2)
+				 return false;
+			 $bo->vfs->delete(array(
+				 'string' => $name,
+				 'relatives' => array(RELATIVE_NONE)
+			 ));
+
+			 /* Clean the trash */
+			 $GLOBALS['phpgw']->db->query('DELETE FROM phpgw_vfs WHERE directory = \''.$name.'\'',__LINE__,__FILE__);
+			 if ($GLOBALS['phpgw']->db->Error)
+				 echo "Erro";
+			 else
+			 {		 
+				 $GLOBALS['phpgw']->db->query('DELETE FROM phpgw_vfs_quota WHERE directory = \''.$name.'\'',__LINE__,__FILE__);
+				 if (!$GLOBALS['phpgw']->db->Error)
+					 echo lang('directory removed sucessfully');
+				 else
+					 echo "Erro";
+			 }
+			 return; 
+
+		 }
+
 
 		 function quota(){
@@ -35,32 +101,17 @@
 			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 type='text/javascript'>
-				function loadq_handler(data){
-					document.getElementById('quota_size').value = data;
-		 }
-		function load_quota(el){
-			cExecute('/index.php?menuaction=filemanager.uiconfig.load_quota&name='+base64_encode(el.value),loadq_handler);
-		 }
-		function save_quota(){
-			var dirName = document.getElementById('search1').value;
-			var Qsize = document.getElementById('quota_size').value;
-			cExecute('/index.php?menuaction=filemanager.uiconfig.update_quota&dir='+base64_encode(dirName)+'&val='+Qsize,alert);
-		 }
-		function dir_handler(data){
-			document.getElementById('search1').innerHTML = data;
-		 }
-		function search_dir(el){
-			if (el.value.length < 4){
-				document.getElementById('span_searching1').innerHTML = '".lang('Type at least 4 chars')."';
-		 }
-else
-{
-	document.getElementById('span_searching1').innerHTML = '';
-	cExecute('/index.php?menuaction=filemanager.uiconfig.search_dir&name='+el.value,dir_handler);
-		 }
-		 }
-				</script>";
-			 echo "<b>".lang('Directory')."</b><br><font color='red'><span id='span_searching1'>&nbsp;</span></font><br>".lang('Search').":<input value='' size='30' onkeyup='search_dir(this)' type='text'><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select id='search1' style='width:200px;' onclick='load_quota(this)' size='5'></select><br><br>Quota:<input id='quota_size' size='10' type='text'>mb<br><br><input onclick='save_quota()' type=button value=".lang('save').">";
+			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/config.js'></script>";
+			$t = $GLOBALS['phpgw']->template;
+			$t->set_file(array('config_list' => 'config_quota.tpl'));
+			$t->set_block('config_list','body','body');
+			$vars[lang_directory]=lang('directory');
+			$vars[lang_search]=lang('search');
+			$vars[lang_save]=lang('save');
+
+			$t->set_var($vars);
+			$t->pparse('out','body');
+                        $GLOBALS['phpgw']->common->phpgw_footer();
+                        $GLOBALS['phpgw']->common->phpgw_exit();
+
 		 }
 		 function search_dir(){
Index: /sandbox/filemanager/inc/hook_admin.inc.php
===================================================================
--- /sandbox/filemanager/inc/hook_admin.inc.php	(revision 1678)
+++ /sandbox/filemanager/inc/hook_admin.inc.php	(revision 1787)
@@ -26,5 +26,6 @@
 	$file = Array(
 		'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
-		'Quota management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.quota'),
+		'Folders management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.folders'),
+		'Quota management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.quota')
 
 	);
Index: /sandbox/filemanager/js/config.js
===================================================================
--- /sandbox/filemanager/js/config.js	(revision 1787)
+++ /sandbox/filemanager/js/config.js	(revision 1787)
@@ -0,0 +1,35 @@
+
+function loadq_handler(data){
+	document.getElementById('quota_size').value = data;
+}
+function load_quota(el){
+	cExecute('/index.php?menuaction=filemanager.uiconfig.load_quota&name='+base64_encode(el.value),loadq_handler);
+}
+function save_quota(){
+	var dirName = document.getElementById('search1').value;
+	var Qsize = document.getElementById('quota_size').value;
+	cExecute('/index.php?menuaction=filemanager.uiconfig.update_quota&dir='+base64_encode(dirName)+'&val='+Qsize,alert);
+}
+function dir_handler(data){
+	document.getElementById('search1').innerHTML = data;
+}
+function search_dir(el){
+	if (el.value.length < 4){
+		document.getElementById('span_searching1').innerHTML = get_lang('Type at least 4 chars');
+	}
+	else
+	{
+		document.getElementById('span_searching1').innerHTML = '';
+		cExecute('/index.php?menuaction=filemanager.uiconfig.search_dir&name='+el.value,dir_handler);
+	}
+}
+function delete_folder(){
+	var dirName = document.getElementById('search1').value;
+	var okToDel = confirm(get_lang('Are you sure you want to delete')+' '+dirName+'?');
+	if (okToDel){
+		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);
+	}
+}
Index: /sandbox/filemanager/templates/default/config_folders.tpl
===================================================================
--- /sandbox/filemanager/templates/default/config_folders.tpl	(revision 1787)
+++ /sandbox/filemanager/templates/default/config_folders.tpl	(revision 1787)
@@ -0,0 +1,35 @@
+<!-- BEGIN body -->
+<table border="0" cellpadding="1" cellspacing="1" style="width: 400px;">
+	<tbody>
+		<tr style="width: 200px;">
+			<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: 200px;"></select> </td>
+			<td>
+				&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+			<td>
+				<input onclick="delete_folder()" type="button" value="{lang_remove}" /></td>
+			<td>
+			</td>
+		</tr>
+	</tbody>
+</table>
+<p>
+	<br />
+	<font color="red"><span id="span_searching1">&nbsp;</span></font><br />
+	<br />
+	&nbsp;</p>
+<!-- END body -->
+
Index: /sandbox/filemanager/templates/default/config_quota.tpl
===================================================================
--- /sandbox/filemanager/templates/default/config_quota.tpl	(revision 1787)
+++ /sandbox/filemanager/templates/default/config_quota.tpl	(revision 1787)
@@ -0,0 +1,36 @@
+<!-- BEGIN body -->
+<table border="0" cellpadding="1" cellspacing="1" style="width: 400px;">
+	<tbody>
+		<tr style="width: 200px;">
+			<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" onclick="load_quota(this)" size="5" style="width: 200px;"></select> </td>
+			<td>
+				&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+				<b>Quota:</b><input id="quota_size" size="10" type="text" />mb</td>
+			<td>
+				<input onclick="save_quota()" type="button" value="{lang_save}" /></td>
+			<td>
+				&nbsp;</td>
+		</tr>
+	</tbody>
+</table>
+<p>
+	<br />
+	<font color="red"><span id="span_searching1">&nbsp;</span></font><br />
+	<br />
+	&nbsp;</p>
+<!-- END body -->
+
