This will now allow apps to include CSS values into the <HEAD></HEAD> portion of the HTML page by having a function in their ui class called css().

This commit is contained in:
skeeter 2001-08-28 03:39:34 +00:00
parent b482e375d0
commit 863a80298d
9 changed files with 106 additions and 50 deletions

View File

@ -11,18 +11,32 @@
/* $Id$ */
$bodyheader = 'BGCOLOR="'.$phpgw_info['theme']['bg_color'].'"';
if ($phpgw_info['server']['htmlcompliant']) {
$bodyheader .= ' ALINK="'.$phpgw_info['theme']['alink'].'" LINK="'.$phpgw_info['theme']['link'].'" VLINK="'.$phpgw_info['theme']['vlink'].'"';
if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css'])
{
eval("\$app_css = \$GLOBALS['obj']->css();");
}
else
{
$app_css = '';
}
$bodyheader = 'BGCOLOR="'.$GLOBALS['phpgw_info']['theme']['bg_color'].'"';
if ($GLOBALS['phpgw_info']['server']['htmlcompliant']) {
$bodyheader .= ' ALINK="'.$GLOBALS['phpgw_info']['theme']['alink'].'" LINK="'.$GLOBALS['phpgw_info']['theme']['link'].'" VLINK="'.$GLOBALS['phpgw_info']['theme']['vlink'].'"';
}
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
$tpl->set_file(array('head' => 'head.tpl'));
$tpl->set_var('font_family',$phpgw_info['theme']['font']);
$tpl->set_var('charset',lang('charset'));
$tpl->set_var('website_title',$phpgw_info['server']['site_title']);
$tpl->set_var('body_tags',$bodyheader);
echo $tpl->finish($tpl->parse('out','head'));
$var = Array (
'charset' => lang('charset'),
'font_family' => $GLOBALS['phpgw_info']['theme']['font'],
'website_title' => $GLOBALS['phpgw_info']['server']['site_title'],
'body_tags' => $bodyheader,
'app_css' => $app_css
);
$tpl->set_var($var);
$tpl->pfp('out','head');
unset($tpl);
?>

View File

@ -14,6 +14,7 @@
A:active{ text-decoration:none }
body { margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: {font_family} }
.tablink { color: #000000; }
{app_css}
-->
</STYLE>
<TITLE>{website_title}</TITLE>

View File

@ -12,18 +12,27 @@
/* $Id$ */
// needed until hovlink is specified in all theme files
if (isset($phpgw_info['theme']['hovlink'])
&& ($phpgw_info['theme']['hovlink'] != ''))
if (isset($GLOBALS['phpgw_info']['theme']['hovlink'])
&& ($GLOBALS['phpgw_info']['theme']['hovlink'] != ''))
{
$csshover = 'A:hover{ text-decoration:none; color: ' .$phpgw_info['theme']['hovlink'] .'; }';
$csshover = 'A:hover{ text-decoration:none; color: ' .$GLOBALS['phpgw_info']['theme']['hovlink'] .'; }';
}
else
{
$csshover = '';
};
}
$bodyheader = 'bgcolor="'.$phpgw_info['theme']['bg_color'].'" alink="'.$phpgw_info['theme']['alink'].'" link="'.$phpgw_info['theme']['link'].'" vlink="'.$phpgw_info['theme']['vlink'].'"';
if (!$phpgw_info['server']['htmlcompliant'])
if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css'])
{
eval("\$app_css = \$GLOBALS['obj']->css();");
}
else
{
$app_css = '';
}
$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'])
{
$bodyheader .= ' topmargin="0" marginheight="0" marginwidth="0" leftmargin="0"';
}
@ -31,14 +40,18 @@
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
$tpl->set_file(array('head' => 'head.tpl'));
$tpl->set_var('charset',lang('charset'));
$tpl->set_var('font_family',$phpgw_info['theme']['font']);
$tpl->set_var('website_title',$phpgw_info['server']['site_title']);
$tpl->set_var('body_tags',$bodyheader);
$tpl->set_var('css_link',$phpgw_info['theme']['link']);
$tpl->set_var('css_alink',$phpgw_info['theme']['alink']);
$tpl->set_var('css_vlink',$phpgw_info['theme']['vlink']);
$tpl->set_var('css_hovlink',$csshover);
$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,
'app_css' => $app_css
);
$tpl->set_var($var);
$tpl->pfp('out','head');
unset($tpl);
?>

View File

@ -15,6 +15,7 @@
{css_hovlink}
body { margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: "{font_family}" }
.tablink { color: #000000; }
{app_css}
-->
</STYLE>
<script language="JavaScript">

View File

@ -13,7 +13,7 @@
function parse_navbar($force = False)
{
global $phpgw_info, $phpgw, $menuaction, $obj;
global $phpgw_info, $phpgw;
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
@ -137,11 +137,11 @@
*/
$tpl->pfp('out','navbar');
// If the application has a header include, we now include it
if (!@$phpgw_info['flags']['noappheader'] && $menuaction)
if (!@$GLOBALS['phpgw_info']['flags']['noappheader'] && $GLOBALS['menuaction'])
{
if (is_array($obj->public_functions) && $obj->public_functions['header'])
if (is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['header'])
{
eval("\$obj->header();");
eval("\$GLOBALS['obj']->header();");
}
}
$phpgw->common->hook('after_navbar');

View File

@ -11,29 +11,41 @@
/* $Id$ */
$bodyheader = 'BGCOLOR="'.$phpgw_info['theme']['bg_color'].'"';
if ($phpgw_info['server']['htmlcompliant'])
if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css'])
{
$bodyheader .= ' BGCOLOR="'.$phpgw_info['theme']['bg_color'].'" ALINK="'.$phpgw_info['theme']['alink'].'" LINK="'.$phpgw_info['theme']['link'].'" VLINK="'.$phpgw_info['theme']['vlink'].'"';
eval("\$app_css = \$GLOBALS['obj']->css();");
}
else
{
$app_css = '';
}
$bodyheader = 'BGCOLOR="'.$GLOBALS['phpgw_info']['theme']['bg_color'].'"';
if ($GLOBALS['phpgw_info']['server']['htmlcompliant'])
{
$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'].'"';
}
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
$tpl->set_file(array('head' => 'head.tpl'));
$tpl->set_var('webserver_url', $phpgw_info['server']['webserver_url']);
$tpl->set_var('home',$phpgw->link('/'));
$tpl->set_var('appt',$phpgw->link('/calendar/day.php'));
$tpl->set_var('todo',$phpgw->link('/todo/add.php'));
$tpl->set_var('prefs',$phpgw->link('/preferences'));
$tpl->set_var('email',$phpgw->link('/email/preferences.php'));
$tpl->set_var('calendar',$phpgw->link('/calendar/preferences.php'));
$tpl->set_var('addressbook',$phpgw->link('/addressbook/preferences.php'));
$tpl->set_var('charset',lang('charset'));
$tpl->set_var('font_family',$phpgw_info['theme']['font']);
$tpl->set_var('website_title', $phpgw_info['server']['site_title']);
$tpl->set_var('body_tags',$bodyheader);
$var = Array (
'webserver_url' => $GLOBALS['phpgw_info']['server']['sebserver_url'],
'home' => $GLOBALS['phpgw']->link('/index.php'),
'appt' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'calendar.uicalendar.day')),
'todo' => $GLOBALS['phpgw']->link('/index.php,Array('menuaction'=>'todo/uitodo.add')),
'prefs' => $GLOBALS['phpgw']->link('/preferences/index.php'),
'email' => $GLOBALS['phpgw']->link('/email/preferences.php'),
'calendar' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'calender.uicalendar.preferences')),
'addressbook' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'addressbook.uiaddressbook.preferences')),
'charset' => lang('charset'),
'font_family' => $GLOBALS['phpgw_info']['theme']['font'],
'website_title' => $GLOBALS['phpgw_info']['server']['site_title'],
'body_tags' => $bodyheader,
'app_css' => $app_css
);
$tpl->set_var($var);
$tpl->pfp('out','head');
unset($tpl);
?>

View File

@ -14,6 +14,7 @@
A:active{ text-decoration:none }
body { margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: {font_family} }
.tablink { color: #000000; }
{app_css}
-->
</STYLE>
<TITLE>{website_title}</TITLE>

View File

@ -11,11 +11,20 @@
/* $Id$ */
$bodyheader = ' bgcolor="' . $phpgw_info['theme']['bg_color'] . '" alink="'
. $phpgw_info['theme']['alink'] . '" link="' . $phpgw_info['theme']['link'] . '" vlink="'
. $phpgw_info['theme']['vlink'] . '"';
if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css'])
{
eval("\$app_css = \$GLOBALS['obj']->css();");
}
else
{
$app_css = '';
}
if (! $phpgw_info['server']['htmlcompliant'])
$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'])
{
$bodyheader .= ' topmargin="0" bottommargin="0" marginheight="0" marginwidth="0" leftmargin="0" rightmargin="0"';
}
@ -23,10 +32,14 @@
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
$tpl->set_file(array('head' => 'head.tpl'));
$tpl->set_var('charset',lang('charset'));
$tpl->set_var('font_family',$phpgw_info['theme']['font']);
$tpl->set_var('website_title', $phpgw_info['server']['site_title']);
$tpl->set_var('body_tags',$bodyheader);
$var = Array (
'charset' => lang('charset'),
'font_family' => $GLOBALS['phpgw_info']['theme']['font'],
'website_title' => $GLOBALS['phpgw_info']['server']['site_title'],
'body_tags' => $bodyheader,
'app_css' => $app_css
);
$tpl->set_var($var);
$tpl->pfp('out','head');
unset($tpl);
?>

View File

@ -15,6 +15,7 @@
A:active{ text-decoration:none }
body { margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: {font_family} }
.tablink { color: #000000; }
{app_css}
-->
</STYLE>
<TITLE>{website_title}</TITLE>