/**
* 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
$bold_end = '';
}
- if (($mailbox == $sent_folder) || ($mailbox == $draft_folder)) {
+ if (handleAsSent($mailbox)) {
$italic = '<i>';
$italic_end = '</i>';
} else {
}
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) {
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>';
/**
* This function computes the paginator string.
- * It was derived from code contributed by Charles Scheidecker.
*/
function get_paginator_str
($box, $start_msg, $end_msg, $num_msgs, $show_num, $sort) {
$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 == '') {
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);
+}
+
?>