Index: sandbox/workflow/branches/993/lib/settings/Settings.php
===================================================================
--- sandbox/workflow/branches/993/lib/settings/Settings.php	(revision 2544)
+++ sandbox/workflow/branches/993/lib/settings/Settings.php	(revision 2552)
@@ -90,5 +90,6 @@
 				'lang' => ''
 			),
-			'webserver_url' => ''
+			'webserver_url' => '',
+			'use_https' => ''
 		)
 	);
@@ -261,4 +262,5 @@
 
 		self::$_configs['expresso']['webserver_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'];
+		self::$_configs['expresso']['use_https'] = $GLOBALS['phpgw_info']['server']['use_https'];
 
 		/* loading database settings */
Index: sandbox/workflow/branches/993/inc/class.run_activity.inc.php
===================================================================
--- sandbox/workflow/branches/993/inc/class.run_activity.inc.php	(revision 2533)
+++ sandbox/workflow/branches/993/inc/class.run_activity.inc.php	(revision 2552)
@@ -350,5 +350,5 @@
 			if ($this->conf['execute_activities_using_secure_connection'])
 			{
-				if (($GLOBALS['phpgw_info']['server']['use_https'] > 0) && ($_SERVER['HTTPS'] != 'on') && (!isset($GLOBALS['workflow']['job']['processID'])))
+				if ((Settings::get('expresso', 'use_https') > 0) && ($_SERVER['HTTPS'] != 'on') && (!isset($GLOBALS['workflow']['job']['processID'])))
 				{
 					header("Location: https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
Index: sandbox/workflow/branches/993/inc/local/classes/class.wf_mail.php
===================================================================
--- sandbox/workflow/branches/993/inc/local/classes/class.wf_mail.php	(revision 2492)
+++ sandbox/workflow/branches/993/inc/local/classes/class.wf_mail.php	(revision 2552)
@@ -51,5 +51,5 @@
 
 		/* configura os parâmetros para envio de e-mail */
-		$userLang = Settings('expresso', 'preferences', 'lang');
+		$userLang = Settings::get('expresso', 'preferences', 'lang');
 		/* FIXME: hardcoded 'br' because phpmailer don't use pt-br */
 		if ($userLang == 'pt-br')
Index: sandbox/workflow/branches/993/inc/class.WorkflowMacro.inc.php
===================================================================
--- sandbox/workflow/branches/993/inc/class.WorkflowMacro.inc.php	(revision 2544)
+++ sandbox/workflow/branches/993/inc/class.WorkflowMacro.inc.php	(revision 2552)
@@ -44,5 +44,5 @@
 		$_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] = PHPGW_API_INC;
 		$_SESSION['phpgw_info']['workflow']['account_id'] = Settings::get('expresso', 'user', 'account_id');
-		$_SESSION['phpgw_info']['workflow']['server']['webserver_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'];
+		$_SESSION['phpgw_info']['workflow']['server']['webserver_url'] = EGW_SERVER_URL;
 
 		require_once PHPGW_API_INC . '/functions.inc.php';
Index: sandbox/workflow/branches/993/inc/class.external_bridge.inc.php
===================================================================
--- sandbox/workflow/branches/993/inc/class.external_bridge.inc.php	(revision 2492)
+++ sandbox/workflow/branches/993/inc/class.external_bridge.inc.php	(revision 2552)
@@ -114,5 +114,5 @@
 	function render()
 	{
-		if (($GLOBALS['phpgw_info']['server']['use_https'] > 0) && ($_SERVER['HTTPS'] != 'on'))
+		if ((Settings::get('expresso', 'use_https') > 0) && ($_SERVER['HTTPS'] != 'on'))
 		{
 			header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_rtf_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_rtf_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_rtf_init.php	(revision 2552)
@@ -11,5 +11,5 @@
 function smarty_function_wf_rtf_init($params, &$smarty)
 {
-	$jsFile = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/rtf.js';
+	$jsFile = WF_BASE_URL . SEP  .'js' . SEP . 'jscode' . SEP . 'rtf.js';
 $output = <<<EOF
 <script language="javascript1.2" src="$jsFile"></script>
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_ldap_users_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_ldap_users_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_ldap_users_init.php	(revision 2552)
@@ -11,7 +11,7 @@
 function smarty_function_wf_select_ldap_users_init($params, &$smarty)
 {
-	$webServer = $GLOBALS['phpgw_info']['server']['webserver_url'];
-	$jsFilePath = $webServer . '/workflow/js';
-	$localFile = PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'js' . SEP . 'jscode' . SEP . 'connector.js';
+	$webServer = EGW_BASE_URL;
+	$jsFilePath = WF_BASE_URL . SEP . 'js';
+	$localFile = WF_SERVER_ROOT . SEP . 'js' . SEP . 'jscode' . SEP . 'connector.js';
 	$size = 0;
 	if (@file_exists($localFile))
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_make_link.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_make_link.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_make_link.php	(revision 2552)
@@ -43,6 +43,6 @@
 		$back_url = $url;
 	} else {
-		$back_url = ''; 
-		$back_url = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/index.php?start_tab=' . $tab;
+		$back_url = '';
+		$back_url = WF_BASE_URL . SEP . 'index.php?start_tab=' . $tab;
 	}
 	
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_user_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_user_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_user_init.php	(revision 2552)
@@ -11,5 +11,5 @@
 function smarty_function_wf_select_user_init($params, &$smarty)
 {
-	$jsFile = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/participants.js';
+	$jsFile = WF_BASE_URL . SEP . 'js' . SEP . 'jscode' . SEP . 'participants.js';
 $output = <<<EOF
 	<script language="javascript1.2" src="$jsFile"></script>
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_autocomplete_input_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_autocomplete_input_init.php	(revision 1428)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_autocomplete_input_init.php	(revision 2552)
@@ -11,9 +11,9 @@
 function smarty_function_wf_autocomplete_input_init($params, &$smarty)
 {
-	$jsEffects		= $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/scriptaculous/effects.js';
-	$jsControls		= $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/scriptaculous/controls.js';
-	$jsJson			= $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/nano/JSON.js';
-	$jsSha1			= $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/sha1.js';
-	$jsAutocomplete	= $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/wf_autocomplete_input.js';
+	$jsEffects		= WF_BASE_URL . SEP . 'js' . SEP . 'scriptaculous' . SEP . 'effects.js';
+	$jsControls		= WF_BASE_URL . SEP . 'js' . SEP . 'scriptaculous' . SEP . 'controls.js';
+	$jsJson			= WF_BASE_URL . SEP . 'js' . SEP . 'nano' . SEP . 'JSON.js';
+	$jsSha1			= WF_BASE_URL . SEP . 'js' . SEP . 'jscode' . SEP . 'sha1.js';
+	$jsAutocomplete	= WF_BASE_URL . SEP . 'js' . SEP . 'jscode' . SEP . 'wf_autocomplete_input.js';
 	$output = <<<EOF
 	<script type="text/javascript" src="$jsEffects"></script>
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_option_multiple_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_option_multiple_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_option_multiple_init.php	(revision 2552)
@@ -11,5 +11,5 @@
 function smarty_function_wf_select_option_multiple_init($params, &$smarty)
 {
-	$jsFile = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/wf_select_option_multiple.js';
+	$jsFile = WF_BASE_URL . SEP . 'js' . SEP . 'jscode' . SEP . 'wf_select_option_multiple.js';
 	$output = <<<EOF
 	<script language="javascript1.2" src="$jsFile"></script>
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_ajax_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_ajax_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_ajax_init.php	(revision 2552)
@@ -20,5 +20,5 @@
 		$wf_ajax_init = true;
 
-		$serverPath = $GLOBALS['phpgw_info']['server']['webserver_url'];
+		$serverPath = EGW_BASE_URL;
 		$localPath = PHPGW_SERVER_ROOT;
 
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_fckeditor.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_fckeditor.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_fckeditor.php	(revision 2552)
@@ -58,5 +58,5 @@
 
 	// BasePath must be specified once.
-    $base_arguments['BasePath'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow' . SEP . 'js' . SEP . 'fckeditor' . SEP;
+    $base_arguments['BasePath'] = WF_BASE_URL . SEP . 'js' . SEP . 'fckeditor' . SEP;
 
 	$base_arguments['InstanceName'] = $params['InstanceName'];
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_duplex_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_duplex_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_duplex_init.php	(revision 2552)
@@ -11,5 +11,5 @@
 function smarty_function_wf_select_duplex_init($params, &$smarty)
 {
-	$jsFile = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/wf_select_duplex.js';
+	$jsFile = WF_BASE_URL . SEP . 'js' . SEP . 'jscode' . SEP . 'wf_select_duplex.js';
 	$output = <<<EOF
 	<script language="javascript1.2" src="$jsFile"></script>
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_users_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_users_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_users_init.php	(revision 2552)
@@ -11,5 +11,5 @@
 function smarty_function_wf_select_users_init($params, &$smarty)
 {
-	$jsFile = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/userControl.js';
+	$jsFile = WF_BASE_URL . SEP . 'js' . SEP .'jscode' . SEP . 'userControl.js';
 $output = <<<EOF
 	<script language="javascript1.2" src="$jsFile"></script>
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php	(revision 2492)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php	(revision 2552)
@@ -30,5 +30,5 @@
 		$$extract = $params[$extract];
 
-    $base_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
+    $base_url = EGW_BASAE_URL;
 	$user_activities = $GLOBALS['workflow']['wf_user_activities']['data'];
 	$pid = $GLOBALS['workflow']['wf_process_id'];
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_city_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_city_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_select_city_init.php	(revision 2552)
@@ -11,6 +11,6 @@
 function smarty_function_wf_select_city_init($params, &$smarty)
 {
-	$webServer = $GLOBALS['phpgw_info']['server']['webserver_url'];
-	$jsFilePath = $webServer . '/workflow/js';
+	$webServer = EGW_BASE_URL;
+	$jsFilePath = WF_BASE_URL . SEP . 'js';
 	$localFile = PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'js' . SEP . 'jscode' . SEP . 'connector.js';
 	$size = 0;
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_calendar_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_calendar_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_calendar_init.php	(revision 2552)
@@ -21,5 +21,5 @@
 		$path = $params['path'] . "/";
 	else
-		$path = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscalendar/';
+		$path = WF_SERVER_URL . SEP . 'js' . SEP . 'jscalendar' . SEP;
 	$defaults = array(
 		'css' => $path . 'calendar-blue.css',
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_generic_select_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_generic_select_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_generic_select_init.php	(revision 2552)
@@ -11,5 +11,5 @@
 function smarty_function_wf_generic_select_init($params, &$smarty)
 {
-	$jsFile = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/generic_select.js';
+	$jsFile = WF_BASE_URL . SEP . 'js' . SEP . 'jscode' . SEP . 'generic_select.js';
 $output = <<<EOF
 	<script language="javascript1.2" src="$jsFile"></script>
Index: sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_file_upload_init.php
===================================================================
--- sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_file_upload_init.php	(revision 795)
+++ sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_file_upload_init.php	(revision 2552)
@@ -11,5 +11,5 @@
 function smarty_function_wf_file_upload_init($params, &$smarty)
 {
-	$jsFile = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/workflow/js/jscode/wf_file_upload.js';
+	$jsFile = WF_BASE_URL . SEP . 'js' . SEP . 'jscode' . SEP . 'wf_file_upload.js';
 $output = <<<EOF
 	<script language="javascript1.2" src="$jsFile"></script>
