$td_str .= '<a href="read_body.php?mailbox='.$urlMailbox
. '&passed_id='. $msg["ID"]
. '&startMessage='.$start_msg.$searchstr.'"';
- do_hook("subject_link");
+ $td_str .= ' ' .concat_hook_function('subject_link');
if ($subject != $msg['SUBJECT']) {
$title = get_html_translation_table(HTML_SPECIALCHARS);
$title = array_flip($title);
}
function fillMessageArray($imapConnection, $id, $count) {
- $msgs_list = sqimap_get_small_header_list($imapConnection, $id);
- $messages = array();
- if (sizeof($msgs_list)) {
- foreach ($msgs_list as $hdr) {
- $unique_id[] = $hdr->uid;
- $from[] = $hdr->from;
- $date[] = $hdr->date;
- $subject[] = $hdr->subject;
- $to[] = $hdr->to;
- $priority[] = $hdr->priority;
- $cc[] = $hdr->cc;
- $size[] = $hdr->size;
- $type[] = $hdr->type0;
- $flag_deleted[] = $hdr->flag_deleted;
- $flag_answered[] = $hdr->flag_answered;
- $flag_seen[] = $hdr->flag_seen;
- $flag_flagged[] = $hdr->flag_flagged;
- }
- }
-
- for($j = 0; $j < $count; ++$j) {
- if (isset($date[$j])) {
- $date[$j] = str_replace(' ', ' ', $date[$j]);
- $tmpdate = explode(' ', trim($date[$j]));
- } else {
- $tmpdate = $date = array('', '', '', '', '', '');
- }
- $messages[$j]['TIME_STAMP'] = getTimeStamp($tmpdate);
- $messages[$j]['DATE_STRING'] =
- getDateString($messages[$j]['TIME_STAMP']);
- $messages[$j]['ID'] = $unique_id[$j];
- $messages[$j]['FROM'] = decodeHeader($from[$j]);
- $messages[$j]['FROM-SORT'] =
- strtolower(sqimap_find_displayable_name(decodeHeader($from[$j])));
- $messages[$j]['SUBJECT'] = decodeHeader($subject[$j]);
- $messages[$j]['SUBJECT-SORT'] = strtolower(decodeHeader($subject[$j]));
- $messages[$j]['TO'] = decodeHeader($to[$j]);
- $messages[$j]['PRIORITY'] = $priority[$j];
- $messages[$j]['CC'] = $cc[$j];
- $messages[$j]['SIZE'] = $size[$j];
- $messages[$j]['TYPE0'] = $type[$j];
- $messages[$j]['FLAG_DELETED'] = $flag_deleted[$j];
- $messages[$j]['FLAG_ANSWERED'] = $flag_answered[$j];
- $messages[$j]['FLAG_SEEN'] = $flag_seen[$j];
- $messages[$j]['FLAG_FLAGGED'] = $flag_flagged[$j];
-
- /*
- * fix SUBJECT-SORT to remove Re:
- * vedr|sv (Danish)
- * re|aw (English)
- *
- * TODO: i18n should be incorporated here. E.g. we catch the ones
- * we know about, but also define in i18n what the localized
- * "Re: " is for this or that locale.
- */
- if (preg_match("/^(vedr|sv|re|aw):\s*(.*)$/si",
- $messages[$j]['SUBJECT-SORT'], $matches)){
- $messages[$j]['SUBJECT-SORT'] = $matches[2];
- }
- }
- return $messages;
+ return sqimap_get_small_header_list($imapConnection, $id);
}
if (!isset($msg)) {
$msg = '';
}
- $moveURL = "move_messages.php?msg=$msg&mailbox=$urlMailbox"
- . "&startMessage=$start_msg";
+ $moveFields = '<input type="hidden" name="msg" value="'.htmlspecialchars($msg).'">' .
+ '<input type="hidden" name="mailbox" value="'.htmlspecialchars($mailbox).'">' .
+ '<input type="hidden" name="startMessage" value="'.htmlspecialchars($start_msg).'">';
+
+// $moveURL = "move_messages.php?msg=$msg&mailbox=$urlMailbox"
+// . "&startMessage=$start_msg";
/*
* This is the beginning of the message list table.
* It wraps around all messages
*/
- echo "<FORM name=\"messageList\" method=post action=\"$moveURL\">\n"
+ echo '<form name="messageList" method="post" action="move_messages.php">' ."\n"
+ . $moveFields
. html_tag( 'table' ,
html_tag( 'tr',
html_tag( 'td' ,
echo getButton('SUBMIT', 'markRead',_("Read"));
echo getButton('SUBMIT', 'markUnread',_("Unread"));
- echo getButton('SUBMIT', 'delete',_("Delete")) ." \n";
+ echo getButton('SUBMIT', 'delete',_("Delete")) ." \n";
if (!strpos($php_self,'mailbox')) {
$location = $php_self.'?mailbox=INBOX&startMessage=1';
} else {
}
function handleAsSent($mailbox) {
- global $sent_folder, $draft_folder, $handleAsSent_result;
-
+ global $handleAsSent_result;
+
/* First check if this is the sent or draft folder. */
- $handleAsSent_result = (($mailbox == $sent_folder)
- || ($mailbox == $draft_folder));
+ $handleAsSent_result = isSentMailbox($mailbox) || isDraftMailbox($mailbox);
/* Then check the result of the handleAsSent hook. */
do_hook('check_handleAsSent_result', $mailbox);
/* And return the result. */
- return ($handleAsSent_result);
+ return $handleAsSent_result;
}
?>