X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=ad3355a2d1456d045f13ede080bc93c9f087e61f;hp=06c9677143d4472ce4974870063f914f6ac61f9e;hb=34e035f76d08e1919ada7e68af9a304d2d6d4ddd;hpb=b3e4bf7100bcc9ec2cc49153ab0f90601fce1082
diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php
index 06c96771..ad3355a2 100644
--- a/functions/mailbox_display.php
+++ b/functions/mailbox_display.php
@@ -1,17 +1,17 @@
';
$bold_end = '';
@@ -296,44 +300,126 @@ function printMessageInfo($aMsg) {
if (!isset($hlt_color)) {
$hlt_color = $color_string;
}
+
$col = 0;
$sSubject = str_replace(' ', ' ', decodeHeader($sSubject));
$subject = processSubject($sSubject, $iIndent);
- echo html_tag( 'tr','','','','VALIGN="top"') . "\n";
+
+ $row_extra = 'valign="top"';
+
+
+ // this stuff does the auto row highlighting on mouseover
+ //
+ if ($javascript_on && $fancy_index_highlite) {
+
+ $mouseoverColor = $color[5];
+
+ // set this to an empty string to turn off extra
+ // highlighting of checked rows
+ //
+ //$clickedColor = '';
+ if (!empty($color[16]))
+ $clickedColor = $color[16];
+ else
+ $clickedColor = $color[2];
+
+ $row_extra .= ' onmouseover="setPointer(this, ' . $t . ', \'over\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');" onmouseout="setPointer(this, ' . $t . ', \'out\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');" onmousedown="setPointer(this, ' . $t . ', \'click\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');"';
+
+ }
+
+
+ if ($javascript_on && $fancy_index_highlite)
+ echo "";
+ echo html_tag( 'tr', '', '', '', $row_extra) . "\n";
+
+
+ // this does the auto-checking of the checkbox no matter
+ // where on the row you click
+ //
+ $javascript_auto_click = '';
+ $checkbox_javascript = '';
+ if ($javascript_on && $fancy_index_highlite) {
+ $javascript_auto_click = ' onMouseDown="row_click(\'msg[' . $t . ']\')"';
+ $checkbox_javascript = ' onClick="this.checked = !this.checked;"';
+ }
+
if (sizeof($index_order)) {
+
+ // figure out which columns should serve as labels for checkbox:
+ // we try to grab the two columns before and after the checkbox,
+ // except the subject column, since it is the link that opens
+ // the message view
+ //
+ // if $javascript_on is set, then the highlighting code takes
+ // care of this; just skip it
+ //
+ $show_label_columns = array();
+ if (!($javascript_on && $fancy_index_highlite)) {
+ $get_next_two = 0;
+ $last_order_part = 0;
+ $last_last_order_part = 0;
+ foreach ($index_order as $index_order_part) {
+
+ if ($index_order_part == 1) {
+ $get_next_two = 1;
+ if ($last_last_order_part != 4)
+ $show_label_columns[] = $last_last_order_part;
+ if ($last_order_part != 4)
+ $show_label_columns[] = $last_order_part;
+
+ } else if ($get_next_two > 0 && $get_next_two < 3 && $index_order_part != 4) {
+ $show_label_columns[] = $index_order_part;
+ $get_next_two++;
+ }
+ $last_last_order_part = $last_order_part;
+ $last_order_part = $index_order_part;
+ }
+ }
+
+
+ // build the actual columns for display
+ //
foreach ($index_order as $index_order_part) {
+ if (in_array($index_order_part, $show_label_columns)) {
+ $label_start = '';
+ } else {
+ $label_start = '';
+ $label_end = '';
+ }
switch ($index_order_part) {
case 1: /* checkbox */
echo html_tag( 'td',
- addCheckBox("msg[$t]", $checkall, $iId),
+ addCheckBox("msg[$t]", $checkall, $iId, $checkbox_javascript),
'center',
- $hlt_color );
+ $hlt_color, $javascript_auto_click);
break;
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 = '';
}
echo html_tag( 'td',
- $italic . $bold . $flag . $fontstr . $senderName .
- $fontstr_end . $flag_end . $bold_end . $italic_end,
+ $label_start . $italic . $bold . $flag . $fontstr . $senderName .
+ $fontstr_end . $flag_end . $bold_end . $italic_end . $label_end,
'left',
- $hlt_color, $title );
+ $hlt_color, $title . $javascript_auto_click);
break;
case 3: /* date */
if ($sDate == '') {
$sDate = _("Unknown date");
}
echo html_tag( 'td',
- $bold . $flag . $fontstr . $sDate .
- $fontstr_end . $flag_end . $bold_end,
+ $label_start . $bold . $flag . $fontstr . $sDate .
+ $fontstr_end . $flag_end . $bold_end . $label_end,
'center',
$hlt_color,
- 'nowrap' );
+ 'style="white-space: nowrap;"' . $javascript_auto_click );
break;
case 4: /* subject */
$td_str = $bold;
@@ -343,16 +429,25 @@ function printMessageInfo($aMsg) {
$td_str .= ''), array("''", '<', '>'), $title);
$td_str .= " title=\"$title\"";
}
$td_str .= ">$flag$subject$flag_end$bold_end";
- echo html_tag( 'td', $td_str, 'left', $hlt_color );
+ echo html_tag( 'td', $td_str, 'left', $hlt_color, $javascript_auto_click );
break;
case 5: /* flags */
@@ -401,10 +496,10 @@ function printMessageInfo($aMsg) {
$td_str .= '';
$td_str .= '';
echo html_tag( 'td',
- $td_str,
+ $label_start . $td_str . $label_end,
'right',
$hlt_color,
- 'nowrap' );
+ 'style="white-space: nowrap;"' . $javascript_auto_click );
}
// plain text message markers
@@ -439,18 +534,18 @@ function printMessageInfo($aMsg) {
}
$td_str .= '';
echo html_tag( 'td',
- $td_str,
+ $label_start . $td_str . $label_end,
'center',
$hlt_color,
- 'nowrap' );
+ 'style="white-space: nowrap;"' . $javascript_auto_click );
}
break;
case 6: /* size */
echo html_tag( 'td',
- $bold . $fontstr . show_readable_size($iSize) .
- $fontstr_end . $bold_end,
+ $label_start . $bold . $fontstr . show_readable_size($iSize) .
+ $fontstr_end . $bold_end . $label_end,
'right',
- $hlt_color );
+ $hlt_color, $javascript_auto_click );
break;
}
++$col;
@@ -492,6 +587,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 +691,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 +805,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:
@@ -771,7 +866,7 @@ function get_sorted_msgs_list($imapConnection,&$aMailbox,&$error) {
if ($aRes === false) {
$error = '
' .
_("Thread sorting is not supported by your IMAP server.") . ' ' .
- _("Please report this to the system administrator.") .
+ _("Please contact your system administrator and report this error.") .
'
' .
_("Server-side sorting is not supported by your IMAP server.") . ' ' .
- _("Please report this to the system administrator.") .
+ _("Please contact your system administrator and report this error.") .
'
';
} else {
$aMailbox['UIDSET'][$iSetIndx] = $id;
@@ -836,7 +931,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 +1027,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 +1094,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 +1116,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 +1143,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 +1241,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 +1267,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,29 +1282,30 @@ function mail_message_listing_beginning ($imapConnection,
echo '