<?php
/**
 * probusiness template set
 * @author Philipp Kamps <pkamps@probusiness.de>, Daniel Briegert <dbriegert@probusiness.de>
 * @copyright Copyright (C) 2003 Free Software Foundation http://www.fsf.org/
 * @license http://www.fsf.org/licenses/gpl.html GNU General Public License
 * @package template
 * @subpackage probusiness
 * @version $Id: head.inc.php,v 1.1.2.6 2005/12/06 14:21:40 skwashd Exp $
 */
	
	$app_css = $java_script = '';

	/*
	 * css file handling
	 */
	$css_file = PHPGW_SERVER_ROOT . '/phpgwapi/templates/probusiness/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css';
	if (file_exists($css_file))
	{
		$css_ref = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/probusiness/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css';
	}
	else
	{
		$css_ref = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/probusiness/css/styles.css';
	}

	$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
	$tpl->set_unknowns('remove');

	$tpl->set_file(array('head' => 'head.tpl'));
	$tpl->set_block('head', 'folders_enabled', 'folders_ok');

	if( isset($GLOBALS['phpgw_info']['user']['apps']['folders']) )
	{
		$tpl->parse('folders_ok', 'folders_enabled');
	}
	else
	{
		$tpl->set_var('folders_ok', '');
	}

	$app = $GLOBALS['phpgw_info']['flags']['currentapp'];
	$app = $app ? ' ['.(isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app)).']':'';

	$var = Array (
				'img_icon'      => PHPGW_IMAGES_DIR . '/favicon.ico',
				'img_shortcut'  => PHPGW_IMAGES_DIR . '/favicon.ico',
				'charset'       => lang('charset'),
				'font_family'   => $GLOBALS['phpgw_info']['theme']['font'],
				'website_title' => $GLOBALS['phpgw_info']['server']['site_title'] . $app,
				'theme_css'     => $css_ref,
				'css'           => $GLOBALS['phpgw']->common->get_css(),
				'java_script'   => $GLOBALS['phpgw']->common->get_java_script(),
				'api_root'      => $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/probusiness/',
				'phpgw_root'		=> $GLOBALS['phpgw_info']['server']['webserver_url'] . '/'
				);

	$tpl->set_var($var);
	$tpl->pfp('out','head');
	unset($tpl);
?>
