added parameter to alternate_row_color to return class-name instead of a color-value

This commit is contained in:
Ralf Becker 2003-11-02 17:20:47 +00:00
parent f1cf865b12
commit 6ad53d62ee

View File

@ -678,8 +678,9 @@
@function alternate_row_color
@abstract alternate row colour
@param $currentcolor default ''
@param $do_class boolean default False return the color-value or just the class-name
*/
function alternate_row_color($currentcolor = '')
function alternate_row_color($currentcolor = '',$do_class=False)
{
if (! $currentcolor)
{
@ -688,14 +689,14 @@
if ($currentcolor == $GLOBALS['phpgw_info']['theme']['row_on'])
{
$GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme']['row_off'];
$GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme'][$class='row_off'];
}
else
{
$GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme']['row_on'];
$GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme'][$class='row_on'];
}
return $GLOBALS['tr_color'];
return $do_class ? $class : $GLOBALS['tr_color'];
}
// If you are using the common bgcolor="{tr_color}"