Browse Source

Moving function to its rightful place

pdontthink 16 years ago
parent
commit
c07775cdaa
2 changed files with 28 additions and 17 deletions
  1. 28 0
      functions/imap_mailbox.php
  2. 0 17
      functions/mailbox_display.php

+ 28 - 0
functions/imap_mailbox.php

@@ -283,6 +283,34 @@ function isDraftMailbox($box,$include_subs=true) {
             ($include_subs && isBoxBelow($box, $draft_folder)) );
 }
 
+/**
+ * Is the given folder "sent-like" in nature?
+ *
+ * The most obvious use of this is to know what folders you usually
+ * want to show the To field instead of the From field on the mailbox list
+ *
+ * This function returns TRUE if the given folder is the sent
+ * folder (or any of its subfolders) or if it is the draft
+ * folder (or any of its subfolders)
+ *
+ * @param string $mailbox
+ *
+ * @return boolean See explanation above
+ *
+ */
+function handleAsSent($mailbox) {
+    global $handleAsSent_result;
+
+    /* First check if this is the sent or draft folder. */
+    $handleAsSent_result = isSentMailbox($mailbox) || isDraftMailbox($mailbox);
+
+    /* Then check the result of the handleAsSent hook. */
+    do_hook('check_handleAsSent_result', $mailbox);
+
+    /* And return the result. */
+    return $handleAsSent_result;
+}
+
 /**
  * Expunges a mailbox
  *

+ 0 - 17
functions/mailbox_display.php

@@ -1298,23 +1298,6 @@ function truncateWithEntities($s, $iTrimAt) {
 }
 
 
-/**
- * This should go in imap_mailbox.php
- * @param string $mailbox
- */
-function handleAsSent($mailbox) {
-    global $handleAsSent_result;
-
-    /* First check if this is the sent or draft folder. */
-    $handleAsSent_result = isSentMailbox($mailbox) || isDraftMailbox($mailbox);
-
-    /* Then check the result of the handleAsSent hook. */
-    do_hook('check_handleAsSent_result', $mailbox);
-
-    /* And return the result. */
-    return $handleAsSent_result;
-}
-
 /**
  * Process messages list form and handle the cache gracefully. If $sButton and
  * $aUid are provided as argument then you can fake a message list submit and