Next link moved to sit next to Previous link so that it will always b in the same...
[squirrelmail.git] / functions / mailbox_display.php
index fbf271c6e8924c61a06c90c0040774f035321055..1cfeecbe4649f9dd473d45b44e1b192830cc5673 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * mailbox_display.php
  *
- * Copyright (c) 1999-2001 The SquirrelMail Development Team
+ * Copyright (c) 1999-2002 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
@@ -62,7 +62,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start
         $bold_end = '';
     }
 
-    if (($mailbox == $sent_folder) || ($mailbox == $draft_folder)) {
+    if (handleAsSent($mailbox)) {
         $italic = '<i>';
         $italic_end = '</i>';
     } else {
@@ -188,7 +188,7 @@ function showMessagesForMailbox
     }
     sqimap_mailbox_select($imapConnection, $mailbox);
 
-    $issent = (($mailbox == $sent_folder) || ($mailbox == $draft_folder));
+    $issent = handleAsSent($mailbox);
     if (!$use_cache) {
         /* If it is sorted... */
         if ($num_msgs >= 1) {
@@ -543,8 +543,7 @@ function mail_message_listing_beginning
             break;
 
         case 2: /* from */
-            if (($mailbox == $sent_folder)
-                    || ($mailbox == $draft_folder)) {
+            if (handleAsSent($mailbox)) {
                 echo '   <TD WIDTH="25%"><B>'. _("To") .'</B>';
             } else {
                 echo '   <TD WIDTH="25%"><B>'. _("From") .'</B>';
@@ -849,9 +848,9 @@ function get_paginator_str
     $result = '';
     $result .= ($all_str != '' ? $all_str . $spc . $sep . $spc: '');
     $result .= ($prv_str != '' ? $prv_str . $spc . $sep . $spc : '');
-    $result .= ($pg_str != '' ? $pg_str . $sep . $spc : '');
-    $result .= ($nxt_str != '' ? $nxt_str : '');
-    $result .= ($result != '' ? $spc . $sep . $spc . $tgl_str: $tgl_str);
+    $result .= ($nxt_str != '' ? $nxt_str . $spc . $sep . $spc : '');
+    $result .= ($pg_str != '' ? $pg_str : '');
+    $result .= ($result != '' ? $sep . $spc . $tgl_str: $tgl_str);
 
     /* If the resulting string is blank, return a non-breaking space. */
     if ($result == '') {
@@ -891,4 +890,19 @@ function processSubject($subject) {
     return substr($subject, 0, $trim_val) . '...';
 }
 
+function handleAsSent($mailbox) {
+    global $sent_folder, $draft_folder;
+    global $handleAsSent_result;
+
+    /* First check if this is the sent or draft folder. */
+    $handleAsSent_result = (($mailbox == $sent_folder)
+                        || ($mailbox == $draft_folder));
+
+    /* Then check the result of the handleAsSent hook. */
+    do_hook('check_handleAsSent_result', $mailbox);
+
+    /* And return the result. */
+    return ($handleAsSent_result);
+}
+
 ?>