Added sent_subfolders plugin, tweaked config stuff, other stuff.
[squirrelmail.git] / functions / mailbox_display.php
index 1dcc345018dd7eda25c847368ad939b85eac8505..dd38cfa3869bf4ec5af499328d09fae42d7196a9 100644 (file)
@@ -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) {
@@ -385,8 +385,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg, &$msgs, $ms
         $msg = '';
     }
 
-    mail_message_listing_beginning
-        ($imapConnection,
+    mail_message_listing_beginning( $imapConnection,
         "move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$start_msg",
         $mailbox, $sort, $msg_cnt_str, $paginator_str, $start_msg);
 
@@ -544,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>';
@@ -581,13 +579,13 @@ function mail_message_listing_beginning
 function ShowSortButton($sort, $mailbox, $Up, $Down) {
     /* Figure out which image we want to use. */
     if ($sort != $Up && $sort != $Down) {
-        $img = 'sort_none.gif';
+        $img = 'sort_none.png';
         $which = $Up;
     } elseif ($sort == $Up) {
-        $img = 'up_pointer.gif';
+        $img = 'up_pointer.png';
         $which = $Down;
     } else {
-        $img = 'down_pointer.gif';
+        $img = 'down_pointer.png';
         $which = 6;
     }
 
@@ -691,7 +689,7 @@ function get_paginator_str
     $sep = '|';          /* This will be used as a seperator. */
 
     /* Get some paginator preference values. */
-    $pg_sel = getPref($data_dir, $username, 'page_selector', SM_OPT_ON);
+    $pg_sel = getPref($data_dir, $username, 'page_selector', SMPREF_ON);
     $pg_max = getPref($data_dir, $username, 'page_selector_max', PG_SEL_MAX);
 
     /* Make sure that our start message number is not too big. */
@@ -892,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);
+}
+
 ?>