Removed warnings that were appearing
[squirrelmail.git] / functions / mailbox_display.php
index c43e14aa67ff4a34e71d7e11ac67f59f32e1f925..5a36afb3cf4592f00629ca7b14c86a711f33c833 100644 (file)
@@ -21,6 +21,7 @@
       global $checkall;
       global $color, $msgs, $msort;
       global $sent_folder, $draft_folder;
+      global $default_use_priority;
       global $message_highlight_list;
       global $index_order;
 
                   echo "A\n";
                   $stuff = true;
                }
-               if (ereg('(5)',substr($msg['PRIORITY'],0,1))) {
-                  echo "<font color=$color[8]>v</font>\n";
-                  $stuff = true;
-               }
                if ($msg['TYPE0'] == 'multipart') {
                   echo "+\n";
                   $stuff = true;
                }
-               if (ereg('(1|2)',substr($msg['PRIORITY'],0,1))) {
-                  echo "<font color=$color[1]>!</font>\n";
-                  $stuff = true;
+              if ($default_use_priority) {
+                  if (ereg('(1|2)',substr($msg['PRIORITY'],0,1))) {
+                     echo "<font color=$color[1]>!</font>\n";
+                     $stuff = true;
+                  }
+                  if (ereg('(5)',substr($msg['PRIORITY'],0,1))) {
+                     echo "<font color=$color[8]>?</font>\n";
+                     $stuff = true;
+                  }
                }
                if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED']) {
                   echo "<font color=\"$color[1]\">D</font>\n";
       do_hook('mailbox_index_before');
 
       $msg_cnt_str = get_msgcnt_str($start_msg, $end_msg, $num_msgs);
-      $paginator_str = get_paginator_str($urlMailbox, $start_msg, $end_msg, $num_msgs, $show_num);
+      $paginator_str = get_paginator_str($urlMailbox, $start_msg, $end_msg, $num_msgs, $show_num, $sort);
 
       if (! isset($msg)) {
           $msg = '';
       for ($i = 0; $i < count($boxes); $i++) {
          if (!in_array("noselect", $boxes[$i]['flags'])) {
             $box = $boxes[$i]['unformatted'];
-            $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
+            $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['unformatted-disp']);
             echo "         <OPTION VALUE=\"$box\">$box2</option>\n";
          }
       }
      * This function computes the paginator string.
      */
     function get_paginator_str
-    ($urlMailbox, $start_msg, $end_msg, $num_msgs, $show_num) {
+    ($urlMailbox, $start_msg, $end_msg, $num_msgs, $show_num, $sort) {
+        global $username, $data_dir, $use_mailbox_cache, $color;
+
         $nextGroup = $start_msg + $show_num;
         $prevGroup = $start_msg - $show_num;
 
             $rMore = "<A HREF=\"right_main.php?use_mailbox_cache=$use&startMessage=$nextGroup&mailbox=$urlMailbox\" TARGET=\"right\">". _("Next") ."</A>\n";
         }
         if ($lMore <> '') {
-            $lMore .= ' | ';
+            $lMore .= '&nbsp;|&nbsp;';
         }
 
         /* Page selector block. Following code computes page links. */
             if ($num_msgs % $show_num <> 0 ) {
                 $j++;
             }
-            $start_msgs = min( $start_msgs, $num_msgs );
-            $p = intval( $start_msgs / $show_num ) + 1;
+            $start_msg = min( $start_msg, $num_msgs );
+            $p = intval( $start_msg / $show_num ) + 1;
             $i = 1;
             while( $i < $p ) {
                 $pg = intval( $i );
                 $start = ( ($pg-1) * $show_num ) + 1;
                 $mMore .= "<a href=\"right_main.php?use_mailbox_cache=$use_mailbox_cache&startMessage=$start" .
-                          "&mailbox=$urlMailbox\" TARGET=\"right\">$pg</a> ";
+                          "&mailbox=$urlMailbox\" TARGET=\"right\">$pg</a>&nbsp;";
                 $i += $k;
             }
-            $mMore .= "<b>$p</b> ";
+            $mMore .= "<B>$p</B>&nbsp;";
             $i += $k;
             while( $i <= $j ) {
                $pg = intval( $i );
                $start = ( ($pg-1) * $show_num ) + 1;
                $mMore .= "<a href=\"right_main.php?use_mailbox_cache=$use_mailbox_cache&startMessage=$start"
-                       . "&mailbox=$urlMailbox\" TARGET=\"right\">$pg</a> ";
+                       . "&mailbox=$urlMailbox\" TARGET=\"right\">$pg</a>&nbsp;";
                $i+=$k;
             }
-            $mMore .= ' | ';
+            $mMore .= '&nbsp;|&nbsp;';
         }
 
         /* Return the resulting string. */