* This file is used for reading the msgs array and displaying
* the resulting emails in the right frame.
*
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright 1999-2010 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
if ($special_encoding) {
$mime_header->encoding = $special_encoding;
} else {
- $mime_header->encoding = 'us-ascii';
+ $mime_header->encoding = '7bit';
}
if ($default_charset) {
$mime_header->parameters['charset'] = $default_charset;
$mime_header = new MessageHeader;
$mime_header->type0 = 'message';
$mime_header->type1 = 'disposition-notification';
- $mime_header->encoding = 'us-ascii';
+ $mime_header->encoding = '7bit';
$part2->mime_header = $mime_header;
$composeMessage = new Message();
/**
* Format message toolbar
*
- * @param array $aMailbox Current mailbox information array
- * @param int $passed_id UID of current message
- * @param int $passed_ent_id Id of entity within message
- * @param object $message Current message object
- * @param object $mbx_response
+ * @param array $aMailbox Current mailbox information array
+ * @param int $passed_id UID of current message
+ * @param int $passed_ent_id Id of entity within message
+ * @param object $message Current message object
+ * @param void $removedVar This parameter is no longer used, but remains
+ * so as not to break this function's prototype
+ * (OPTIONAL)
+ * @param boolean $nav_on_top When TRUE, the menubar is being constructed
+ * for use at the top of the page, otherwise it
+ * will be used for page bottom (OPTIONAL;
+ * default = TRUE)
*/
-function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removedVar, $nav_on_top = TRUE) {
+function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,
+ $removedVar=FALSE, $nav_on_top=TRUE) {
+
global $base_uri, $draft_folder, $where, $what, $sort,
$startMessage, $PHP_SELF, $save_as_draft,
$enable_forward_as_attachment, $imapConnection, $lastTargetMailbox,
'&mailbox='.$urlMailbox.'&sort='.$sort.
'&startMessage='.$startMessage.'&show_more=0'.
"&where=$where&what=$what" .
- '&delete_id='.$passed_id;
+ '&delete_id='.$passed_id .
+ '&smtoken='.sm_generate_security_token();
}
if ($next >= 0) {
'&mailbox='.$urlMailbox.'&sort='.$sort.
'&startMessage='.$startMessage.'&show_more=0'.
"&where=$where&what=$what" .
- '&delete_id='.$passed_id;
+ '&delete_id='.$passed_id .
+ '&smtoken='.sm_generate_security_token();
}
}
}
// If Draft folder - create Resume link
$resume_draft = $edit_as_new = false;
- if (($mailbox == $draft_folder) && ($save_as_draft)) {
- $resume_draft = true; 'smaction_draft';
+ if (isDraftMailbox($mailbox) && ($save_as_draft)) {
+ $resume_draft = true;
} else if (handleAsSent($mailbox)) {
$edit_as_new = true;
}
$oTemplate->assign('can_be_copied', false);
}
+ // access keys... only add to the top menubar, because adding
+ // them twice makes them less functional (press access key, *then*
+ // press <enter> to make it work)
+ //
+ if ($nav_on_top) {
+ global $accesskey_read_msg_reply, $accesskey_read_msg_reply_all,
+ $accesskey_read_msg_forward, $accesskey_read_msg_as_attach,
+ $accesskey_read_msg_delete, $accesskey_read_msg_bypass_trash,
+ $accesskey_read_msg_move, $accesskey_read_msg_move_to;
+ } else {
+ $accesskey_read_msg_reply = $accesskey_read_msg_reply_all =
+ $accesskey_read_msg_forward = $accesskey_read_msg_as_attach =
+ $accesskey_read_msg_delete = $accesskey_read_msg_bypass_trash =
+ $accesskey_read_msg_move = $accesskey_read_msg_move_to = 'NONE';
+ }
+ $oTemplate->assign('accesskey_read_msg_reply', $accesskey_read_msg_reply);
+ $oTemplate->assign('accesskey_read_msg_reply_all', $accesskey_read_msg_reply_all);
+ $oTemplate->assign('accesskey_read_msg_forward', $accesskey_read_msg_forward);
+ $oTemplate->assign('accesskey_read_msg_as_attach', $accesskey_read_msg_as_attach);
+ $oTemplate->assign('accesskey_read_msg_delete', $accesskey_read_msg_delete);
+ $oTemplate->assign('accesskey_read_msg_bypass_trash', $accesskey_read_msg_bypass_trash);
+ $oTemplate->assign('accesskey_read_msg_move_to', $accesskey_read_msg_move_to);
+ $oTemplate->assign('accesskey_read_msg_move', $accesskey_read_msg_move);
+
global $null;
do_hook('read_body_menu', $null);
}
/** GET/POST VARS */
+sqgetGlobalVar('passed_id', $passed_id, SQ_INORDER, NULL, SQ_TYPE_BIGINT);
sqgetGlobalVar('passed_ent_id', $passed_ent_id);
sqgetGlobalVar('mailbox', $mailbox);
-if ( sqgetGlobalVar('passed_id', $temp) ) {
- $passed_id = (int) $temp;
-}
if ( sqgetGlobalVar('sort', $temp) ) {
$sort = (int) $temp;
}