2001-03-31 04:24:36 +02:00
|
|
|
<?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. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2001-05-03 23:23:04 +02:00
|
|
|
// needed until hovlink is specified in all theme files
|
2001-08-28 05:39:34 +02:00
|
|
|
if (isset($GLOBALS['phpgw_info']['theme']['hovlink'])
|
|
|
|
&& ($GLOBALS['phpgw_info']['theme']['hovlink'] != ''))
|
2001-05-03 23:23:04 +02:00
|
|
|
{
|
2001-08-28 05:39:34 +02:00
|
|
|
$csshover = 'A:hover{ text-decoration:none; color: ' .$GLOBALS['phpgw_info']['theme']['hovlink'] .'; }';
|
2001-05-03 23:23:04 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-05-17 23:18:01 +02:00
|
|
|
$csshover = '';
|
2001-08-28 05:39:34 +02:00
|
|
|
}
|
|
|
|
|
2001-09-17 04:18:32 +02:00
|
|
|
$app_css = '';
|
2001-09-18 05:56:01 +02:00
|
|
|
if(@isset($GLOBALS['HTTP_GET_VARS']['menuaction']))
|
2001-08-28 05:39:34 +02:00
|
|
|
{
|
2001-09-17 04:18:32 +02:00
|
|
|
list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
|
|
|
|
if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['css'])
|
|
|
|
{
|
|
|
|
$app_css = $GLOBALS[$class]->css();
|
|
|
|
}
|
2001-08-28 05:39:34 +02:00
|
|
|
}
|
2001-05-03 23:23:04 +02:00
|
|
|
|
2001-08-28 05:39:34 +02:00
|
|
|
$bodyheader = 'bgcolor="'.$GLOBALS['phpgw_info']['theme']['bg_color'].'" alink="'.$GLOBALS['phpgw_info']['theme']['alink'].'" link="'.$GLOBALS['phpgw_info']['theme']['link'].'" vlink="'.$GLOBALS['phpgw_info']['theme']['vlink'].'"';
|
|
|
|
if (!$GLOBALS['phpgw_info']['server']['htmlcompliant'])
|
2001-04-28 23:48:05 +02:00
|
|
|
{
|
|
|
|
$bodyheader .= ' topmargin="0" marginheight="0" marginwidth="0" leftmargin="0"';
|
|
|
|
}
|
2001-11-28 01:18:53 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
@capability: page autorefresh
|
|
|
|
@discussion: I know of 3 ways to get a page to reload, 2 of those ways are pretty much the same
|
|
|
|
(1) the http header
|
|
|
|
Refresh: 5;
|
|
|
|
(2) the META http-equiv
|
|
|
|
<META HTTP-EQUIV="Refresh" CONTENT="5">
|
|
|
|
both 1 and 2 have the same effect as hitting the "reload" button, which in *many* browsers will
|
|
|
|
force a re-download of all the images on the page, i.e. the browser will NOT use the cached images
|
|
|
|
(3) java script combo of "window.setTimeout" with "window.location"
|
|
|
|
window.setTimeout('window.location="http://example.com/phpgw/email/index.php"; ',1800000);
|
|
|
|
method 3 is the only one I know of that will use the images from the cache.
|
|
|
|
also, 3 takes a reload value in miliseconds, so a value of 180000 is really 3 minutes
|
|
|
|
ALSO, use if..then code to only auto-refresh certain pages, such as email/index.php
|
|
|
|
*/
|
|
|
|
//$auto_refresh_enabled = True;
|
|
|
|
$auto_refresh_enabled = False;
|
|
|
|
// initialize reload location to empty string
|
|
|
|
$reload_me = '';
|
|
|
|
if ($auto_refresh_enabled)
|
|
|
|
{
|
|
|
|
if (eregi("^.*email\/index\.php.*$",$GLOBALS['PHP_SELF']))
|
|
|
|
{
|
|
|
|
$reload_me = $GLOBALS['phpgw']->link('/email/index.php');
|
|
|
|
}
|
|
|
|
elseif (eregi("^.*\/home\.php.*$",$GLOBALS['PHP_SELF']))
|
|
|
|
{
|
|
|
|
$reload_me = $GLOBALS['phpgw']->link('/home.php');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// make the JS command string if necessary
|
|
|
|
if (($auto_refresh_enabled)
|
|
|
|
&& ($reload_me != ''))
|
|
|
|
{
|
|
|
|
// set refresh time in miliseconds (1000 = 1 sec) (180000 = 180 sec = 3 minutes)
|
|
|
|
// ( 240000 = 240 sec = 4 min) (300000 = 5 min) (600000 = 10 min)
|
|
|
|
$refresh_ms = '300000';
|
|
|
|
$email_reload_js =
|
|
|
|
'window.setTimeout('."'".'window.location="'
|
|
|
|
.$reload_me.'"; '."'".','.$refresh_ms.');';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$email_reload_js = '';
|
|
|
|
}
|
2001-03-31 04:24:36 +02:00
|
|
|
|
2001-04-28 23:48:05 +02:00
|
|
|
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
|
|
|
|
$tpl->set_unknowns('remove');
|
|
|
|
$tpl->set_file(array('head' => 'head.tpl'));
|
2001-08-28 05:39:34 +02:00
|
|
|
$var = Array (
|
|
|
|
'charset' => lang('charset'),
|
|
|
|
'font_family' => $GLOBALS['phpgw_info']['theme']['font'],
|
|
|
|
'website_title' => $GLOBALS['phpgw_info']['server']['site_title'],
|
|
|
|
'body_tags' => $bodyheader,
|
|
|
|
'css_link' => $GLOBALS['phpgw_info']['theme']['link'],
|
|
|
|
'css_alink' => $GLOBALS['phpgw_info']['theme']['alink'],
|
|
|
|
'css_vlink' => $GLOBALS['phpgw_info']['theme']['vlink'],
|
|
|
|
'css_hovlink' => $csshover,
|
2001-11-28 01:18:53 +01:00
|
|
|
'email_reload_js' => $email_reload_js,
|
2001-08-28 05:39:34 +02:00
|
|
|
'app_css' => $app_css
|
|
|
|
);
|
|
|
|
$tpl->set_var($var);
|
2001-04-28 23:48:05 +02:00
|
|
|
$tpl->pfp('out','head');
|
|
|
|
unset($tpl);
|
|
|
|
?>
|