Index: /trunk/phpgwapi/js/expressolivre/expressolivre.js
===================================================================
--- /trunk/phpgwapi/js/expressolivre/expressolivre.js	(revision 2704)
+++ /trunk/phpgwapi/js/expressolivre/expressolivre.js	(revision 2707)
@@ -48,5 +48,6 @@
 
 	_xconnector = new XConnector( {
-		"path" : ExpressoLivre.path( )
+		"path" : ExpressoLivre.path( ),
+		"controller" : "?menuaction="
 	} );
 
Index: /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php	(revision 2469)
+++ /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php	(revision 2707)
@@ -683,5 +683,5 @@
 		}
 			
-		return $result;
+		return json_encode( $result );
 	}
 	
Index: /trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 2459)
+++ /trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 2707)
@@ -35,5 +35,6 @@
 				$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
 			}
-			$GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');#diretorio, arquivo.js, aplicacao
+			$GLOBALS['phpgw']->js->validate_file('jscode','globals','expressoAdmin1_2');
+			$GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');
 			$GLOBALS['phpgw']->js->validate_file('jscode','expressoadmin','expressoAdmin1_2');
 			$GLOBALS['phpgw']->js->validate_file('jscode','managers','expressoAdmin1_2');
@@ -124,5 +125,6 @@
 
 			$p->set_var($var);
-			echo "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/controller.php' )}?action=';</script>" . $GLOBALS['phpgw']->js->get_script_links( );
+			$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>";
+			//echo "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/controller.php' )}?action=';</script>" . $GLOBALS['phpgw']->js->get_script_links( );
 			$p->pfp('out','body');
 		}
@@ -170,5 +172,5 @@
 			// Seta variaveis que estao no TPL
 			$var = Array(
-				'scripts_java'			=>	$scripts_java,	
+				'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'),
@@ -302,5 +304,5 @@
 
 			$var = Array(
-				'scripts_java'				=> $scripts_java,
+				'scripts_java'				=> '',//$scripts_java,
 				'action'					=> $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uimanagers.validate'),
 				'display_samba_suport'		=> $this->config['expressoAdmin_samba_support'] == 'true' ? '' : 'display:none',
@@ -344,6 +346,6 @@
 				}
 			}
-			
-			echo "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>" . $GLOBALS['phpgw']->js->get_script_links( );
+
+			$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>";
 			echo $p->fp('out','form');
 		}
Index: /trunk/expressoAdmin1_2/inc/class.uishared_accounts.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.uishared_accounts.inc.php	(revision 2549)
+++ /trunk/expressoAdmin1_2/inc/class.uishared_accounts.inc.php	(revision 2707)
@@ -31,5 +31,6 @@
 					$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
 				}
-				$GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');#diretorio, arquivo.js, aplicacao
+				$GLOBALS['phpgw']->js->validate_file('jscode','globals','expressoAdmin1_2');
+				$GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');
 				$GLOBALS['phpgw']->js->validate_file('jscode','shared_accounts','expressoAdmin1_2');
 				$GLOBALS['phpgw']->js->validate_file('modal','modal','expressoAdmin1_2');
Index: /trunk/expressoAdmin1_2/inc/class.shared_accounts.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.shared_accounts.inc.php	(revision 1983)
+++ /trunk/expressoAdmin1_2/inc/class.shared_accounts.inc.php	(revision 2707)
@@ -110,4 +110,5 @@
                         $return['mailquota_used'] = $quota['mailquota_used'];                        
                         $i = 0;
+						error_log( var_export( $owners_acl, true ), 3, '/tmp/log' );
                         if( is_array($owners_acl) ){
 	                        foreach($owners_acl as $key => $value)
@@ -124,5 +125,6 @@
                                 $return['owners_acl'] = false;
                         }                        
-                        return $return;
+						error_log( var_export( $return, true ), 3, '/tmp/log' );
+                        return json_encode( $return );
                 }
                 function delete($params){
Index: /trunk/expressoAdmin1_2/inc/class.institutional_accounts.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.institutional_accounts.inc.php	(revision 2549)
+++ /trunk/expressoAdmin1_2/inc/class.institutional_accounts.inc.php	(revision 2707)
@@ -29,5 +29,7 @@
 					$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
 				}
-				$GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');#diretorio, arquivo.js, aplicacao
+
+				$GLOBALS['phpgw']->js->validate_file('jscode','globals','expressoAdmin1_2');
+				$GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');
 				$GLOBALS['phpgw']->js->validate_file('jscode','institutional_accounts','expressoAdmin1_2');
 				$GLOBALS['phpgw']->js->validate_file('modal','modal','expressoAdmin1_2');
Index: /trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 2459)
+++ /trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 2707)
@@ -750,5 +750,5 @@
 				unset($u_tmp);
 			}			
-    		return $options;
+    		return json_encode( $options );
 		}
 	}
@@ -2292,5 +2292,5 @@
     	$return['status'] = 'true';
     	$return['trs'] = $trs_string;
-    	return $return;
+    	return json_encode( $return );
 }	
 	
@@ -2386,5 +2386,5 @@
     	$return['status'] = 'true';
     	$return['trs'] = $trs_string;
-    	return $return;
+    	return json_encode( $return );
 	}
 	
Index: /trunk/expressoAdmin1_2/js/jscode/institutional_accounts.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/institutional_accounts.js	(revision 2352)
+++ /trunk/expressoAdmin1_2/js/jscode/institutional_accounts.js	(revision 2707)
@@ -60,5 +60,8 @@
 		}
 	}
-	cExecute ('$this.ldap_functions.get_available_users&context='+context, handler_get_users);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.ldap_functions.get_available_users&context=' + escape(context),
+		"handler" : handler_get_users
+	} );
 }
 
@@ -114,16 +117,16 @@
 	
 	//Inclui usuario comecando com a pesquisa
-	for(i = 0; i < select_available_users_clone.length; i++){
-		if ( RegExp_name.test(select_available_users_clone[i].text) || (select_available_users_clone[i].value == -1) )
-		{
-			sel = select_available_users_tmp.options;
-			option = new Option(select_available_users_clone[i].text,select_available_users_clone[i].value);
-
-			if (select_available_users_clone[i].value == -1)
-				option.disabled = true;
-
-			sel[sel.length] = option;
-		}
-	}
+	//for(i = 0; i < select_available_users_clone.length; i++){
+	//	if ( RegExp_name.test(select_available_users_clone[i].text) || (select_available_users_clone[i].value == -1) )
+	//	{
+	//		sel = select_available_users_tmp.options;
+	//		option = new Option(select_available_users_clone[i].text,select_available_users_clone[i].value);
+//
+//			if (select_available_users_clone[i].value == -1)
+//				option.disabled = true;
+//
+//			sel[sel.length] = option;
+//		}
+//	}
 	oWait.innerHTML = '&nbsp;';
 }			
@@ -202,4 +205,5 @@
 	var handler_get_institutional_accounts = function(data)
 	{
+		data = data.JSON( );
 		if (data.status == 'true')
 		{
@@ -210,5 +214,8 @@
 			write_msg(data.msg, 'error');
 	}
-	cExecute ('$this.ldap_functions.get_institutional_accounts&input='+input, handler_get_institutional_accounts);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.ldap_functions.get_institutional_accounts&input='+input,
+		"handler" : handler_get_institutional_accounts
+	} );
 }
 
Index: /trunk/expressoAdmin1_2/js/jscode/shared_accounts.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/shared_accounts.js	(revision 2352)
+++ /trunk/expressoAdmin1_2/js/jscode/shared_accounts.js	(revision 2707)
@@ -62,4 +62,5 @@
 	var	handler_get_users = function(data)
 	{
+		data = data.JSON( );
 		select_available_users = Element('ea_select_available_users');
 		
@@ -82,5 +83,8 @@
 		}
 	}
-	cExecute ('$this.ldap_functions.get_available_users2&context='+context, handler_get_users);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.ldap_functions.get_available_users2&context='+context,
+		"handler" : handler_get_users
+	} );
 }
 
@@ -239,4 +243,5 @@
 	var handler_get_shared_accounts = function(data)
 	{
+		data = data.JSON( );
 		if (data.status == 'true')
 		{
@@ -247,5 +252,8 @@
 			write_msg(data.msg, 'error');
 	}
-	cExecute ('$this.ldap_functions.get_shared_accounts&input='+input, handler_get_shared_accounts);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.ldap_functions.get_shared_accounts&input='+input,
+		"handler" : handler_get_shared_accounts
+	} );
 }
 
@@ -254,4 +262,5 @@
 	var handle_edit_shared_account = function(data)
 	{
+		data = data.JSON( );
 		if (data.status == 'true')
 		{
@@ -300,5 +309,5 @@
 			sinc_combos_org(data.user_context);
                         sharemailbox.ownersAcl = new Array();
-            if( data.owners != "undefined" && data.owners_acl != "undefined" ){ 
+            if( data.owners && data.owners != "undefined" && data.owners_acl != "undefined" ){ 
 				for (i=0; i<data.owners.length; i++){
 						sharemailbox.ownersAcl[ data.owners[i] ] = data.owners_acl[i];	
@@ -309,5 +318,8 @@
 			write_msg(data.msg, 'error');
 	}
-	cExecute ('$this.shared_accounts.get_data&uid='+uid, handle_edit_shared_account);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.shared_accounts.get_data&uid='+uid,
+		"handler" : handle_edit_shared_account
+	} );
 }
 
@@ -383,4 +395,6 @@
 		var handler_get_available_users = function(data)
 		{
+			data = data.JSON( );
+
 			select_available_users = document.getElementById('em_select_available_users');
 		
@@ -403,5 +417,8 @@
 			}
 		}
-		cExecute ("$this.ldap_functions.get_available_users2&context="+context, handler_get_available_users);
+		ExpressoLivre.go( {
+			"access" : 'expressoAdmin1_2.ldap_functions.get_available_users2&context='+context,
+			"handler" : handler_get_available_users
+		} );
 	}
 
Index: /trunk/expressoAdmin1_2/js/jscode/expressoadmin.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/expressoadmin.js	(revision 2604)
+++ /trunk/expressoAdmin1_2/js/jscode/expressoadmin.js	(revision 2707)
@@ -52,6 +52,6 @@
 		}
 	}
-	_controller.go( {
-		"access" : "$this.ldap_functions.get_associated_domain&context=" + context,
+	ExpressoLivre.go( {
+		"access" : "expressoAdmin1_2.ldap_functions.get_associated_domain&context=" + escape( context ),
 		"handler" : function( data )
 		{
Index: /trunk/expressoAdmin1_2/templates/default/config.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/config.tpl	(revision 2703)
+++ /trunk/expressoAdmin1_2/templates/default/config.tpl	(revision 2707)
@@ -2,5 +2,4 @@
 <form method="POST" action="{action_url}">
 <table border="0" align="center">
-<script src="./expressoAdmin1_2/js/jscode/connector.js" type="text/javascript" language="JavaScript1.2"></script>
 <script>
 function test_db_connection()
@@ -8,4 +7,5 @@
 	var handler_test = function(data)
 	{
+		data = data.JSON( );
 		var result = document.getElementById('nextid_db_result');
 		if (data.status)
@@ -21,5 +21,8 @@
 	var pass = document.getElementById('nextid_db_password').value;
 	
-	cExecute ('$this.db_functions.test_db_connection&host='+host+'&port='+port+'&name='+name+'&user='+user+'&pass='+pass, handler_test);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.db_functions.test_db_connection&host='+host+'&port='+port+'&name='+name+'&user='+user+'&pass='+pass,
+		"handler" : handler_test
+	} );
 }
 </script>
Index: /trunk/index.php
===================================================================
--- /trunk/index.php	(revision 2703)
+++ /trunk/index.php	(revision 2707)
@@ -90,7 +90,9 @@
 
 	$GLOBALS[$class] = CreateObject(sprintf('%s.%s',$app,$class));
-	if((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data)
+	if ( is_object( $GLOBALS[ $class ] ) && ( ( ! property_exists( $class, 'public_functions' ) ) || (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data ) )
 	{
-		execmethod($_GET['menuaction']);
+		$menuaction = $_GET[ 'menuaction' ];
+		unset( $_GET[ 'menuaction' ] );
+		echo execmethod( $menuaction, $_GET );
 		unset($app);
 		unset($class);
@@ -137,5 +139,5 @@
 		}
 
-		echo '<script>ExpressoLivre.link( "' . $GLOBALS[ 'phpgw' ] -> link( '/home.php' ) . '", true );</script>';
+		echo '<script>ExpressoLivre.link( "' . $GLOBALS[ 'phpgw' ] -> link( '/home.php' ) . '", true );/* ??? */</script>';
 		exit;
 	}
