Apparently my fix for hiding the unread count of 0 when in certain modes
[squirrelmail.git] / src / left_main.php
index 8a572a87cdba397c31709947ca9882e31eeb86c0..cdb23354fdb8bc4cf53f1c3d9d241548b1f81f6e 100644 (file)
@@ -99,6 +99,9 @@ function formatMailboxName($imapConnection, $box_array) {
             $line .= "\n<small>\n" .
                     "&nbsp;&nbsp;(<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
                     "</small>";
+        } else {
+          $line .= concat_hook_function('left_main_after_each_folder',
+                 array(isset($numMessages) ? $numMessages : '',$real_box,$imapConnection));
         }
     }
 
@@ -293,13 +296,13 @@ function listBoxes ($boxes, $j=0 ) {
     if (isset($boxes) && !empty($boxes)) {
         $mailbox = $boxes->mailboxname_full;
         $leader = '<tt>';
-        $leader .= str_repeat('&nbsp;&nbsp;&nbsp;',$j);
+        $leader .= str_repeat('&nbsp;&nbsp;',$j);
         $mailboxURL = urlencode($mailbox);
         /* get unseen/total messages information */
         if ($boxes->unseen !== false || $boxes->total !== false) {
             $unseen = $boxes->unseen;
-            $unseen_string = "($unseen)";
-            if ($unseen>0||$boxes->total>0) {
+            if ($unseen>0 || $boxes->total>0) {
+                $unseen_string = "($unseen)";
                 $unseen_found = TRUE;
             }
             $unseen_before = '<font color="' . $color[11] . '">';
@@ -359,7 +362,7 @@ function listBoxes ($boxes, $j=0 ) {
                         "</small>";
             }
         } else {
-            if (!$boxes->is_noselect) {
+            if (!$boxes->is_noselect || strtolower($boxes->mailboxname_full)=="inbox") {
                 if ($unseen > 0) {
                     $pre .= '<b>';
                 }
@@ -372,7 +375,7 @@ function listBoxes ($boxes, $j=0 ) {
         }
 
         /* Print unseen information. */
-        if (isset($unseen_found) && $unseen_found) {
+        if (isset($unseen_found) && $unseen_found && ($unseen > 0)) {
             $end .= "&nbsp;<small>$unseen_string</small>";
         }
 
@@ -415,8 +418,10 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
     /* get unseen/total messages information */
     if ($boxes->unseen !== false) {
         $unseen = $boxes->unseen;
-        $unseen_string = "($unseen)";
-        if ($unseen>0) $unseen_found = TRUE;
+        if ($unseen>0) {
+            $unseen_found = TRUE;
+            $unseen_string = "($unseen)";
+        }
         if ($boxes->total) {
             $numMessages = $boxes->total;
             $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
@@ -436,7 +441,7 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
     if ($unseen > 0) { $end .= '</b>'; }
 
     /* Print unseen information. */
-    if (isset($unseen_found) && $unseen_found) {
+    if (isset($unseen_found) && $unseen_found && ($unseen > 0)) {
             $end .= "&nbsp;$unseen_string";
     }