X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=a0284193f025e778358a458f3897ed56c3232380;hb=351ee7caf9ecc74c4f719989bf0d504df0bcb93b;hp=53b67c41e73466ee7c7699abcf2f73fa7da490c9;hpb=7c788b1c4a3ec1341b13669a3e7260725ee39021;p=squirrelmail.git
diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php
index 53b67c41..a0284193 100644
--- a/functions/mailbox_display.php
+++ b/functions/mailbox_display.php
@@ -1,17 +1,17 @@
';
$bold_end = '';
@@ -314,7 +316,7 @@ function printMessageInfo($aMsg) {
case 2: /* from */
if ($senderAddress != $senderName) {
$senderAddress = strtr($senderAddress, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
- $title = ' title="' . str_replace('"', "''", $senderAddress) . '"';
+ $title = ' title="' . str_replace(array('"', '<', '>'), array("''", '<', '>'), $senderAddress) . '"';
} else {
$title = '';
}
@@ -333,7 +335,7 @@ function printMessageInfo($aMsg) {
$fontstr_end . $flag_end . $bold_end,
'center',
$hlt_color,
- 'nowrap' );
+ 'style="white-space: nowrap;"' );
break;
case 4: /* subject */
$td_str = $bold;
@@ -348,7 +350,7 @@ function printMessageInfo($aMsg) {
$title = get_html_translation_table(HTML_SPECIALCHARS);
$title = array_flip($title);
$title = strtr($sSubject, $title);
- $title = str_replace('"', "''", $title);
+ $title = str_replace(array('"', '<', '>'), array("''", '<', '>'), $title);
$td_str .= " title=\"$title\"";
}
$td_str .= ">$flag$subject$flag_end$bold_end";
@@ -404,7 +406,7 @@ function printMessageInfo($aMsg) {
$td_str,
'right',
$hlt_color,
- 'nowrap' );
+ 'style="white-space: nowrap;"' );
}
// plain text message markers
@@ -442,7 +444,7 @@ function printMessageInfo($aMsg) {
$td_str,
'center',
$hlt_color,
- 'nowrap' );
+ 'style="white-space: nowrap;"' );
}
break;
case 6: /* size */
@@ -492,6 +494,7 @@ function sqm_api_mailbox_select($imapConnection,$mailbox,$aConfig,$aProps) {
/**
* In case the properties arrays are empty set the defaults.
*/
+ // Doesn't appear to be used... safe to remove?
$aDefaultMbxPref = array ();
// MBX_PREF_SORT => 0,
// MBX_PREF_LIMIT => 15,
@@ -595,7 +598,6 @@ function sqm_api_mailbox_select($imapConnection,$mailbox,$aConfig,$aProps) {
(!($newsort % 2) && ($newsort - 1 == $oldsort))) {
$aMailbox['UIDSET'][$iSetIndx] = array_reverse($aCachedMailbox['UIDSET'][$iSetIndx]);
} else {
- $server_sort_array = false;
$aMailbox['MSG_HEADERS'] = false;
$aMailbox['ID'] = false;
}
@@ -710,12 +712,12 @@ function sqm_api_mailbox_select($imapConnection,$mailbox,$aConfig,$aProps) {
/**
-* Does the $srt $_GET var to field mapping
-*
-* @param int $srt Field to sort on
-* @param bool $bServerSort Server sorting is true
-* @return string $sSortField Field to sort on
-*/
+ * Does the $srt $_GET var to field mapping
+ *
+ * @param int $srt Field to sort on
+ * @param bool $bServerSort Server sorting is true
+ * @return string $sSortField Field to sort on
+ */
function getSortField($sort,$bServerSort) {
switch($sort) {
case SQSORT_NONE:
@@ -836,7 +838,7 @@ function fetchMessageHeaders($imapConnection, &$aMailbox) {
}
// initialize the fields we want to retrieve:
- $aHeaderFields = array('Date', 'To', 'Cc', 'From', 'Subject', 'X-Priority', 'Content-Type');
+ $aHeaderFields = array('Date', 'To', 'Cc', 'From', 'Subject', 'X-Priority', 'Importance', 'Priority', 'Content-Type');
$aFetchItems = array('FLAGS', 'RFC822.SIZE');
// Are we sorting on internaldate then retrieve the internaldate value as well
@@ -932,10 +934,10 @@ function fetchMessageHeaders($imapConnection, &$aMailbox) {
}
/**
- * retrieve messages by sequence id's and fetch the UID to retrieve
- * the UID. for sorted lists this is not needed because a UID FETCH
- * automaticly add the UID value in fetch results
- **/
+ * retrieve messages by sequence id's and fetch the UID to retrieve
+ * the UID. for sorted lists this is not needed because a UID FETCH
+ * automaticly add the UID value in fetch results
+ **/
$aFetchItems[] = 'UID';
//create id range
@@ -999,14 +1001,14 @@ function fetchMessageHeaders($imapConnection, &$aMailbox) {
}
/**
-* This function loops through a group of messages in the mailbox
-* and shows them to the user.
-*
-* @param mixed $imapConnection
-* @param array $aMailbox associative array with mailbox related vars
-*/
+ * This function loops through a group of messages in the mailbox
+ * and shows them to the user.
+ *
+ * @param mixed $imapConnection
+ * @param array $aMailbox associative array with mailbox related vars
+ */
function showMessagesForMailbox($imapConnection, &$aMailbox) {
- global $color;
+ global $color, $javascript_on, $compact_paginator;
// to retrieve the internaldate pref: (I know this is not the right place to do that, move up in front
// and use a properties array as function argument to provide user preferences
@@ -1021,18 +1023,26 @@ function showMessagesForMailbox($imapConnection, &$aMailbox) {
$aMailbox['PAGEOFFSET'] + $iLimit - 1 : $aMailbox['EXISTS'];
$paginator_str = get_paginator_str($aMailbox['NAME'], $aMailbox['PAGEOFFSET'],
- $aMailbox['EXISTS'], $aMailbox['LIMIT'], $aMailbox['SHOWALL'][$iSetIndx]);
+ $aMailbox['EXISTS'], $aMailbox['LIMIT'], $aMailbox['SHOWALL'][$iSetIndx]);
$msg_cnt_str = get_msgcnt_str($aMailbox['PAGEOFFSET'], $iEnd,$aMailbox['EXISTS']);
do_hook('mailbox_index_before');
+
+ if ($javascript_on && $compact_paginator) {
+ // Insert compact paginator javascript
+ echo "\n\n"
+ . "\n"
+ . "\n";
+ }
+ mail_message_listing_beginning($imapConnection, $aMailbox, $msg_cnt_str, $paginator_str);
?>
-
-
-
-
- |
-
|
@@ -1040,38 +1050,34 @@ function showMessagesForMailbox($imapConnection, &$aMailbox) {
|
|
-
-
+
+
";
-*
-* @param resource $imapConnection
-* @param array $aMailbox associative array with mailbox related information
-* @param string $msg_cnt_str
-* @param string $paginator Paginator string
-*/
+ * Displays the standard message list header.
+ *
+ * To finish the table, you need to do a "";
+ *
+ * @param resource $imapConnection
+ * @param array $aMailbox associative array with mailbox related information
+ * @param string $msg_cnt_str
+ * @param string $paginator Paginator string
+ */
function mail_message_listing_beginning ($imapConnection,
$aMailbox,
$msg_cnt_str = '',
@@ -1142,13 +1148,12 @@ function mail_message_listing_beginning ($imapConnection,
$php_self = $PHP_SELF;
- $urlMailbox = urlencode($aMailbox['NAME']);
-
if (preg_match('/^(.+)\?.+$/',$php_self,$regs)) {
$source_url = $regs[1];
} else {
$source_url = $php_self;
}
+ $php_self = str_replace('&', '&', $php_self);
if (!isset($msg)) {
$msg = '';
@@ -1169,8 +1174,8 @@ function mail_message_listing_beginning ($imapConnection,
$sort = $aMailbox['SORT'] + SQSORT_THREAD;
}
$thread_link_str = '[' . $thread_name
+ . $sort . '&start_messages=1'
+ . '&mailbox=' . urlencode($aMailbox['NAME']) . '">' . $thread_name
. ']';
} else {
$thread_link_str ='';
@@ -1184,6 +1189,7 @@ function mail_message_listing_beginning ($imapConnection,
echo '