X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=1b002ec461013bd16a23d4ade40372c82b3331fb;hb=c41daf03e80b768f8e8bcea532d2576dfb311c32;hp=0a4fc83e4d1e4ab54c1ffcd77cc9208bb69d8550;hpb=625c8b787b79d07a1e53ba05213f66451d73651e;p=squirrelmail.git diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 0a4fc83e..1b002ec4 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -3,7 +3,7 @@ /** * mailbox_display.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 contains functions that display mailbox information, such as the @@ -118,7 +118,7 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, * AAAAH! Make my eyes stop bleeding! * Who wrote this?! */ - if (sizeof($message_highlight_list)){ + if (is_array($message_highlight_list) && count($message_highlight_list)){ foreach ($message_highlight_list as $message_highlight_list_part) { if (trim($message_highlight_list_part['value']) != '') { $high_val = strtolower($message_highlight_list_part['value']); @@ -561,7 +561,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg, $urlMailbox = urlencode($mailbox); /* get indent level for subject display */ - if ($thread_sort_messages == 1 ) { + if ($thread_sort_messages == 1 && $num_msgs) { $indent_array = get_parent_level($imapConnection); } @@ -585,7 +585,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg, /* messages display */ - if ($num_msgs == 0) { + if (!$num_msgs) { /* if there's no messages in this folder */ echo html_tag( 'tr', html_tag( 'td', @@ -791,8 +791,17 @@ function mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $colo function printHeader($mailbox, $sort, $color, $showsort=true) { global $index_order; echo html_tag( 'tr' ,'' , 'center', $color[5] ); - for ($i = 1; $i <= count($index_order); $i++) { - switch ($index_order[$i]) { + + /* calculate the width of the subject column based on the + * widths of the other columns */ + $widths = array(1=>1,2=>25,3=>5,4=>0,5=>1,6=>5); + $subjectwidth = 100; + foreach($index_order as $item) { + $subjectwidth -= $widths[$item]; + } + + foreach ($index_order as $item) { + switch ($item) { case 1: /* checkbox */ case 5: /* flags */ echo html_tag( 'td' ,' ' , '', '', 'width="1%"' ); @@ -819,7 +828,7 @@ function printHeader($mailbox, $sort, $color, $showsort=true) { echo "\n"; break; case 4: /* subject */ - echo html_tag( 'td' ,'' , 'left', '', '' ) + echo html_tag( 'td' ,'' , 'left', '', 'width="'.$subjectwidth.'%"' ) . '' . _("Subject") . ''; if ($showsort) { ShowSortButton($sort, $mailbox, 4, 5);