Index: /trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.common.inc.php	(revision 2269)
+++ /trunk/phpgwapi/inc/class.common.inc.php	(revision 2273)
@@ -1255,5 +1255,5 @@
 		* @author Dave Hall (*based* on verdilak? css inclusion code)
 		*/
-		function get_css()
+		function get_css( )
 		{
 			$tpl = createObject('phpgwapi.Template', $this->get_tpl_dir('phpgwapi'));
@@ -1279,5 +1279,5 @@
 			if ( @ isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ] ) )
 			{
-				$css = "/{$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]}/templates/%s/%s.css";
+				$css = "/%s/templates/%s/%s.css";
 
 				global $path, $link, $template;
@@ -1292,18 +1292,22 @@
 				$template = $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ];
 
-				function _css( $css )
+				function _css( $module, $css )
 				{
 					global $link, $path, $template;
-					if ( file_exists( sprintf( $path, $template, str_replace( '/', SEP, $css ) ) ) )
-						return sprintf( $link, $template, $css );
-
-					if ( file_exists( sprintf( $path, 'default', str_replace( '/', SEP, $css ) ) ) )
-						return sprintf( $link, 'default', $css );
+
+					error_log( sprintf( $path, $module, $template, str_replace( '/', SEP, $css ) ) . "\n", 3, '/tmp/log' );
+
+					if ( file_exists( sprintf( $path, $module, $template, str_replace( '/', SEP, $css ) ) ) )
+						return sprintf( $link, $module, $template, $css );
+
+					if ( file_exists( sprintf( $path, $module, 'default', str_replace( '/', SEP, $css ) ) ) )
+						return sprintf( $link, $module, 'default', $css );
 
 					return '';
 				}
 
-				$css = _css( 'app' );
-				$css .= _css( "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" );
+				$css = _css( 'phpgwapi', "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" );
+				$css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], 'app' );
+				$css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" );
 
 				if ( $css )
Index: /trunk/phpgwapi/templates/classic/head.tpl
===================================================================
--- /trunk/phpgwapi/templates/classic/head.tpl	(revision 1151)
+++ /trunk/phpgwapi/templates/classic/head.tpl	(revision 2273)
@@ -13,5 +13,4 @@
 		<link rel="icon" href="{img_icon}" type="image/x-ico" />
 		<link rel="shortcut icon" href="{img_shortcut}" />
-		<link href="{theme_css}" title="eGroupWareStyle" type="text/css" rel="StyleSheet"/>
 		<META http-equiv="Default-Style" content="eGroupWareStyle">
 		{slider_effects}
Index: /trunk/phpgwapi/templates/default/head.inc.php
===================================================================
--- /trunk/phpgwapi/templates/default/head.inc.php	(revision 890)
+++ /trunk/phpgwapi/templates/default/head.inc.php	(revision 2273)
@@ -33,9 +33,4 @@
 
 	#_debug_array($GLOBALS['phpgw_info']['user']['preferences']['common']);
-	$theme_css = ".".$GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css';
-	if(!file_exists($theme_css))
-	{
-		$theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css';
-	}
 
 	//pngfix defaults to yes
@@ -94,5 +89,4 @@
 		'website_title' => $GLOBALS['phpgw_info']['server']['site_title'].$app,
 		'body_tags'     => $bodyheader .' '. $GLOBALS['phpgw']->common->get_body_attribs(),
-		'theme_css'     => $theme_css,
 		'css'           => $GLOBALS['phpgw']->common->get_css(),
 		'java_script'   => $GLOBALS['phpgw']->common->get_java_script(),
Index: /trunk/phpgwapi/templates/default/head.tpl
===================================================================
--- /trunk/phpgwapi/templates/default/head.tpl	(revision 1247)
+++ /trunk/phpgwapi/templates/default/head.tpl	(revision 2273)
@@ -13,5 +13,4 @@
 		<link rel="icon" href="{img_icon}" type="image/x-ico" />
 		<link rel="shortcut icon" href="{img_shortcut}" />
-		<link href="{theme_css}" title="eGroupWareStyle" type="text/css" rel="StyleSheet"/>
 		<META http-equiv="Default-Style" content="eGroupWareStyle">
 		{slider_effects}
