/**
* left_main.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This is the code for the left bar. The left bar shows the folders
$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);
$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. */
$line .= " <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" .
" (<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .