X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=3631ac5405fb7ea26ad86dc3e178c7721d7b2f98;hb=b1e297949f09092a5b8b7e5a1dd93308557985b4;hp=6596b86a9817c6fcba497d8f8ea832297602da7f;hpb=a5ee5ac2abfa64906394d54b9d94719517274b90;p=squirrelmail.git
diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php
index 6596b86a..3631ac54 100644
--- a/functions/mailbox_display.php
+++ b/functions/mailbox_display.php
@@ -12,30 +12,47 @@
* $Id$
*/
+require_once('../functions/strings.php');
+
define('PG_SEL_MAX', 10); /* Default value for page_selector_max. */
function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start_msg, $where, $what) {
- global $checkall;
- global $color, $msgs, $msort;
- global $sent_folder, $draft_folder;
- global $default_use_priority;
- global $message_highlight_list;
- global $index_order;
+ global $checkall,
+ $color, $msgs, $msort,
+ $sent_folder, $draft_folder,
+ $default_use_priority,
+ $message_highlight_list,
+ $index_order,
+ $pos; /* Search postion (if any) */
$color_string = $color[4];
if ($GLOBALS['alt_index_colors']) {
- if (!isset($GLOBALS["row_count"])) {
- $GLOBALS["row_count"] = 0;
+ if (!isset($GLOBALS['row_count'])) {
+ $GLOBALS['row_count'] = 0;
}
- $GLOBALS["row_count"]++;
- if ($GLOBALS["row_count"] % 2) {
- if (!isset($color[12])) $color[12] = '#EAEAEA';
+ $GLOBALS['row_count']++;
+ if ($GLOBALS['row_count'] % 2) {
+ if (!isset($color[12])) {
+ $color[12] = '#EAEAEA';
+ }
$color_string = $color[12];
}
}
$msg = $msgs[$key];
- $senderName = sqimap_find_displayable_name($msg['FROM']);
+ /**
+ * This is done in case you're looking into Sent folders,
+ * because you can have multi receiver.
+ */
+ $sendersName = split(',', $msg['FROM']);
+ $senderName = '';
+ for ($index = 0 ; $index < count($sendersName) ; $index++) {
+ if ($senderName != '') {
+ $senderName .= ', ';
+ }
+ $senderName .= sqimap_find_displayable_name($sendersName[$index]);
+ }
+
if( $mailbox == 'None' ) {
// $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
@@ -100,7 +117,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start
if( !isset( $pos ) || $pos == '' ) {
$pos = '0';
}
- $search_stuff = "&pos=" . urlencode( $pos ) . "&where=".urlencode($where).'&what='.urlencode($what);
+ $search_stuff = "&pos=" . urlencode( $pos ) . "&where=".urlencode($where).'&what='.urlencode($what);
}
$checked = ($checkall == 1 ?' checked' : '');
@@ -119,7 +136,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start
case 4: /* subject */
echo "
$bold";
if (! isset($search_stuff)) { $search_stuff = ''; }
- echo "\n";
if (isset($msg['FLAG_ANSWERED']) &&
$msg['FLAG_ANSWERED'] == true) {
- echo "A\n";
+ echo _("A") . "\n";
$stuff = true;
}
if ($msg['TYPE0'] == 'multipart') {
@@ -177,13 +194,12 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start
* This function loops through a group of messages in the mailbox
* and shows them to the user.
*/
-function showMessagesForMailbox
-($imapConnection, $mailbox, $num_msgs, $start_msg, $sort,
- $color, $show_num, $use_cache) {
- global $msgs, $msort;
- global $sent_folder, $draft_folder;
- global $message_highlight_list;
- global $auto_expunge;
+function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $start_msg, $sort,
+ $color, $show_num, $use_cache) {
+ global $msgs, $msort,
+ $sent_folder, $draft_folder,
+ $message_highlight_list,
+ $auto_expunge;
/* If autoexpunge is turned on, then do it now. */
if ($auto_expunge == true) {
@@ -251,7 +267,7 @@ function showMessagesForMailbox
while ($j < $end_loop) {
if (isset($date[$j])) {
- $date[$j] = ereg_replace(' ', ' ', $date[$j]);
+ $date[$j] = str_replace(' ', ' ', $date[$j]);
$tmpdate = explode(' ', trim($date[$j]));
} else {
$tmpdate = $date = array('', '', '', '', '', '');
@@ -330,21 +346,22 @@ function showMessagesForMailbox
** 2 = Name (up)
** 3 = Name (dn)
**/
- session_unregister("msgs");
- if (($sort == 0) || ($sort == 1))
+ session_unregister('msgs');
+ if (($sort == 0) || ($sort == 1)) {
$msort = array_cleave ($msgs, 'TIME_STAMP');
- elseif (($sort == 2) || ($sort == 3))
+ } elseif (($sort == 2) || ($sort == 3)) {
$msort = array_cleave ($msgs, 'FROM-SORT');
- elseif (($sort == 4) || ($sort == 5))
+ } elseif (($sort == 4) || ($sort == 5)) {
$msort = array_cleave ($msgs, 'SUBJECT-SORT');
- else // ($sort == 6)
+ } else { // ($sort == 6)
$msort = $msgs;
+ }
if ($sort < 6) {
if ($sort % 2) {
- asort($msort);
+ asort($msort);
} else {
- arsort($msort);
+ arsort($msort);
}
}
session_register('msort');
@@ -389,7 +406,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg, &$msgs, $ms
}
mail_message_listing_beginning( $imapConnection,
- "move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$start_msg",
+ "move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$start_msg",
$mailbox, $sort, $msg_cnt_str, $paginator_str, $start_msg);
$groupNum = $start_msg % ($show_num - 1);
@@ -500,39 +517,43 @@ function mail_message_listing_beginning
. " | \n"
. " \n"
. " \n"
- . " \n"
+ . " | \n"
. ' '.
- "\n".
+ ' '.
+ ' \n"."\n".
" | \n".
- " \n";
+ " | ";
if (!$auto_expunge) {
- echo ' '. _("mailbox") ." \n";
+ echo ' ' . _("mailbox") . ' ';
}
- echo " \n".
- " \n".
- " \n".
- " | \n".
+ echo '' .
+ '' .
+ ' ' .
+ "\n".
"
\n".
"\n";
do_hook('mailbox_form_before');
echo ''.
"".
- "".
"";
@@ -594,7 +615,7 @@ function ShowSortButton($sort, $mailbox, $Up, $Down) {
/* Now that we have everything figured out, show the actual button. */
echo ' ';
}
@@ -603,9 +624,10 @@ function get_selectall_link($start_msg, $sort) {
global $checkall, $what, $where, $mailbox, $javascript_on;
global $PHP_SELF, $PG_SHOWNUM;
+ $result = '';
if ($javascript_on) {
$result =
- '' . _("Toggle All") . "\n";
} else {
- $result .= "";
@@ -673,7 +701,7 @@ function get_msgcnt_str($start_msg, $end_msg, $num_msgs) {
function get_paginator_link
($box, $start_msg, $use, $text) {
$result = "$text";
return ($result);
}
@@ -842,14 +870,14 @@ function get_paginator_str
}
} else if ($PG_SHOWNUM == 999999) {
$pg_str = ""
+ . "&startMessage=1&mailbox=$box\" TARGET=\"right\">"
. _("Paginate") . '' . $spc;
}
/* If necessary, compute the 'show all' string. */
if (($prv_str != '') || ($nxt_str != '')) {
$all_str = "" . _("Show All") . '';
}
@@ -917,4 +945,4 @@ function handleAsSent($mailbox) {
return ($handleAsSent_result);
}
-?>
\ No newline at end of file
+?>
|