Always show Purge link next to Trash, so one doesn't have to reload left_main
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Feb 2005 20:05:04 +0000 (20:05 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Feb 2005 20:05:04 +0000 (20:05 +0000)
to be able to empty the trash.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8890 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
src/left_main.php

index 2127841d16d3a2ce0f35d8e421ea85bffe8709be..dddc19608d70fd1d01731df9b04b01270fc46cd6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -235,6 +235,7 @@ Version 1.5.1 -- CVS
     additional values (cc, body, subject etc).
   - Fixed bug #801060.  Removed option for INBOX in filters plugin as source
     is always INBOX.
+  - Always show Purge link next to Trash, even when empty.
 
 Version 1.5.0
 --------------------
index 99121dee1aa027d4d51ca8d67c6e047655798250..d2211729261ae7c644659305412dcaad0b4ec0b7 100644 (file)
@@ -90,18 +90,12 @@ function formatMailboxName($imapConnection, $box_array) {
         $line .= "&nbsp;<small>$unseen_string</small>";
     }
 
-    /* If it's the trash folder, show a purge link when needed */
+    /* If it's the trash folder, show a purge link */
     if (($move_to_trash) && ($real_box == $trash_folder)) {
-        if (! isset($numMessages)) {
-            $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
-        }
-
-        if (($numMessages > 0) or ($box_array['parent'] == 1)) {
-            $urlMailbox = urlencode($real_box);
-            $line .= "\n<small>\n" .
-                    '&nbsp;&nbsp;[<a href="empty_trash.php">'._("Purge").'</a>]' .
-                    '</small>';
-        }
+        $urlMailbox = urlencode($real_box);
+        $line .= "\n<small>\n" .
+            '&nbsp;&nbsp;[<a href="empty_trash.php">'._("Purge").'</a>]' .
+            '</small>';
     }
 
 
@@ -394,10 +388,10 @@ function ListBoxes ($boxes, $j=0 ) {
             if ($unseen_found) {
                 $end .= "&nbsp;<small>$unseen_string</small>";
             }
-            $end .= "\n<small>\n" .
-                    '&nbsp;&nbsp;[<a href="empty_trash.php">'._("Purge").'</a>]'.
-                    '</small>';
         }
+        $end .= "\n<small>\n" .
+                '&nbsp;&nbsp;[<a href="empty_trash.php">'._("Purge").'</a>]'.
+                '</small>';
     } else {
         if (!$boxes->is_noselect) {
             if ($unseen > 0) {
@@ -513,16 +507,11 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
     }
 
     if (($move_to_trash) && ($mailbox == $trash_folder)) {
-        if (! isset($numMessages)) {
-            $numMessages = $boxes->total;
-        }
         $pre = "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">" . $pre;
         $end .= '</a>';
-        if ($numMessages > 0) {
-            $end .= "\n<small>\n" .
-                    '&nbsp;&nbsp;[<a class="mbx_link" href="empty_trash.php">'._("Purge").'</a>]'.
-                    '</small>';
-        }
+        $end .= "\n<small>\n" .
+                '&nbsp;&nbsp;[<a class="mbx_link" href="empty_trash.php">'._("Purge").'</a>]'.
+                '</small>';
     } else {
         if (!$boxes->is_noselect) { /* \Noselect boxes can't be selected */
             $pre = "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">" . $pre;