Index: trunk/phpgwapi/templates/default/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/default/navbar.inc.php	(revision 2519)
+++ trunk/phpgwapi/templates/default/navbar.inc.php	(revision 2529)
@@ -1,200 +1,202 @@
 <?php
-	/**************************************************************************\
-	* phpGroupWare                                                             *
-	* http://www.phpgroupware.org                                              *
-	* --------------------------------------------                             *
-	*  This program is free software; you can redistribute it and/or modify it *
-	*  under the terms of the GNU General Public License as published by the   *
-	*  Free Software Foundation; either version 2 of the License, or (at your  *
-	*  option) any later version.                                              *
-	\**************************************************************************/
-
-
-	function parse_navbar($force = False)
-	{
-		$GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-
-		$GLOBALS['celepar_tpl']->set_file(
-			array(
-				'navbar' => 'navbar.tpl'
-			)
-		);
-
-		$GLOBALS['celepar_tpl']->set_block('navbar','navbar_header','navbar_header');
-		$GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_header','extra_block_header');
-		$GLOBALS['celepar_tpl']->set_block('navbar','extra_block_row','extra_block_row');
-		$GLOBALS['celepar_tpl']->set_block('navbar','extra_block_spacer','extra_block_spacer');
-		$GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_footer','extra_blocks_footer');
-		$GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_header','sidebox_hide_header');
-		$GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_footer','sidebox_hide_footer');
-		$GLOBALS['celepar_tpl']->set_block('navbar','appbox','appbox');
-		$GLOBALS['celepar_tpl']->set_block('navbar','navbar_footer','navbar_footer');
-		
-	        $GLOBALS['celepar_tpl']->set_var('my_preferences', lang("My Preferences"));
-                $GLOBALS['celepar_tpl']->set_var('title_my_preferences', lang("Click here to change your Expresso password and other preferences"));
-                $GLOBALS['celepar_tpl']->set_var('title_suggestions', lang("Send your critics, doubts or suggestions"));
-                $GLOBALS['celepar_tpl']->set_var('suggestions', lang("Suggestions"));
-                $GLOBALS['celepar_tpl']->set_var('help', lang("Help"));
-		$GLOBALS['celepar_tpl']->set_var('title_help', lang("Click here for help"));
-		$GLOBALS['celepar_tpl']->set_var('template',$GLOBALS['phpgw_info']['server']['template_set']);
-
-		$var['img_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images';
-		$var['dir_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'];
-		$var['table_bg_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg'];
-
-		if($GLOBALS['phpgw_info']['user']['preferences']['common']['click_or_onmouseover']=='onmouseover')
+/**************************************************************************\
+* phpGroupWare                                                             *
+* http://www.phpgroupware.org                                              *
+* --------------------------------------------                             *
+*  This program is free software; you can redistribute it and/or modify it *
+*  under the terms of the GNU General Public License as published by the   *
+*  Free Software Foundation; either version 2 of the License, or (at your  *
+*  option) any later version.                                              *
+\**************************************************************************/
+
+
+function parse_navbar($force = False)
+{
+	$GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
+
+	$GLOBALS['celepar_tpl']->set_file(
+		array(
+			'navbar' => 'navbar.tpl'
+		)
+	);
+
+	$GLOBALS['celepar_tpl']->set_block('navbar','navbar_header','navbar_header');
+	$GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_header','extra_block_header');
+	$GLOBALS['celepar_tpl']->set_block('navbar','extra_block_row','extra_block_row');
+	$GLOBALS['celepar_tpl']->set_block('navbar','extra_block_spacer','extra_block_spacer');
+	$GLOBALS['celepar_tpl']->set_block('navbar','extra_blocks_footer','extra_blocks_footer');
+	$GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_header','sidebox_hide_header');
+	$GLOBALS['celepar_tpl']->set_block('navbar','sidebox_hide_footer','sidebox_hide_footer');
+	$GLOBALS['celepar_tpl']->set_block('navbar','appbox','appbox');
+	$GLOBALS['celepar_tpl']->set_block('navbar','navbar_footer','navbar_footer');
+
+	$GLOBALS['celepar_tpl']->set_var('my_preferences', lang("My Preferences"));
+	$GLOBALS['celepar_tpl']->set_var('title_my_preferences', lang("Click here to change your Expresso password and other preferences"));
+	$GLOBALS['celepar_tpl']->set_var('title_suggestions', lang("Send your critics, doubts or suggestions"));
+	$GLOBALS['celepar_tpl']->set_var('suggestions', lang("Suggestions"));
+	$GLOBALS['celepar_tpl']->set_var('help', lang("Help"));
+	$GLOBALS['celepar_tpl']->set_var('title_help', lang("Click here for help"));
+	$GLOBALS['celepar_tpl']->set_var('template',$GLOBALS['phpgw_info']['server']['template_set']);
+
+	$var['img_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images';
+	$var['dir_root'] = $GLOBALS['phpgw_info']['server']['webserver_url'];
+	$var['table_bg_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg'];
+
+	if($GLOBALS['phpgw_info']['user']['preferences']['common']['click_or_onmouseover']=='onmouseover')
+	{
+		$show_menu_event = 'onMouseOver';
+	}
+	else
+	{
+		$show_menu_event = 'onClick';
+	}
+
+
+	$applications = '';
+
+	//	== 'icons_and_text')
+
+	$max_icons=$GLOBALS['phpgw_info']['user']['preferences']['common']['max_icons'];
+
+	if(!$max_icons)
+	{
+		$max_icons=200;
+	}
+
+	$i = 0;
+	foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
+	{
+		$current_app = False;
+		if($app != 'preferences' && $app != 'about' && $app != 'logout')
 		{
-			$show_menu_event = 'onMouseOver';
+			$icon = '<a href="'.$app_data['url'].'" cacheit="'
+				. ( ( $app == 'admin' || $app == 'expressoAdmin1_2' || $app == 'expressoMail1_2' || $app == 'contactcenter' || $app == 'jabberit_messenger' || $app == 'filemanager'  ) ? 'true' : 'false')
+				. '">';
+			$title = $GLOBALS['phpgw_info']['apps'][$app]['title'];
+			if($app == 'home') $title = lang('Home');
+
+			if ($GLOBALS['phpgw_info']['flags']['currentapp'] == $app)
+			{
+				$current_app = True;
+				echo '<script>var curr_app = "' . str_replace('_','',$app) . 'id";</script>';
+			}
+
+			$icon .= '<img id="'.str_replace('_','',$app).'id" src="' . $app_data['icon'] . '" alt="' . $title . '" title="'. $title
+				. '" border="0" width="'.($current_app ? 35 : 24 ).'" height="'.($current_app ? 35 : 24 ).'" nowrap="nowrap"/></a>';
+
+			if($app=='home')
+			{
+				if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no')
+				{
+					continue;
+				}
+			}
+
+			// Verifica qual o formato da Barra de navegação: 
+			// Icone ou Texto, ou Icone e Texto
+
+
+			if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') {
+				$title_extra = $title;
+				$title = '';
+			}
+			else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){
+				$icon = '';
+			}
+
+			if($i< $max_icons) {
+
+				if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no')
+				{
+					$tdwidth = 100/($max_icons);
+				}
+				else
+				{
+					$tdwidth = 100/($max_icons+2);
+				}
+
+				$app_icons .= '<td nowrap'
+					. ' onmouseover="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id);}"'
+					. ' onmouseout="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_but\'; zoom_out(this.firstChild.firstChild.id);}"'
+					. ' onclick="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_butOut\'; zoom_out(curr_app);'
+					. 'document.getElementById(curr_app).parentNode.parentNode.className=\'navbar_but\';curr_app=\'' . str_replace('_','',$app) . 'id\'}"'
+					. ' class="navbar_but'.($current_app?'Out':'').'">';
+
+				if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
+				{
+					$app_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
+				}						
+				$app_icons .=  $icon;
+			}
+
+
+			$icon = '<img align="center" src="' . $app_data['icon'] . '" alt="' . $title . '" width="16" title="'. $title . '" border="0" />';
+
+			$app_extra_icons .= '<tr>';
+
+			if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']!='text')
+			{
+				$app_extra_icons .= '<td class="extraIconsRow"><a href="' . $app_data['url'] . '"';
+
+				if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
+				{
+					$app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
+				}
+
+				$app_extra_icons .= ' >' . $icon . '</a></td>';
+			}
+
+
+			$app_extra_icons .= '<td align="left" class="extraIconsRow" style=""><a href="'.$app_data['url'] . '"';
+
+			if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
+			{
+				$app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
+			}
+
+			$app_extra_icons .= '>' . $title_extra . '</a></td></tr>';
+
+			unset($icon);
+			unset($title);
+			$i++;				
 		}
-		else
-		{
-			$show_menu_event = 'onClick';
+	}
+
+	if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']!='no')	
+	{
+
+		$hint = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
+		$icon = '<img id="logout_id" width="24" height="24" src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'"  alt="'.$hint.'" title="'.$hint.'">';
+
+		if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') {
+
+			$title = '';
 		}
-
-
-		$applications = '';
-
-		//	== 'icons_and_text')
-
-		$max_icons=$GLOBALS['phpgw_info']['user']['preferences']['common']['max_icons'];
-		 
-		if(!$max_icons)
-		{
-			$max_icons=200;
-		}
-		
-		$i = 0;
-		foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
-		{
-			$current_app = False;
-				if($app != 'preferences' && $app != 'about' && $app != 'logout')
-				{
-					$icon = '<a href="'.$app_data['url'].'" cacheit="'.( ( $app == 'admin' || $app == 'expressoAdmin1_2' || $app == 'expressoMail1_2' ) ? 'true' : 'false').'">';
-					$title = $GLOBALS['phpgw_info']['apps'][$app]['title'];
-					if($app == 'home') $title = lang('Home');
-
-					if ($GLOBALS['phpgw_info']['flags']['currentapp'] == $app)
-					{
-						$current_app = True;
-						echo '<script>var curr_app = "' . str_replace('_','',$app) . 'id";</script>';
-					}
-
-					$icon .= '<img id="'.str_replace('_','',$app).'id" src="' . $app_data['icon'] . '" alt="' . $title . '" title="'. $title
-						. '" border="0" width="'.($current_app ? 35 : 24 ).'" height="'.($current_app ? 35 : 24 ).'" nowrap="nowrap"/></a>';
-
-					if($app=='home')
-					{
-						if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no')
-						{
-							continue;
-						}
-					}
-				
-					// Verifica qual o formato da Barra de navegação: 
-					// Icone ou Texto, ou Icone e Texto
-					
-
-					if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') {
-						$title_extra = $title;
-						$title = '';
-					}
-					else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){
-						$icon = '';
-					}
-
-					if($i< $max_icons) {
-
-						if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']=='no')
-						{
-							$tdwidth = 100/($max_icons);
-						}
-						else
-						{
-							$tdwidth = 100/($max_icons+2);
-						}
-						
-						$app_icons .= '<td nowrap'
-						. ' onmouseover="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id);}"'
-						. ' onmouseout="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_but\'; zoom_out(this.firstChild.firstChild.id);}"'
-						. ' onclick="if ( this.className != \'navbar_butOut\'){this.className=\'navbar_butOut\'; zoom_out(curr_app);'
-						. 'document.getElementById(curr_app).parentNode.parentNode.className=\'navbar_but\';curr_app=\'' . str_replace('_','',$app) . 'id\'}"'
-						. ' class="navbar_but'.($current_app?'Out':'').'">';
-
-						if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
-						{
-							$app_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
-						}						
-						$app_icons .=  $icon;
-					}
-					
-										
-					$icon = '<img align="center" src="' . $app_data['icon'] . '" alt="' . $title . '" width="16" title="'. $title . '" border="0" />';
-				
-					$app_extra_icons .= '<tr>';
-
-					if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']!='text')
-					{
-						$app_extra_icons .= '<td class="extraIconsRow"><a href="' . $app_data['url'] . '"';
-
-						if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
-						{
-							$app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
-						}
-
-						$app_extra_icons .= ' >' . $icon . '</a></td>';
-					}
-
-
-						$app_extra_icons .= '<td align="left" class="extraIconsRow" style=""><a href="'.$app_data['url'] . '"';
-
-						if(isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && $GLOBALS['phpgw_info']['flags']['navbar_target'])
-						{
-							$app_extra_icons .= ' target="' . $GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
-						}
-
-						$app_extra_icons .= '>' . $title_extra . '</a></td></tr>';
-
-					unset($icon);
-					unset($title);
-					$i++;				
-				}
-			}
-			
-			if($GLOBALS['phpgw_info']['user']['preferences']['common']['start_and_logout_icons']!='no')	
-			{
-			
-				$hint = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
-				$icon = '<img id="logout_id" width="24" height="24" src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'"  alt="'.$hint.'" title="'.$hint.'">';
-				
-				if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='icons') {
-					
-						$title = '';
-				}
-				else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){
-					
-						$icon = '';
-				}			
-				$app_icons .= '<td nowrap '.
-				'onmouseover="javascript:this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id)" '.
-				'onmouseout="javascript:this.className=\'navbar_but\'; zoom_out(this.firstChild.firstChild.id)" '.
-				'class="navbar_but"><a onclick="location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\'">'.$icon.'</td>';
-			}			//			window.location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\'
-			
-			$var['app_icons'] = $app_icons;
-			
-			$hint = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
-			$icon = '<img src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'"  alt="'.$hint.'" title="'.$hint.'">';
-			$title = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
-			
-			$app_extra_icons .= '<td  class="extraIconsRow">
-				<a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$icon.'</a></td>';
-
-			$app_extra_icons .= '<td class="extraIconsRow">
-				<a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$title.'</a></td>';
-
-				
-				$app_extra_icons_div = '
-				<script language="javascript">
-				new ypSlideOutMenu("menu1", "down", 5, 24, 160, 200,\'left\')
+		else if($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format']=='text'){
+
+			$icon = '';
+		}			
+		$app_icons .= '<td nowrap '.
+			'onmouseover="javascript:this.className=\'navbar_butOver\'; zoom_in(this.firstChild.firstChild.id)" '.
+			'onmouseout="javascript:this.className=\'navbar_but\'; zoom_out(this.firstChild.firstChild.id)" '.
+			'class="navbar_but"><a onclick="location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\'">'.$icon.'</td>';
+	}			//			window.location.href=\''.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'\'
+
+	$var['app_icons'] = $app_icons;
+
+	$hint = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
+	$icon = '<img src="'.$GLOBALS['phpgw_info']['navbar']['logout']['icon'].'"  alt="'.$hint.'" title="'.$hint.'">';
+	$title = $GLOBALS['phpgw_info']['navbar']['logout']['title'];
+
+	$app_extra_icons .= '<td  class="extraIconsRow">
+		<a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$icon.'</a></td>';
+
+	$app_extra_icons .= '<td class="extraIconsRow">
+		<a href="'.$GLOBALS['phpgw_info']['navbar']['logout']['url'].'">'.$title.'</a></td>';
+
+
+	$app_extra_icons_div = '
+		<script language="javascript">
+new ypSlideOutMenu("menu1", "down", 5, 24, 160, 200,\'left\')
 				</script>
 				<div id="menu1Container">
@@ -246,5 +248,5 @@
 			. lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
 			. $GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-			
+
 			if($GLOBALS['phpgw_info']['server']['use_frontend_name'])
 				$var['frontend_name'] = " - ".$GLOBALS['phpgw_info']['server']['use_frontend_name'];
@@ -257,38 +259,38 @@
 			{
 				$agreeterm_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/termo_aceite.php';
-				
+
 				if ($GLOBALS['phpgw_info']['server']['use_https'] == 2)
 					$agreeterm_url = 'https://' . $agreeterm_url;
 				else
 					$agreeterm_url = 'http://' . $agreeterm_url;
-				
+
 				echo '<script>' .
-						'if(location.href.indexOf("termo_aceite.php") == -1){' .
-							'location.href = "' . $agreeterm_url . '"' .
-						'}' .
-					 '</script>';
-			}
-			
+					'if(location.href.indexOf("termo_aceite.php") == -1){' .
+					'location.href = "' . $agreeterm_url . '"' .
+					'}' .
+					'</script>';
+			}
+
 
 			if(($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == '0') && (($GLOBALS['phpgw_info']['user']['agree_terms'] == 1) || ($GLOBALS['phpgw_info']['server']['use_agree_term']!='True')))
 			{
 				$changepasswd_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/changepassword.php?cd=1';
-				
+
 				if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)
 					$changepasswd_url = 'https://' . $changepasswd_url;
 				else
 					$changepasswd_url = 'http://' . $changepasswd_url;
-				
+
 				echo '<script>' .
-						'if(location.href.indexOf("changepassword.php") == -1){' .
-							'location.href = "' . $changepasswd_url . '"' .
-						'}' .
-					 '</script>';
-				
+					'if(location.href.indexOf("changepassword.php") == -1){' .
+					'location.href = "' . $changepasswd_url . '"' .
+					'}' .
+					'</script>';
+
 				/*
-				$api_messages = lang('You are required to change your password during your first login')
+					$api_messages = lang('You are required to change your password during your first login')
 				. '<br> Click this image on the navbar: <img src="'
 				. $GLOBALS['phpgw']->common->image('preferences','navbar.gif').'">';
-				*/
+				 */
 			}
 			/*
@@ -297,5 +299,5 @@
 				$api_messages = lang('it has been more then %1 days since you changed your password',30);
 			}
-			*/
+			 */
 			/*
 			// This is gonna change
@@ -314,6 +316,6 @@
 
 			/******************************************************\
-			* The sidebox menu's                                   *
-			\******************************************************/
+			 * The sidebox menu's                                   *
+			 \******************************************************/
 
 			$menu_title = lang('General Menu');
@@ -379,88 +381,88 @@
 			$GLOBALS['phpgw']->hooks->process('after_navbar');
 			return;
+}
+
+function display_sidebox($appname,$menu_title,$file)
+{
+	if(!$appname || ($appname==$GLOBALS['phpgw_info']['flags']['currentapp'] && $file))
+	{
+		$var['lang_title']=$menu_title;//$appname.' '.lang('Menu');
+		$GLOBALS['celepar_tpl']->set_var($var);
+		$GLOBALS['celepar_tpl']->pfp('out','extra_blocks_header');
+
+		foreach($file as $text => $url)
+		{
+			sidebox_menu_item($url,$text);
 		}
 
-		function display_sidebox($appname,$menu_title,$file)
+		$GLOBALS['celepar_tpl']->pparse('out','extra_blocks_footer');
+	}
+}
+
+function sidebox_menu_item($item_link='',$item_text='')
+{
+	if($item_text === '_NewLine_' || $item_link === '_NewLine_')
+	{
+		$GLOBALS['celepar_tpl']->pparse('out','extra_block_spacer');
+	}
+	else
+	{
+		$var['icon_or_star']='<img src="'.$GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images'.'/orange-ball.png" width="9" height="9" alt="ball"/>';
+		$var['target'] = '';
+		if(is_array($item_link))
 		{
-			if(!$appname || ($appname==$GLOBALS['phpgw_info']['flags']['currentapp'] && $file))
-			{
-				$var['lang_title']=$menu_title;//$appname.' '.lang('Menu');
-				$GLOBALS['celepar_tpl']->set_var($var);
-				$GLOBALS['celepar_tpl']->pfp('out','extra_blocks_header');
-
-				foreach($file as $text => $url)
-				{
-					sidebox_menu_item($url,$text);
-				}
-
-				$GLOBALS['celepar_tpl']->pparse('out','extra_blocks_footer');
+			if(isset($item_link['icon']))
+			{
+				$app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['phpgw_info']['flags']['currentapp'];
+				$var['icon_or_star'] = '<img src="'.$GLOBALS['phpgw']->common->image($app,$item_link['icon']).'"/>';
+			}
+			$var['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']);
+			$var['item_link'] = $item_link['link'];
+			if ($item_link['target'])
+			{
+				$var['target'] = ' target="' . $item_link['target'] . '"';
 			}
 		}
-
-		function sidebox_menu_item($item_link='',$item_text='')
+		else
 		{
-			if($item_text === '_NewLine_' || $item_link === '_NewLine_')
-			{
-				$GLOBALS['celepar_tpl']->pparse('out','extra_block_spacer');
-			}
-			else
-			{
-				$var['icon_or_star']='<img src="'.$GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images'.'/orange-ball.png" width="9" height="9" alt="ball"/>';
-				$var['target'] = '';
-				if(is_array($item_link))
-				{
-					if(isset($item_link['icon']))
-					{
-						$app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['phpgw_info']['flags']['currentapp'];
-						$var['icon_or_star'] = '<img src="'.$GLOBALS['phpgw']->common->image($app,$item_link['icon']).'"/>';
-					}
-					$var['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']);
-					$var['item_link'] = $item_link['link'];
-					if ($item_link['target'])
-					{
-						$var['target'] = ' target="' . $item_link['target'] . '"';
-					}
-				}
-				else
-				{
-					$var['lang_item'] = lang($item_text);
-					$var['item_link'] = $item_link;
-				}
-				$GLOBALS['celepar_tpl']->set_var($var);
-				$GLOBALS['celepar_tpl']->pparse('out','extra_block_row');
-			}
+			$var['lang_item'] = lang($item_text);
+			$var['item_link'] = $item_link;
 		}
-
-		function parse_navbar_end()
-		{
-			$GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-
-			$GLOBALS['celepar_tpl']->set_file(
-				array(
-					'footer' => 'footer.tpl'
-				)
-			);
-			
-			$var = Array(
-				'img_root'       => $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images',
-				'table_bg_color' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
-				'version'        => $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']
-			);
-			$GLOBALS['phpgw']->hooks->process('navbar_end');
-			
-
-			if($GLOBALS['phpgw_info']['user']['preferences']['common']['show_generation_time'])
-			{
-				$mtime = microtime(); 
-				$mtime = explode(' ',$mtime); 
-				$mtime = $mtime[1] + $mtime[0]; 
-				$tend = $mtime; 
-				$totaltime = ($tend - $GLOBALS['page_start_time']); 
-
-				$var['page_generation_time'] = '<div id="divGenTime"><br/><span>'.lang('Page was generated in %1 seconds',$totaltime).'</span></div>';
-			}
-
-			$var['powered_by'] = lang('Powered by phpGroupWare version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
-			$GLOBALS['celepar_tpl']->set_var($var);
-			$GLOBALS['celepar_tpl']->pfp('out','footer');
-		}
+		$GLOBALS['celepar_tpl']->set_var($var);
+		$GLOBALS['celepar_tpl']->pparse('out','extra_block_row');
+	}
+}
+
+function parse_navbar_end()
+{
+	$GLOBALS['celepar_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
+
+	$GLOBALS['celepar_tpl']->set_file(
+		array(
+			'footer' => 'footer.tpl'
+		)
+	);
+
+	$var = Array(
+		'img_root'       => $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/images',
+		'table_bg_color' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
+		'version'        => $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']
+	);
+	$GLOBALS['phpgw']->hooks->process('navbar_end');
+
+
+	if($GLOBALS['phpgw_info']['user']['preferences']['common']['show_generation_time'])
+	{
+		$mtime = microtime(); 
+		$mtime = explode(' ',$mtime); 
+		$mtime = $mtime[1] + $mtime[0]; 
+		$tend = $mtime; 
+		$totaltime = ($tend - $GLOBALS['page_start_time']); 
+
+		$var['page_generation_time'] = '<div id="divGenTime"><br/><span>'.lang('Page was generated in %1 seconds',$totaltime).'</span></div>';
+	}
+
+	$var['powered_by'] = lang('Powered by phpGroupWare version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
+	$GLOBALS['celepar_tpl']->set_var($var);
+	$GLOBALS['celepar_tpl']->pfp('out','footer');
+}
Index: trunk/phpgwapi/templates/default/navbar.tpl
===================================================================
--- trunk/phpgwapi/templates/default/navbar.tpl	(revision 2495)
+++ trunk/phpgwapi/templates/default/navbar.tpl	(revision 2529)
@@ -99,5 +99,5 @@
   <td width="30%" id="admin_info" nowrap>{current_users}</td>
   <td style="padding-right:10px" width="*" align="right" valign="center" nowrap="true">
-  		<a href="{dir_root}/preferences/" title="{title_my_preferences}" alt="{title_my_preferences}" onmouseover="javascript:self.status='{title_my_preferences}'" onmouseout="javascript:self.status=''"><img height="15px" src="{dir_root}/phpgwapi/templates/{template}/images/preferences.png"><font id="links_bar">{my_preferences}</font></a>
+  		<a href="{dir_root}/preferences/" title="{title_my_preferences}" alt="{title_my_preferences}" cacheit="true" onmouseover="javascript:self.status='{title_my_preferences}'" onmouseout="javascript:self.status=''"><img height="15px" src="{dir_root}/phpgwapi/templates/{template}/images/preferences.png"><font id="links_bar">{my_preferences}</font></a>
   		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
   		<a href="#" title="{title_suggestions}" alt="{title_suggestions}" onmouseover="javascript:self.status='{title_suggestions}'" onmouseout="javascript:self.status=''" onclick="javascript:openWindow(400,550,'{dir_root}/help/enviasugestao.php')"><img src="{dir_root}/phpgwapi/templates/{template}/images/critic.png"><font id="links_bar">{suggestions}</font></a>
