From: pdontthink Date: Sun, 5 Apr 2009 04:26:27 +0000 (+0000) Subject: Moving function to its rightful place X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e3e770bdae1706d364495ef5529435682916a736;p=squirrelmail.git Moving function to its rightful place git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13517 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 56f814ae..88053467 100755 --- a/functions/imap_mailbox.php +++ b/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 * diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 5ddc48ac..07cb1ca5 100644 --- a/functions/mailbox_display.php +++ b/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