X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=3631ac5405fb7ea26ad86dc3e178c7721d7b2f98;hb=34c905749d736b54b8786cca0f5501e5cf87fea3;hp=fadc568487e4fc8cb1825da675ee38534f7affae;hpb=43fdb2a474b990b8b7db21bfb05b30a70ac768a0;p=squirrelmail.git
diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php
index fadc5684..3631ac54 100644
--- a/functions/mailbox_display.php
+++ b/functions/mailbox_display.php
@@ -12,27 +12,29 @@
* $Id$
*/
-include_once('../functions/strings.php');
+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 $pos; /* Search postion (if any) */
+ 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];
}
}
@@ -115,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' : '');
@@ -134,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') {
@@ -192,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) {
@@ -266,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('', '', '', '', '', '');
@@ -345,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');
@@ -404,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);
@@ -515,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 ''.
"".
- "".
"";
@@ -609,7 +615,7 @@ function ShowSortButton($sort, $mailbox, $Up, $Down) {
/* Now that we have everything figured out, show the actual button. */
echo ' ';
}
@@ -618,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 .= "";
@@ -688,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);
}
@@ -857,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") . '';
}
|