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$ */ /* $Id$ */
$bodyheader = 'BGCOLOR="'.$phpgw_info['theme']['bg_color'].'"'; if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css'])
if ($phpgw_info['server']['htmlcompliant']) { {
$bodyheader .= ' 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 .= ' 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 = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove'); $tpl->set_unknowns('remove');
$tpl->set_file(array('head' => 'head.tpl')); $tpl->set_file(array('head' => 'head.tpl'));
$tpl->set_var('font_family',$phpgw_info['theme']['font']);
$tpl->set_var('charset',lang('charset')); $var = Array (
$tpl->set_var('website_title',$phpgw_info['server']['site_title']); 'charset' => lang('charset'),
$tpl->set_var('body_tags',$bodyheader); 'font_family' => $GLOBALS['phpgw_info']['theme']['font'],
echo $tpl->finish($tpl->parse('out','head')); '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); unset($tpl);
?> ?>

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@
function parse_navbar($force = False) function parse_navbar($force = False)
{ {
global $phpgw_info, $phpgw, $menuaction, $obj; global $phpgw_info, $phpgw;
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR); $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove'); $tpl->set_unknowns('remove');
@ -137,11 +137,11 @@
*/ */
$tpl->pfp('out','navbar'); $tpl->pfp('out','navbar');
// If the application has a header include, we now include it // 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'); $phpgw->common->hook('after_navbar');

View File

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

View File

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

View File

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

View File

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