Small html fix
[squirrelmail.git] / src / left_main.php
index f9d3939b322c9bdcea1ade2d1c3028d4a032fb77..b65d839332e077dcb4c2dec64d240b12ffb592d7 100644 (file)
@@ -35,7 +35,6 @@ function formatMailboxName($imapConnection, $box_array) {
            $unseen_notify, $unseen_type, $collapse_folders,
            $draft_folder, $save_as_draft,
            $use_special_folder_color;
-
     $real_box = $box_array['unformatted'];
     $mailbox = str_replace(' ','',$box_array['formatted']);
     $mailboxURL = urlencode($real_box);
@@ -45,18 +44,15 @@ function formatMailboxName($imapConnection, $box_array) {
         $mailbox = $regs[2];
     }
     $unseen = 0;
-    $status = array();
+    $status = array('','');
     if (($unseen_notify == 2 && $real_box == 'INBOX') ||
         $unseen_notify == 3) {
-       $status = create_unseen_string($real_box, $box_array, $imapConnection, $unseen_type );
+       $tmp_status = create_unseen_string($real_box, $box_array, $imapConnection, $unseen_type );
        if ($status !== false) {
-           list($unseen_string, $unseen) = $status;
-       } else {
-           list($unseen_string, $unseen) = array(_("Not available"),'');
-       }
-    } else {
-       list($unseen_string, $unseen) = array('','');
+           $status = $tmp_status;
+       } 
     }
+    list($unseen_string, $unseen) = $status;
     $special_color = ($use_special_folder_color && isSpecialMailbox($real_box));
 
     /* Start off with a blank line. */
@@ -92,12 +88,13 @@ function formatMailboxName($imapConnection, $box_array) {
         $line .= "&nbsp;<SMALL>$unseen_string</SMALL>";
     }
 
+       /* If it's the trash folder, show a purge link when needed */
     if (($move_to_trash) && ($real_box == $trash_folder)) {
         if (! isset($numMessages)) {
             $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
         }
 
-        if ($numMessages > 0) {
+        if (($numMessages > 0) or ($box_array['parent'] == 1)) {
             $urlMailbox = urlencode($real_box);
             $line .= "\n<small>\n" .
                     "&nbsp;&nbsp;(<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
@@ -290,7 +287,7 @@ function listBoxes ($boxes, $j=0 ) {
        $mailbox = $boxes->mailboxname_full;
        $leader = '';
        for ($k = 0; $k < $j; $k++) {
-           $leader.= '&nbsp&nbsp&nbsp';
+           $leader.= '&nbsp;&nbsp;&nbsp;';
        }
        $mailboxURL = urlencode($mailbox);
 
@@ -313,14 +310,14 @@ function listBoxes ($boxes, $j=0 ) {
 
            $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
            if ($collapse) {
-               $link .= "unfold=$mailboxURL\">$leader +&nbsp";
+               $link .= "unfold=$mailboxURL\">$leader +&nbsp;";
            } else {
-               $link .= "fold=$mailboxURL\">$leader -&nbsp";
+               $link .= "fold=$mailboxURL\">$leader -&nbsp;";
            }
            $link .= '</a>';
            $pre .= $link;
        } else {
-           $pre.= $leader . '&nbsp&nbsp&nbsp';
+           $pre.= $leader . '&nbsp;&nbsp;&nbsp;';
        }