Browse Source

Continuation of fixing the alternating row colors in addressbook:
this code is present at 3 different places...

Thijs Kinkhorst 21 years ago
parent
commit
5c651578ab
2 changed files with 10 additions and 4 deletions
  1. 5 2
      src/addrbook_search.php
  2. 5 2
      src/addrbook_search_html.php

+ 5 - 2
src/addrbook_search.php

@@ -136,9 +136,12 @@ function display_result($res, $includesource = true) {
     echo "</tr>\n";
     
     while (list($undef, $row) = each($res)) {
-        $tr_bgcolor = '';
         $email = htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES);
-        if ($line % 2) { $tr_bgcolor = $color[0]; }
+        if ($line % 2) { 
+            $tr_bgcolor = $color[12];
+        } else {
+            $tr_bgcolor = $color[4];
+        }
         echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
         html_tag( 'td',
              '<small><a href="javascript:to_address(' . 

+ 5 - 2
src/addrbook_search_html.php

@@ -111,9 +111,12 @@ if ($javascript_on) {
     echo "</tr>\n";
 
     foreach ($res as $row) {
-        $tr_bgcolor = '';
         $email = AddressBook::full_address($row);
-        if ($line % 2) { $tr_bgcolor = $color[0]; }
+        if ($line % 2) { 
+            $tr_bgcolor = $color[12];
+        } else {
+            $tr_bgcolor = $color[4];
+        }
         if ($squirrelmail_language == 'ja_JP')
             {
         echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .