fixed warning
[squirrelmail.git] / functions / mailbox_display.php
index 0a139ed1d9d141f602cb1404774929d5c5b1d0a3..0350414450e97b6a6562badce8e196a9acbab1c3 100644 (file)
@@ -433,7 +433,9 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
      } // switch
   } /* if exists > 0 */
 
-  $end_msg = getEndMessage(&$start_msg, $show_num, $num_msgs);
+  $res = getEndMessage($start_msg, $show_num, $num_msgs);
+  $start_msg = $res[0]; 
+  $end_msg = $res[1];
 
   $paginator_str = get_paginator_str($mailbox, $start_msg, $end_msg, 
                                     $num_msgs, $show_num, $sort);
@@ -445,7 +447,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
   mail_message_listing_beginning($imapConnection, $mailbox, $sort, 
                                   $msg_cnt_str, $paginator_str, $start_msg);
 
-
+  
   printHeader($mailbox, $srt, $color, !$thread_sort_messages);
 
   displayMessageArray($imapConnection, $num_msgs, $start_msg, 
@@ -565,7 +567,9 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
     $indent_array, $thread_sort_messages, $allow_server_sort, 
     $server_sort_order, $PHP_SELF;
 
-  $end_msg = getEndMessage(&$start_msg, $show_num, $num_msgs);
+  $res = getEndMessage($start_msg, $show_num, $num_msgs);
+  $start_msg = $res[0]; 
+  $end_msg = $res[1];
 
   $urlMailbox = urlencode($mailbox);
 
@@ -594,7 +598,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
   $t = 0;
 
   /* messages display */
-  echo  html_tag( 'table' ,'' , '', '', 'border="0" width="100%" cellpadding="1"  cellspacing="0"' );
+  
   if ($num_msgs == 0) {
     /* if there's no messages in this folder */
         echo html_tag( 'tr',
@@ -620,7 +624,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
       $k++;
     } while (isset ($key) && ($k < $i));
     printMessageInfo($imapConnection, $t, $i, $key, $mailbox,  
-                    $real_startMessage);
+                    $real_startMessage, $where, $what);
   } else {
     $i = $start_msg;
     reset($msort);
@@ -697,26 +701,32 @@ function mail_message_listing_beginning ($imapConnection,
         . html_tag( 'td' ,'' , 'left', $color[0], '' )
         . html_tag( 'table' ,'' , '', $color[0], 'border="0" width="100%" cellpadding="0"  cellspacing="0"' )
             . html_tag( 'tr',
-               getSmallStringCell(_("Move Selected To:"), 'left') .
+               getSmallStringCell(_("Move Selected To"), 'left') .
                getSmallStringCell(_("Transform Selected Messages"), 'right')
             )
             . html_tag( 'tr' ) ."\n"
             . html_tag( 'td', '', 'left', '', 'valign="middle" nowrap' );
             getMbxList($imapConnection);  
-            echo getButton('SUBMIT', 'moveButton',_("Move")) . '&nbsp;'."\n";   
-            echo getButton('SUBMIT', 'attache',_("Forward")) . '&nbsp;'."\n";   
+            echo getButton('SUBMIT', 'moveButton',_("Move")) . "\n";   
+            echo getButton('SUBMIT', 'attache',_("Forward")) . "\n";   
 
   echo "      </TD>\n"
     . html_tag( 'td', '', 'right', '', 'nowrap' );
 
   if (!$auto_expunge) {
      echo getButton('SUBMIT', 'expungeButton',_("Expunge")) 
-          .'&nbsp;' . _("mailbox") . '&nbsp;'."\n";   
+          .'&nbsp;' . _("mailbox") . "\n";   
   }
   
-  echo getButton('SUBMIT', 'markRead',_("Read")) ."\n";   
-  echo getButton('SUBMIT', 'markUnread',_("Unread")) ."\n";   
-  echo getButton('SUBMIT', 'delete',_("Delete")) .'&nbsp;'."\n";
+  echo getButton('SUBMIT', 'markRead',_("Read"));
+  echo getButton('SUBMIT', 'markUnread',_("Unread"));
+  echo getButton('SUBMIT', 'delete',_("Delete")) ."&nbsp\n";
+  if (!strpos($PHP_SELF,'mailbox')) {
+     $location = $PHP_SELF.'?mailbox=INBOX&amp;startMessage=1';
+  } else {
+     $location = $PHP_SELF;
+  }
+  echo '<INPUT TYPE="HIDDEN" NAME="location" VALUE="'.$location.'">';
   echo "</TD>\n"
        . "   </TR>\n";
 
@@ -791,6 +801,7 @@ 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( 'table' ,'' , '', $color[9], 'border="0" width="100%" cellpadding="1"  cellspacing="1"' );
     echo html_tag( 'tr' ,'' , 'center', $color[5] );
     for ($i=1; $i <= count($index_order); $i++) {
         switch ($index_order[$i]) {
@@ -1216,7 +1227,7 @@ return '<INPUT TYPE="'.$type.'" NAME="'.$name.'" VALUE="'.$value . '">';
 
 function getSmallStringCell($string, $align) {
   return html_tag( 'td',            
-            '<small>' . $string . ': &nbsp; </small>',
+            '<small>' . $string . ':&nbsp; </small>',
             $align,
             '',
             'nowrap' );
@@ -1235,7 +1246,7 @@ function getEndMessage($start_msg, $show_num, $num_msgs) {
       $start_msg = 1;
     }
   }
-  return $end_msg;
+  return (array($start_msg,$end_msg));
 }
 
 function handleAsSent($mailbox) {