bug 1138: simplify logic for email address output styling
authorMichael Tänzer <neo@nhng.de>
Fri, 11 Apr 2014 21:00:01 +0000 (23:00 +0200)
committerMichael Tänzer <neo@nhng.de>
Fri, 11 Apr 2014 21:00:01 +0000 (23:00 +0200)
Signed-off-by: Michael Tänzer <neo@nhng.de>
includes/notary.inc.php

index aebc0b3..228ab68 100644 (file)
@@ -1475,19 +1475,17 @@ function output_log_email_header(){
  * @param string $primary - if given the primary address is highlighted
  */
 function output_log_email($row, $primary){
-       $primaryemailaddress='';
-       $deletedemailaddress='';
+       $style = '';
        if ($row['deleted'] !== NULL_DATETIME) {
-               $deletedemailaddress=' deletedemailaddress';
-       }
-       if ($primary==$row['email'] && $row['deleted'] === NULL_DATETIME) {
-               $primaryemailaddress= ' primaryemailaddress';
+               $style = ' deletedemailaddress';
+       } elseif ($primary == $row['email']) {
+               $style = ' primaryemailaddress';
        }
        ?>
        <tr>
-               <td class="DataTD<?= $primaryemailaddress . $deletedemailaddress ?>"><?=$row['email']?></td>
-               <td class="DataTD<?= $primaryemailaddress . $deletedemailaddress ?>"><?=$row['created']?></td>
-               <td class="DataTD<?= $primaryemailaddress . $deletedemailaddress ?>"><?=$row['deleted']?></td>
+               <td class="DataTD<?=$style?>"><?=$row['email']?></td>
+               <td class="DataTD<?=$style?>"><?=$row['created']?></td>
+               <td class="DataTD<?=$style?>"><?=$row['deleted']?></td>
        </tr>
        <?
 }