X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fleft_main.php;h=d2211729261ae7c644659305412dcaad0b4ec0b7;hb=40c6ff98b6619b90b4fdfb5150ecaf596a29bc32;hp=031cc486f4caeae1625647cea3dcd80dba117f3b;hpb=91e0dccca7b2452d8b450791cae3aa4125e8889e;p=squirrelmail.git diff --git a/src/left_main.php b/src/left_main.php index 031cc486..d2211729 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -3,7 +3,7 @@ /** * left_main.php * - * Copyright (c) 1999-2004 The SquirrelMail Project Team + * Copyright (c) 1999-2005 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 @@ -90,18 +90,12 @@ function formatMailboxName($imapConnection, $box_array) { $line .= " $unseen_string"; } - /* 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\n" . - '  ['._("Purge").']' . - ''; - } + $urlMailbox = urlencode($real_box); + $line .= "\n\n" . + '  ['._("Purge").']' . + ''; } @@ -378,10 +372,10 @@ function ListBoxes ($boxes, $j=0 ) { $pre .= ''; } $pre .= ""; + $end .= ''; if ($unseen > 0) { $end .= ''; } - $end .= ''; if ($boxes->total > 0) { if ($unseen > 0) { $pre .= ''; @@ -394,20 +388,20 @@ function ListBoxes ($boxes, $j=0 ) { if ($unseen_found) { $end .= " $unseen_string"; } - $end .= "\n\n" . - '  ['._("Purge").']'. - ''; } + $end .= "\n\n" . + '  ['._("Purge").']'. + ''; } else { if (!$boxes->is_noselect) { if ($unseen > 0) { $pre .= ''; } $pre .= ""; + $end .= ''; if ($unseen > 0) { $end .= ''; } - $end .= ''; } /* Print unseen information. */ if ($unseen_found) { @@ -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 = "" . $pre; $end .= ''; - if ($numMessages > 0) { - $end .= "\n\n" . - '  ['._("Purge").']'. - ''; - } + $end .= "\n\n" . + '  ['._("Purge").']'. + ''; } else { if (!$boxes->is_noselect) { /* \Noselect boxes can't be selected */ $pre = "" . $pre; @@ -658,156 +647,139 @@ if (! isset($oldway) || $oldway=="" ) { } if ($advanced_tree) { -$xtra .= << - - - - - -ECHO; +$xtra .= 'old_col = masterf.cols;'."\n". +' colPat.exec(old_col);'."\n". +' if (direction) {'."\n". +' new_col_width = parseInt(RegExp.$1) + 25;'."\n". +' } else {'."\n". +' if (parseInt(RegExp.$1) > 35) {'."\n". +' new_col_width = parseInt(RegExp.$1) - 25;'."\n". +' }'."\n". +' }'."\n". +' masterf.cols = calc_col(new_col_width);'."\n". +' }'."\n". +'//-->'."\n". +''."\n"; /* style definitions */ -$xtra .= << - - - - -ECHO; - +$xtra .= ''."\n"; } displayHtmlHeader( 'SquirrelMail', $xtra ); @@ -929,10 +879,14 @@ if ($auto_create_special && !isset($auto_create_done)) { if ( !sqimap_mailbox_exists($imapConnection, $folder)) { sqimap_mailbox_create($imapConnection, $folder, ''); } else { - //if (!sqimap_mailbox_is_subscribed($imapConnection, $folder)) { - // check for subscription is useless and expensive just - // surpress the NO response - sqimap_subscribe($imapConnection, $folder, false); + // check for subscription is useless and expensive, just + // surpress the NO response. Unless we're on Mecury, which + // will just subscribe a folder again if it's already + // subscribed. + if ( strtolower($imap_server_type) != 'mercury32' || + !sqimap_mailbox_is_subscribed($imapConnection, $folder) ) { + sqimap_subscribe($imapConnection, $folder, false); + } } } } @@ -972,7 +926,7 @@ echo "\n\n" . html_tag( 'table', '', 'left', '', 'border="0" cellspacing="0" cel if ($date_format != 6) { /* First, display the clock. */ if ($hour_format == 1) { - $hr = 'G:i'; + $hr = 'H:i'; if ($date_format == 4) { $hr .= ':s'; } @@ -1003,12 +957,13 @@ if ($date_format != 6) { } $clk = str_replace(' ',' ',$clk); - echo '' . str_replace(' ',' ',_("Last Refresh")) . - ":
$clk

"; + echo '' + . str_replace(' ', ' ', _("Last Refresh")) + . ":
$clk

"; } /* Next, display the refresh button. */ -echo '
['. +echo '
['. _("Check mail") . ']

'; /* Lastly, display the folder list. */ @@ -1121,4 +1076,4 @@ sqimap_logout($imapConnection); ?> -
\ No newline at end of file +