Index: /branches/2.2/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- /branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3610)
+++ /branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3619)
@@ -67,4 +67,5 @@
 edit	filemanager	pt-br	Editar
 edit comments	filemanager	pt-br	Editar Comentários
+Email notify uploads	common	pt-br	Notificar por email uploads
 execute	filemanager	pt-br	Executar
 failed to create directory	filemanager	pt-br	falhou ao criar pasta
@@ -97,4 +98,5 @@
 move to:	filemanager	pt-br	Mover para:
 More files	filemanager	pt-br	Mais arquivos
+No file(s) to send	filemanager	pt-br	Sem arquivo(s) para enviar
 %1 files moved successfuly	filemanager	pt-br	%1 arquivos movidos com sucesso
 File moved successfuly	filemanager	pt-br	Arquivo movido com sucesso
@@ -128,4 +130,5 @@
 save changes	filemanager	pt-br	Salvar modificações
 saved %1	filemanager	pt-br	Salvo %1
+Send email	filemanager	pt-br	Enviar email
 show	filemanager	pt-br	Exibir
 show ..	filemanager	pt-br	Exibir ..
Index: /branches/2.2/filemanager/tp/expressowindow/xsl/upload.xsl
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/xsl/upload.xsl	(revision 3610)
+++ /branches/2.2/filemanager/tp/expressowindow/xsl/upload.xsl	(revision 3619)
@@ -12,4 +12,5 @@
 	<xsl:param name="lang_file" />
 	<xsl:param name="lang_more_files" />
+	<xsl:param name="lang_send_email" />
 	<xsl:param name="lang_upload" />
 	<xsl:param name="max_size" />
@@ -51,18 +52,18 @@
 				</div>
 				
-				<div style="border-top:1px solid #000; margin: 4px;">
+				<div  id="upload_files" style="border-top:1px solid #000; margin: 4px;">
 					
 					<div style="margin: 10 0 5 0;">
-						<input value="{$lang_upload}" id="button_up" type="button" onclick="sendFiles();" style="margin-right:5px;"/>
-						<input value="{$lang_advanced_upload}" id="button_up" type="button" onclick="newAdvancedUpload();"/>
+						<input value="{$lang_upload}" type="button" onclick="sendFiles();" style="margin-right:5px;"/>
+						<input value="{$lang_advanced_upload}" type="button" onclick="newAdvancedUpload();"/>
 					</div>
 
-					<div style="margin-top:-25px; position: absolute; right: 20px; width:20px;">
-						<img src="{$path_filemanager}templates/default/images/email.png" alt="Send email" title="Send email" onclick="sendNotification();"/>
+					<div style="margin-top:-25px; position: absolute; right: 25px; width:20px;">
+						<img src="{$path_filemanager}templates/default/images/email.png" alt="{$lang_send_email}" title="{$lang_send_email}" onclick="sendNotification();"/>
 					</div>						
 					
-					<span style="font-weight:bold;">
+					<div style="font-weight:bold; margin-top: 15px;">
 						<xsl:value-of select="$max_size"/>
-					</span>
+					</div>
 					
 				</div>
Index: /branches/2.2/filemanager/inc/class.uiconfig.inc.php
===================================================================
--- /branches/2.2/filemanager/inc/class.uiconfig.inc.php	(revision 3534)
+++ /branches/2.2/filemanager/inc/class.uiconfig.inc.php	(revision 3619)
@@ -8,181 +8,213 @@
 	\**************************************************************************/
 
-	class uiconfig
-	{
-		var $public_functions = array(
-			'search_dir' => True,
-			'search_user' => True,
-			'update_quota' => True,
-			'load_quota' => True,
-			'quota' => True,
-			'removeFolder' => True,
-			'reconstructFolder' => True,
-			'set_owner' => True,
-			'set_permission' => True,
-			'renameFolder' => True,
-			'createFolder' => True,
-			'groups_users' => 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');
-			$vars[lang_rename]=lang('rename');
-			$vars[lang_create]=lang('create');
-			$vars[lang_reconstruct]=lang('reconstruct');
-
-			$t->set_var($vars);
-			$t->pparse('out','body');
-                        $GLOBALS['phpgw']->common->phpgw_footer();
-                        $GLOBALS['phpgw']->common->phpgw_exit();
-
-		 }
-		 function groups_users(){
-			 $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_owner.tpl'));
-			$t->set_block('config_list','body','body');
-			$vars[lang_users_and_groups]=lang('Users and groups');
-			$vars[lang_search]=lang('search');
-			$vars[lang_directory]=lang('directory');
-			$vars[lang_setowner]=lang('set owner');
-			$vars[lang_setperm]=lang('set permission');
-
-			$t->set_var($vars);
-			$t->pparse('out','body');
-                        $GLOBALS['phpgw']->common->phpgw_footer();
-                        $GLOBALS['phpgw']->common->phpgw_exit();
-
-		 }
-
-		function createFolder(){
-			 $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['name']));
-			 if (strlen($name) < 2)
-				 return false;
-			 $c = CreateObject('phpgwapi.config','filemanager');
-			 $c->read_repository();
-			 $current_config = $c->config_data;
-
-			 $bo->vfs->override_acl = 1;
-
-			 if ( $bo->vfs->mkdir(array(
-				 'string' => $name,
-				 'relatives' => array(RELATIVE_NONE)
-			 )) )
-			 if ( $bo->vfs->set_quota(array(
-				 'string' => $name,
-				 'relatives' => array(RELATIVE_NONE),
-				 'new_quota' => $current_config['filemanager_quota_size']
-			 )) )
-			 $return = True;
-
-			 $bo->vfs->override_acl = 0;
-			 if ($return){
-				 echo "Folder created";
+require_once("load_lang.php");
+
+class uiconfig
+{
+	private $bo;
+	private $template;
+	
+	var $public_functions = array
+	(
+		'createFolder'		=> True,
+		'folders' 			=> True,
+		'groups_users' 		=> True,		
+		'load_quota'		=> True,
+		'notifyUploads'		=> True,
+		'renameFolder'		=> True,
+		'removeFolder'		=> True,
+		'reconstructFolder'	=> True,
+		'search_dir'		=> True,
+		'set_owner'			=> True,		
+		'search_user'		=> True,
+		'set_permission'	=> True,
+		'update_quota'		=> True,
+		'quota'				=> True
+	 );
+
+	function uiconfig()
+	{
+		 $this->bo 			= CreateObject('filemanager.bofilemanager');
+		 $this->template	= $GLOBALS['phpgw']->template;
+		 
+		 $GLOBALS['phpgw_info']['flags'] = array
+			 (
+				 'currentapp'    	=> 'filemanager',
+				 'noheader'      	=> False,
+				 'nonavbar' 		=> False,
+				 'nofooter'      	=> False,
+				 'noappheader'   	=> False,
+				 'enable_browser_class'  => True
+			 );
+	}
+
+	function vfs_functions(){}
+	
+	function folders()
+	{
+		$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_directory'	=> lang('directory'),
+					'lang_search' 		=> lang('search'),
+					'lang_remove' 		=> lang('remove'),
+					'lang_rename' 		=>lang('rename'),
+					'lang_create' 		=> lang('create'),
+					'lang_reconstruct' 	=> lang('reconstruct')
+				);
+
+		$this->template->set_var($vars);
+		$this->template->pparse('out','body');
+        
+        $GLOBALS['phpgw']->common->phpgw_footer();
+        $GLOBALS['phpgw']->common->phpgw_exit();
+        
+	 }
+
+	 function groups_users()
+	 {
+		$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[lang_users_and_groups]=lang('Users and groups');
+		$vars[lang_search]=lang('search');
+		$vars[lang_directory]=lang('directory');
+		$vars[lang_setowner]=lang('set owner');
+		$vars[lang_setperm]=lang('set permission');
+
+		$this->template->set_var($vars);
+		$this->template->pparse('out','body');
+                    $GLOBALS['phpgw']->common->phpgw_footer();
+                    $GLOBALS['phpgw']->common->phpgw_exit();
+
+	 }
+
+	function createFolder()
+	{
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+			 
+		 $this->bo = CreateObject('filemanager.bofilemanager');
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['name']));
+		 if (strlen($name) < 2)
+			 return false;
+		 $c = CreateObject('phpgwapi.config','filemanager');
+		 $c->read_repository();
+		 $current_config = $c->config_data;
+
+		 $this->bo->vfs->override_acl = 1;
+
+		 if ( $this->bo->vfs->mkdir(array(
+			 'string' => $name,
+			 'relatives' => array(RELATIVE_NONE)
+		 )) )
+		 if ( $this->bo->vfs->set_quota(array(
+			 'string' => $name,
+			 'relatives' => array(RELATIVE_NONE),
+			 'new_quota' => $current_config['filemanager_quota_size']
+		 )) )
+		 $return = True;
+
+		 $this->bo->vfs->override_acl = 0;
+		 if ($return){
+			 echo "Folder created";
+		 }
+		 else
+			 echo "Error";
+	 }
+
+	 function removeFolder()
+	 {
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+			 
+		 $this->bo = CreateObject('filemanager.bofilemanager');
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 if (strlen($name) < 2)
+			 return false;
+		 if (	 $this->bo->vfs->delete(array(
+			 'string' => $name,
+			 'relatives' => array(RELATIVE_NONE)
+		 )) )
+		 {
+			 /* Clean the log */
+			 $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";
 			 }
-			 else
-				 echo "Error";
-		 }
-
-		 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;
-			 if (	 $bo->vfs->delete(array(
-				 'string' => $name,
-				 'relatives' => array(RELATIVE_NONE)
-			 )) )
-			 {
-				 /* Clean the log */
-				 $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 reconstructFolder(){
-			 $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->update_real(array(
-				 'string'        => $name,
-				 'relatives'     => array(RELATIVE_NONE)
-			 ),True);
-			 $bo->vfs->flush_journal(array(
+		 }
+		 return; 
+
+	}
+	
+	function reconstructFolder()
+	{
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+			 
+		 $this->bo = CreateObject('filemanager.bofilemanager');
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 if (strlen($name) < 2)
+			 return false;
+		 $this->bo->vfs->update_real(array(
+			 'string'        => $name,
+			 'relatives'     => array(RELATIVE_NONE)
+		 ),True);
+		 $this->bo->vfs->flush_journal(array(
+			 'string' => $name,
+			 'relatives' => array(RELATIVE_NONE),
+			 'deleteall' => True
+		 ));
+		 echo lang('Your operation was successfully executed');
+	}
+
+	function renameFolder()
+	{
+		 $GLOBALS['phpgw_info']['flags'] = array
+			 (
+				 'currentapp'    => 'filemanager',
+				 'noheader'      => True,
+				 'nonavbar' => True,
+				 'nofooter'      => True,
+				 'noappheader'   => True,
+				 'enable_browser_class'  => True
+			 );
+		 $this->bo = CreateObject('filemanager.bofilemanager');
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 $to = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['to']));
+		 if (strlen($name) < 2)
+			 return false;
+		if ( $this->bo->vfs->mv(array(
+			 'from'        => $name,
+			 'to'	=> $to,
+			 'relatives'     => array(RELATIVE_NONE)
+		 )) ){
+			 $this->bo->vfs->flush_journal(array(
 				 'string' => $name,
 				 'relatives' => array(RELATIVE_NONE),
@@ -191,237 +223,204 @@
 			 echo lang('Your operation was successfully executed');
 		 }
-
-		 function renameFolder(){
-			 $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']));
-			 $to = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['to']));
-			 if (strlen($name) < 2)
-				 return false;
-			if ( $bo->vfs->mv(array(
-				 'from'        => $name,
-				 'to'	=> $to,
-				 'relatives'     => array(RELATIVE_NONE)
-			 )) ){
-				 $bo->vfs->flush_journal(array(
-					 'string' => $name,
-					 'relatives' => array(RELATIVE_NONE),
-					 'deleteall' => True
-				 ));
-				 echo lang('Your operation was successfully executed');
-			 }
-			else
-				echo lang('Error');
-		 }
-
-		 function quota(){
-			 $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_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(){
-			 $GLOBALS['phpgw_info']['flags'] = array
-				 (
-					 'currentapp'    => 'filemanager',
-					 'noheader'      => True,
-					 'nonavbar' => True,
-					 'nofooter'      => True,
-					 'noappheader'   => True,
-					 'enable_browser_class'  => True
-				 );
-			 $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()){
-				 $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>";
-			 }
-			
-
-		 }
-		 function search_user(){
-			 $GLOBALS['phpgw_info']['flags'] = array
-				 (
-					 'currentapp'    => 'filemanager',
-					 'noheader'      => True,
-					 'nonavbar' => True,
-					 'nofooter'      => True,
-					 'noappheader'   => True,
-					 'enable_browser_class'  => True
-				 );
-			 $account_info = $GLOBALS['phpgw']->accounts->get_list('both',0,'','',$_GET['name'],'all');
-
-			 foreach($account_info as $val)
-				 echo "<option value='".$val['account_id']."'>".$val['account_lid']."</option>";
-		 }
-		 function set_permission(){
-			 $GLOBALS['phpgw_info']['flags'] = array
-				 (
-					 'currentapp'    => 'filemanager',
-					 'noheader'      => True,
-					 'nonavbar' => True,
-					 'nofooter'      => True,
-					 'noappheader'   => True,
-					 'enable_browser_class'  => True
-				 );
-			 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
-			 $perms = ($_GET['perms'])*1;
-			 $owner = ($_GET['owner'])*1;
+		else
+			echo lang('Error');
+	}
+
+	function quota()
+	{
+		$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');
+		$vars[lang_directory]=lang('directory');
+		$vars[lang_search]=lang('search');
+		$vars[lang_save]=lang('save');
+
+		$this->template->set_var($vars);
+		$this->template->pparse('out','body');
+		$GLOBALS['phpgw']->common->phpgw_footer();
+        $GLOBALS['phpgw']->common->phpgw_exit();
+
+	}
+	 
+	function notifyUploads()
+	{
+		$GLOBALS['phpgw']->common->phpgw_header();
+		
+		$this->template->set_file(array('config_email' => 'notify_upload.tpl'));
+		$this->template->set_block('config_email','body','body');
+		
+		$vars = array(
+						'action_url_back' => './admin',
+						'bt_previous' => '<input type="submit" name="bt_previous" value="Anterior" />',
+						'bt_next' => '<input type="submit" name="bt_next" value="Proximo" />',													
+					);
+		
+		$this->template->set_var($vars);
+		$this->template->pparse('out','body');
+		
+        $GLOBALS['phpgw']->common->phpgw_footer();
+        $GLOBALS['phpgw']->common->phpgw_exit();
+	}
+	 
+	function search_dir()
+	{
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+			 
+		 $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()){
+			 $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>";
+		 }
+		
+
+	}
+	
+	function search_user()
+	{
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+
+		 $account_info = $GLOBALS['phpgw']->accounts->get_list('both',0,'','',$_GET['name'],'all');
+
+		 foreach($account_info as $val)
+			 echo "<option value='".$val['account_id']."'>".$val['account_lid']."</option>";
+	}
+	
+	function set_permission()
+	{
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 $perms = ($_GET['perms'])*1;
+		 $owner = ($_GET['owner'])*1;
+		 $dirs=explode('/',$name);
+		 $GLOBALS['phpgw']->db->query('SELECT owner_id  from phpgw_vfs  WHERE directory = \'/'.$dirs[1].'\' and name=\''.$dirs[2].'\' LIMIT 1',__LINE__,__FILE__);
+		 if ($GLOBALS['phpgw']->db->next_record()){
+			 $val = $GLOBALS['phpgw']->db->row();
+			 $owner_id = $val['owner_id'];
+		 }
+
+		 $query = "SELECT count(*) FROM phpgw_acl WHERE acl_appname = 'filemanager' and acl_account = '".$owner_id."' and acl_location='".$owner."'";
+		 if ($GLOBALS['phpgw']->db->query($query) && $GLOBALS['phpgw']->db->next_record())
+			 $val = $GLOBALS['phpgw']->db->row();
+		 else
+		 {
+			 echo $GLOBALS['phpgw']->db->error;
+			 return false;
+		 }
+		 if ($val['count'] == '1')
+			$GLOBALS['phpgw']->db->query("UPDATE phpgw_acl SET acl_rights = ".$perms." where acl_appname = 'filemanager' and acl_account = '".$owner_id."' AND acl_location = '".$owner."'",__LINE__,__FILE__);
+		 else
+			 $GLOBALS['phpgw']->db->query("INSERT INTO phpgw_acl values('filemanager','".$owner."','".$owner_id."',".$perms.")",__LINE__,__FILE__);
+		 if ($GLOBALS['phpgw']->db->Error)
+			 echo "Erro";
+		 else
+		 {
+			echo lang('entry updated sucessfully');
+		 }
+		 return;
+	}
+
+
+	function set_owner()
+	{
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+		 
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 $owner = ($_GET['owner'])*1;
+
+		 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs SET owner_id = '.$owner.' WHERE directory = \''.$name.'\'',__LINE__,__FILE__);
+		 if ($GLOBALS['phpgw']->db->Error)
+			 echo "Erro";
+		 else
+		 {
 			 $dirs=explode('/',$name);
-			 $GLOBALS['phpgw']->db->query('SELECT owner_id  from phpgw_vfs  WHERE directory = \'/'.$dirs[1].'\' and name=\''.$dirs[2].'\' LIMIT 1',__LINE__,__FILE__);
-			 if ($GLOBALS['phpgw']->db->next_record()){
-				 $val = $GLOBALS['phpgw']->db->row();
-				 $owner_id = $val['owner_id'];
-			 }
-
-			 $query = "SELECT count(*) FROM phpgw_acl WHERE acl_appname = 'filemanager' and acl_account = '".$owner_id."' and acl_location='".$owner."'";
-			 if ($GLOBALS['phpgw']->db->query($query) && $GLOBALS['phpgw']->db->next_record())
-				 $val = $GLOBALS['phpgw']->db->row();
-			 else
-			 {
-				 echo $GLOBALS['phpgw']->db->error;
-				 return false;
-			 }
-			 if ($val['count'] == '1')
-				$GLOBALS['phpgw']->db->query("UPDATE phpgw_acl SET acl_rights = ".$perms." where acl_appname = 'filemanager' and acl_account = '".$owner_id."' AND acl_location = '".$owner."'",__LINE__,__FILE__);
-			 else
-				 $GLOBALS['phpgw']->db->query("INSERT INTO phpgw_acl values('filemanager','".$owner."','".$owner_id."',".$perms.")",__LINE__,__FILE__);
+			 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs SET owner_id = '.$owner.' WHERE directory = \'/'.$dirs[1].'\' and name=\''.$dirs[2].'\'',__LINE__,__FILE__);
 			 if ($GLOBALS['phpgw']->db->Error)
 				 echo "Erro";
 			 else
 			 {
-				echo lang('entry updated sucessfully');
+				 echo lang('entry updated sucessfully');
 			 }
-			 return;
-		 }
-	
-
-		 function set_owner(){
-			 $GLOBALS['phpgw_info']['flags'] = array
-				 (
-					 'currentapp'    => 'filemanager',
-					 'noheader'      => True,
-					 'nonavbar' => True,
-					 'nofooter'      => True,
-					 'noappheader'   => True,
-					 'enable_browser_class'  => True
-				 );
-			 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
-			 $owner = ($_GET['owner'])*1;
-
-			 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs SET owner_id = '.$owner.' WHERE directory = \''.$name.'\'',__LINE__,__FILE__);
+		 }
+		 return;
+	}
+
+	function update_quota()
+	{
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+			 
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
+		 $size = ($_GET['val'])*1;
+
+		 /* See if quota exists or not */
+		 $query = "SELECT count(directory) FROM phpgw_vfs_quota WHERE directory = '".$name."' LIMIT 1";
+		 if ($GLOBALS['phpgw']->db->query($query) && $GLOBALS['phpgw']->db->next_record())
+			 $val = $GLOBALS['phpgw']->db->row();
+		 else
+		 {
+			 echo $GLOBALS['phpgw']->db->error;
+			 return false;
+		 }
+		 if ($val['count'] == '1')
+		 {
+			 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs_quota SET quota_size = '.$size.' WHERE directory = \''.$name.'\'',__LINE__,__FILE__);
 			 if ($GLOBALS['phpgw']->db->Error)
 				 echo "Erro";
 			 else
-			 {
-				 $dirs=explode('/',$name);
-				 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs SET owner_id = '.$owner.' WHERE directory = \'/'.$dirs[1].'\' and name=\''.$dirs[2].'\'',__LINE__,__FILE__);
-				 if ($GLOBALS['phpgw']->db->Error)
-					 echo "Erro";
-				 else
-				 {
-					 echo lang('entry updated sucessfully');
-				 }
-			 }
-			 return;
-		 }
-	
-		 function update_quota(){
-			 $GLOBALS['phpgw_info']['flags'] = array
-				 (
-					 'currentapp'    => 'filemanager',
-					 'noheader'      => True,
-					 'nonavbar' => True,
-					 'nofooter'      => True,
-					 'noappheader'   => True,
-					 'enable_browser_class'  => True
-				 );
-			 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['dir']));
-			 $size = ($_GET['val'])*1;
-
-			 /* See if quota exists or not */
-			 $query = "SELECT count(directory) FROM phpgw_vfs_quota WHERE directory = '".$name."' LIMIT 1";
-			 if ($GLOBALS['phpgw']->db->query($query) && $GLOBALS['phpgw']->db->next_record())
-				 $val = $GLOBALS['phpgw']->db->row();
+				 echo lang('entry updated sucessfully');
+		 }
+		 else
+		 {
+			 /*preferences does not exist*/
+			 $query = "INSERT INTO phpgw_vfs_quota values ('".$name."',".$size.")";
+			 if (!$GLOBALS['phpgw']->db->query($query))
+				 echo $GLOBALS['phpgw']->db->error;
 			 else
-			 {
-				 echo $GLOBALS['phpgw']->db->error;
-				 return false;
-			 }
-			 if ($val['count'] == '1')
-			 {
-				 $GLOBALS['phpgw']->db->query('UPDATE phpgw_vfs_quota SET quota_size = '.$size.' WHERE directory = \''.$name.'\'',__LINE__,__FILE__);
-				 if ($GLOBALS['phpgw']->db->Error)
-					 echo "Erro";
-				 else
-					 echo lang('entry updated sucessfully');
-			 }
-			 else
-			 {
-				 /*preferences does not exist*/
-				 $query = "INSERT INTO phpgw_vfs_quota values ('".$name."',".$size.")";
-				 if (!$GLOBALS['phpgw']->db->query($query))
-					 echo $GLOBALS['phpgw']->db->error;
-				 else
-					 echo lang('entry updated sucessfully');
-			 }
-			 return; 
-		 }
-		 function load_quota(){
-			 $GLOBALS['phpgw_info']['flags'] = array
-				 (
-					 'currentapp'    => 'filemanager',
-					 'noheader'      => True,
-					 'nonavbar' => True,
-					 'nofooter'      => True,
-					 'noappheader'   => True,
-					 'enable_browser_class'  => True
-				 );
-			 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['name']));
-			 $GLOBALS['phpgw']->db->query('SELECT quota_size FROM phpgw_vfs_quota WHERE directory = \''.$name.'\' LIMIT 1',__LINE__,__FILE__);
-			 $GLOBALS['phpgw']->db->next_record();
-			 $val =$GLOBALS['phpgw']->db->row();
-			 echo $val['quota_size'];
-			 return;
-
-		 }
-
-
-	}
+				 echo lang('entry updated sucessfully');
+		 }
+		 return; 
+	 }
+	 
+	 function load_quota()
+	 {
+		 $GLOBALS['phpgw_info']['flags']['noheader'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nonavbar'] 	= True;
+		 $GLOBALS['phpgw_info']['flags']['nofooter']	= True;
+		 $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+			 
+		 $name = $GLOBALS['phpgw']->db->db_addslashes(base64_decode($_GET['name']));
+		 $GLOBALS['phpgw']->db->query('SELECT quota_size FROM phpgw_vfs_quota WHERE directory = \''.$name.'\' LIMIT 1',__LINE__,__FILE__);
+		 $GLOBALS['phpgw']->db->next_record();
+		 $val =$GLOBALS['phpgw']->db->row();
+		 echo $val['quota_size'];
+		 return;
+
+	 }
+}
+
 ?>
Index: /branches/2.2/filemanager/inc/hook_admin.inc.php
===================================================================
--- /branches/2.2/filemanager/inc/hook_admin.inc.php	(revision 3019)
+++ /branches/2.2/filemanager/inc/hook_admin.inc.php	(revision 3619)
@@ -25,9 +25,9 @@
 	$title = $appname;
 	$file = Array(
-		'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
-		'Folders management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.folders'),
-		'Quota management' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.quota'),
-		'Permissions of groups and users' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.groups_users')
-
+		'Site Configuration' 	=> $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
+		'Folders management' 	=> $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.folders'),
+		'Quota management' 		=> $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.quota'),
+		'Permissions of groups and users' => $GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiconfig.groups_users'),
+		'Email notify uploads' 	=> $GLOBALS['phpgw']->link('/index.php', 'menuaction='.$appname.'.uiconfig.notifyUploads')
 	);
 //Do not modify below this line
Index: /branches/2.2/filemanager/js/connector.js
===================================================================
--- /branches/2.2/filemanager/js/connector.js	(revision 3019)
+++ /branches/2.2/filemanager/js/connector.js	(revision 3619)
@@ -113,5 +113,5 @@
 	divUpload.innerHTML= "<iframe onload=\"connector.hideProgressBar();cExecute_('./index.php/index.php?menuaction=filemanager.uifilemanager.getReturnExecuteForm',"+form_handler+");\"  style='display:none;width:0;height:0;' name='uploadFile'></iframe>";
 	form.target ="uploadFile";
-        form.submit();
+    form.submit();
 }
 
Index: /branches/2.2/filemanager/js/handler.js
===================================================================
--- /branches/2.2/filemanager/js/handler.js	(revision 3591)
+++ /branches/2.2/filemanager/js/handler.js	(revision 3619)
@@ -1,30 +1,42 @@
 function handler(){
 }
-handler.prototype.del = function(data){
-        var returnVal = data.split('|');
-        var deletedFiles = "";
-        for (i=0; i < returnVal.length; i++)
-                if (returnVal[i] == 'False'){
-                        write_error(get_lang('Could not delete %1',returnVal[i+1]));
-                        return;
-                }else
-                {
-                        if (returnVal[i] != ""){
-                                deletedFiles += ", "+returnVal[i];
-                                /*var element = document.getElementById("name_"+returnVal[i]);
-                                var pai = element.parentNode.parentNode.parentNode;
-                                pai.parentNode.removeChild(pai);*/
-                        }
+
+handler.prototype.del = function(data)
+{
+	var _return = data;
+	var deletedFiles = "";
+	
+	_return = _return.substring(0, ( _return.length - 1 ) );
+	_return = _return.split("|");
+	
+	
+	for (var i = 0 ; i < _return.length; i++)
+	{	
+		if ( _return[i] == 'False')
+		{
+			write_error(get_lang('Could not delete %1', _return[i+1]) );
+			return;
+		}
+		else
+		{
+			if ( _return[i] != "" )
+			{
+				deletedFiles += ", " + _return[i];
+			}
+	
 			if (i > 3) //to avoid big message
 			{
-				deletedFiles = "  " +returnVal.length + " " +get_lang("files");
+				deletedFiles = "  " + _return.length + " " +get_lang("files");
 				break;
 			}
-                }
-                write_msg(get_lang('Deleted %1',deletedFiles.substr(2)));
-        //Repaint stripes 
+		}
+	}
+	
+	write_msg(get_lang('Deleted %1',deletedFiles.substr(2)));
+	
 	toolbar.control('reload');
-        //folderList.drawStripes();
-}
+
+}
+
 handler.prototype.rename = function(data) {
         if (data == null){
@@ -62,6 +74,8 @@
 
 }
-handler.prototype.upload = function(data){
-        close_window();
+
+handler.prototype.upload = function(data)
+{
+        
         connector.hideProgressBar();
         var response = unserialize(data);
@@ -73,5 +87,7 @@
         toolbar.control('reload');
 }
-handler.prototype.restricted = function(data){
+
+handler.prototype.restricted = function(data)
+{
         if (data.indexOf("True") == 0){
                 returnVal = data.split('|');
@@ -91,5 +107,7 @@
                 write_error("Could not mark as restricted");
 }
-handler.prototype.archive = function(data) {
+
+handler.prototype.archive = function(data)
+{
 	returnVal = data.split('|');
 	if (returnVal[0] == 'False')
@@ -108,5 +126,7 @@
 
 }
-handler.prototype.updateComment = function (data) {
+
+handler.prototype.updateComment = function (data)
+{
 	var returnVal = data.split('|');
 	if (data.indexOf("True") == 0)
@@ -174,5 +194,6 @@
 }
 
-handler.prototype.copyto = function (data) {
+handler.prototype.copyto = function (data)
+{
 	returnVal = data.split('|');
 	if (returnVal[0] == 'NODIR')
@@ -188,4 +209,5 @@
 	}
 }
+
 handler.prototype.moveto = function (data) {
 	returnVal = data.split('|');
Index: /branches/2.2/filemanager/js/common_functions.js
===================================================================
--- /branches/2.2/filemanager/js/common_functions.js	(revision 3610)
+++ /branches/2.2/filemanager/js/common_functions.js	(revision 3619)
@@ -99,4 +99,5 @@
 			pArgs.lang_click_here	= get_lang("Click here");
 			pArgs.lang_more_files	= get_lang("More files");
+			pArgs.lang_send_email	= get_lang("Send email");
 			pArgs.height 			= 210;
 			pArgs.path_filemanager	= path_filemanager;
@@ -415,7 +416,27 @@
 function sendFiles()
 {
-		cExecuteForm_(document.getElementById('form_up'),handler.upload);
-		document.getElementById('button_up').style.visibility = "hidden";
-		var line = document.getElementById('uploadOption');
-		line.parentNode.innerHTML = "<img src='"+templatePath+"images/progress.gif'>";
-}
+	var _formUp			= document.getElementById('form_up');
+	var _uploadFiles	= document.getElementsByTagName('input');
+	var _flagSend		= true;
+	
+	for( var i = 0 ; i < _uploadFiles.length ; i++ )
+	{
+		if( _uploadFiles[i].name.indexOf("upload_file") > -1 )
+		{
+			if( _uploadFiles[i].value == "" )
+			{
+				removeInput( _uploadFiles[i] );
+				_flagSend = false;
+			}
+		}
+	}
+	
+	if( _flagSend )
+	{
+		cExecuteForm_( _formUp ,handler.upload);
+	}
+	else
+		write_msg(get_lang("No file(s) to send") + "!");
+
+	close_window();
+}
Index: /branches/2.2/filemanager/templates/default/notify_upload.tpl
===================================================================
--- /branches/2.2/filemanager/templates/default/notify_upload.tpl	(revision 3619)
+++ /branches/2.2/filemanager/templates/default/notify_upload.tpl	(revision 3619)
@@ -0,0 +1,56 @@
+<!-- BEGIN body -->
+
+	<form>
+		
+		<div style="margin-left:10px;">
+		
+			<div style="margin-top: 10px; margin-bottom: 10px;">
+				
+				<div>
+					<input type="button" name="button_add" value="Adicionar" onclick="alert('Adicionar um novo email para envio')"/>
+				</div>
+				
+				<!--		
+				<div style="margin-top: 10px; margin-bottom: 10px; position:relative; float:left;">
+					<fieldset style="width:400px;">
+						<legend> Procurar por </legend>
+						<input type="radio" name="opt_email" value="to" /> De
+						<input type="radio" name="opt_from"	value="from" /> From
+						<br/> 		
+						<label> Email .: </label>
+						<input type="text" size="40" maxlength="40" name="email_search" />
+						<input type="button" name="button_search" value="Procurar" onclick="alert('Adicionar um novo email para envio')"/>
+					</fieldset>
+				</div>
+				-->
+				
+			</div>
+			
+			<table style="border:0px; width:100% !important;">
+				<th>
+					<tr class="th">
+						<td align="left" width="40%">De ( Email )</td>
+						<td align="left" width="40%">Para ( Email ) </td>
+						<td align="center" width="10%">Editar</td>
+						<td align="center" width="10%">Excluir</td>	
+					</tr>
+				</th>
+			</table>
+			
+			
+			<div>
+				<div style="margin-top:10px; position:relative; float:left;">
+					<input type="button" onClick="document.location.href='{action_url_back}'" value="Voltar"/>
+				</div>
+				<div style="margin:10px; position:relative; float:right;">
+					{bt_previous}
+					{bt_next}
+				</div>
+				<input type="hidden" name="button_previous" value="{value_previous}" />
+				<input type="hidden" name="button_next" value="{value_next}" />
+			</div>
+		</div>
+		
+	</form>
+
+<!-- END body -->
