Index: trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 2802)
+++ trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 2878)
@@ -59,5 +59,5 @@
 			}
 			// Imprime o NavBar
-			unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+			//unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
 			$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['expressoAdmin1_2']['title'].' - '.lang('List Managers');
 			//$GLOBALS['phpgw']->common->phpgw_header();
@@ -72,5 +72,6 @@
 
 			$var = Array(
-				'action' 			=> $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uimanagers.add_managers'),
+				'action' 			=> $GLOBALS[ 'phpgw' ] -> link( '/index.php', 'menuaction=expressoAdmin1_2.uimanagers.add_managers' ),
+				'action_back'		=> $GLOBALS[ 'phpgw' ] -> link( '/admin/' ),
 				'tr_color'			=> '#DDDDDD',
 				'th_bg'         	=> $GLOBALS['phpgw_info']['theme']['th_bg']
@@ -170,7 +171,5 @@
 			// Seta variaveis que estao no TPL
 			$var = Array(
-				'scripts_java'			=>	'',//$scripts_java,	
-				//'action'				=> $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uimanagers.validate'),
-				//'action'				=> $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.bomanagers.add_managers'),
+				'action'				=> $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.manager.'),
 				'display_samba_suport'	=> $this->config['expressoAdmin_samba_support'] == 'true' ? '' : 'display:none',
 				'type'					=> "add",
@@ -290,8 +289,4 @@
 			//$GLOBALS['phpgw']->common->phpgw_header();
 
-			// Seta variaveis javas necessárias
-			$webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
-			$scripts_java = '<script type="text/javascript" src="'.$webserver_url.'/expressoAdmin1_2/js/jscode/expressoadmin.js"></script>';
-
 			// App, create list of available apps
 			$applications_list = $this->make_app_list($manager[0]['apps']);
@@ -303,5 +298,4 @@
 
 			$var = Array(
-				'scripts_java'				=> '',//$scripts_java,
 				'action'					=> $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.manager.'),
 				'display_samba_suport'		=> $this->config['expressoAdmin_samba_support'] == 'true' ? '' : 'display:none',
Index: trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 2707)
+++ trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 2878)
@@ -2037,5 +2037,5 @@
 		}
     	
-    	return $options;		
+    	return json_encode( $options );
 	}
 	
Index: trunk/expressoAdmin1_2/inc/class.manager.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.manager.inc.php	(revision 2459)
+++ trunk/expressoAdmin1_2/inc/class.manager.inc.php	(revision 2878)
@@ -72,17 +72,17 @@
 			else
 				$_SESSION['phpgw_info']['expresso']['server'] = $GLOBALS['phpgw_info']['server'];
-			
+
 			$return['status'] = 'true';
-			
+
 			$contexts = split("%", $params['contexts']);
 			$manager_lid = $params['manager_lid'];
 			$type = $params['type'];
-			
+
 			if ($contexts == '')
 			{
 				$return['status'] = 'false';
 				$return['msg'] = $this->functions->lang('context field is empty') . '.';
-				
-				return $return;
+
+				return json_encode( $return );
 			}
 			if (($manager_lid == '') && ($type == 'add'))
@@ -90,8 +90,8 @@
 				$return['status'] = 'false';
 				$return['msg'] = $this->functions->lang('select one manager') . '.';
-				
-				return $return;
+
+				return json_encode( $return );
 			}
-			
+
 			// Verifica se o contexto existe.
 			$dn			= $GLOBALS['phpgw_info']['server']['ldap_root_dn'];
@@ -101,5 +101,5 @@
 			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
 			ldap_bind($ldap_conn,$dn,$passwd);
-			
+
 			foreach ($contexts as $index=>$context)
 			{
@@ -108,24 +108,24 @@
 				{
 					$return['status'] = 'false';
-					$this->functions->lang('context does not exist') . ": $context";
-					return $return;
-				}				
+					$return['msg'] = $this->functions->lang('context does not exist') . ": $context";
+					return json_encode( $return );
+				}
 			}
-			
+
 			if ($type == 'add')
 			{
 				include_once('class.db_functions.inc.php');
 				$db = new db_functions();
-				
+
 				if ($db->manager_lid_exist($manager_lid))
 				{
 					$return['status'] = 'false';
 					$return['msg'] = $this->functions->lang('manager already exist') . ".";
-					
-					return $return;
+
+					return json_encode( $return );
 				}
 			}
-			
-			return $return;
+
+			return json_encode( $return );
 		}
 		
Index: trunk/expressoAdmin1_2/js/jscode/managers.js
===================================================================
--- trunk/expressoAdmin1_2/js/jscode/managers.js	(revision 2802)
+++ trunk/expressoAdmin1_2/js/jscode/managers.js	(revision 2878)
@@ -75,4 +75,5 @@
 	var handler_validade = function(data)
 	{
+		data = data.JSON( );
 		if (data.status == 'false')
 		{
@@ -90,6 +91,9 @@
 		}
 	};
-	
-	cExecute ('expressoAdmin1_2.manager.validate&contexts='+contexts+'&manager_lid='+document.managers_form.ea_select_manager.value+'&type='+type, handler_validade);
+
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.manager.validate&contexts='+contexts+'&manager_lid='+document.managers_form.ea_select_manager.value+'&type='+type,
+		"handler" : handler_validade
+	} );
 }
 function handler_createsave_manager(data){
@@ -132,4 +136,5 @@
 	var handler_search_manager = function(data)
 	{
+		data = data.JSON( );
 		var spam = document.getElementById('ea_span_searching_manager');
 		select_available_users = document.getElementById('ea_select_managers');
@@ -150,5 +155,8 @@
 	}
 	
-	cExecute ('$this.ldap_functions.search_user&search='+search, handler_search_manager);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.ldap_functions.search_user&search='+search,
+		"handler" : handler_search_manager
+	} );
 }
 
Index: trunk/expressoAdmin1_2/templates/default/managers.tpl
===================================================================
--- trunk/expressoAdmin1_2/templates/default/managers.tpl	(revision 309)
+++ trunk/expressoAdmin1_2/templates/default/managers.tpl	(revision 2878)
@@ -4,7 +4,6 @@
   <tr>
    <td align="right">
-    <form method="POST" action="{action}">
-    	<input type="submit" value="{lang_add_manager}"
-    </form>
+    <input type="button" value="{lang_add_manager}" onclick="ExpressoLivre.link( '{action}' )" />&nbsp;
+    <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{action_back}' )" />
    </td>
   </tr>
Index: trunk/expressoAdmin1_2/templates/default/managers_form.tpl
===================================================================
--- trunk/expressoAdmin1_2/templates/default/managers_form.tpl	(revision 1913)
+++ trunk/expressoAdmin1_2/templates/default/managers_form.tpl	(revision 2878)
@@ -1,7 +1,3 @@
 <!-- BEGIN form -->
-
-<!--JS Imports from phpGW javascript class -->
-{scripts_java}
-
 <form action="{action}" name="managers_form" method="post">
  	<div align="center">
@@ -15,5 +11,5 @@
 			<tr bgcolor="{color_bg1}" align="right">
 				<td colspan="2">
-				<input type="button" value="{lang_back}" onclick="javascript:location.href='index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers'">
+				<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '/index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers' )" />
 				<input type="button" value="{lang_save}" onclick="javascript:validade_managers_data('{type}');">
 				</td>
@@ -197,5 +193,5 @@
 						<td>
 							<input type="button" value="{lang_save}" onclick="javascript:validade_managers_data('{type}');">
-							<input type="button" value="{lang_back}" onclick="javascript:location.href='index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers'">
+							<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '/index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers' )" />
 						</td>
 					</tr>
