From a147a9a4a84e6e23de55c2ebcc4e050c92880585 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 30 May 2011 11:08:37 +0000 Subject: [PATCH] fixed not working category color of rows (calendar, addressbook) --- etemplate/inc/class.etemplate.inc.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index 1a05f6f141..729d195eb1 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -729,7 +729,7 @@ class etemplate extends boetemplate if (($color = $data['color'])) { - //echo "

cats2color($cats)=$color

\n"; + //echo "

cats2color('$cats')=$color

\n"; return $cat2color[$cats] = $cat2color[$cat] = $color; } } @@ -821,14 +821,13 @@ class etemplate extends boetemplate if ($cl == '@' || $cl && strpos($cl,'$') !== false) { $cl = $this->expand_name($cl,0,$r,$content['.c'],$content['.row'],$content); - - if (!$cl || preg_match('/^[0-9,]*$/',$cl)) + if (!$cl || preg_match('/(^| )([0-9,]+)( |$)/',$cl,$matches)) { - if (($color = $this->cats2color($cl))) + if (($color = $this->cats2color($matches[2]))) { $rows[".$row"] .= ' style="background-color: '.$color.';"'; } - $cl = 'row'; + $cl = str_replace($matches[2],'row',$cl); } } if ($cl == 'nmr' || substr($cl,0,3) == 'row') // allow to have further classes behind row