From: stekkel Date: Tue, 30 Jul 2002 10:02:34 +0000 (+0000) Subject: moved out identity stuff and removed redirect to view_header X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=8fde8417b5c9458070dec2e39d7393b1af075606;ds=inline moved out identity stuff and removed redirect to view_header git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3174 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/read_body.php b/src/read_body.php index 98119416..18424807 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -19,7 +19,6 @@ require_once('../functions/date.php'); require_once('../functions/url_parser.php'); require_once('../functions/smtp.php'); require_once('../functions/html.php'); -require_once('../src/view_header.php'); /** * Given an IMAP message id number, this will look it up in the cached @@ -380,34 +379,11 @@ function formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message, function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response) { global $base_uri, $sent_folder, $draft_folder, $where, $what, $color, $sort, - $startMessage, $data_dir, $username, $compose_new_win, $PHP_SELF; + $startMessage, $compose_new_win, $PHP_SELF, $save_as_draft; $topbar_delimiter = ' | '; $urlMailbox = encodeHeader($mailbox); - $identity = ''; - $idents = getPref($data_dir, $username, 'identities'); - $from_o = $message->header->from; - if (is_object($from_o)) { - $from_name = $from_o->getAddress(); - } else { - $from_name = ''; - } - if (!empty($idents) && $idents > 1) { - for ($i = 1; $i < $idents; $i++) { - $enc_from_name = '"'. - encodeHeader(getPref($data_dir, - $username, - 'full_name' . $i)) . - '" <' . getPref($data_dir, $username, - 'email_address' . $i) . '>'; - if (htmlspecialchars($enc_from_name) == $from_name) { - $identity = $i; - break; - } - } - } - $s = '
'; @@ -439,9 +415,7 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp $comp_uri = $base_uri . 'src/compose.php'. '?passed_id='.$passed_id. '&mailbox='.$urlMailbox. - (isset($passed_ent_id)?'&passed_ent_id='.$passed_ent_id:''). - '&identity='.$identity; - + (isset($passed_ent_id)?'&passed_ent_id='.$passed_ent_id:''); if (($mailbox == $draft_folder) && ($save_as_draft)) { $comp_alt_uri = $comp_uri . '&action=draft'; @@ -454,7 +428,7 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp $s .= $topbar_delimiter; if ($compose_new_win == '1') { $s .= ''.$comp_alt_string.''; + 'onclick="comp_in_new(\''.$comp_alt_uri.'\')">'.$comp_alt_string.''; } else { $s .= ''.$comp_alt_string.''; } @@ -527,15 +501,14 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp } function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) { - global $PHP_SELF; + global $QUERY_STRING, $base_uri; $urlMailbox = encodeHeader($mailbox); $s = ''. "\n". '
'; - - $viewheader_url = $PHP_SELF . '&view_hdr=1'; - $s .= ''.("View Full Header").''; + $url = $base_uri.'src/view_header.php?'.$QUERY_STRING; + $s .= ''.("View Full Header").''; /* Output the printer friendly link if we are in subtle mode. */ $s .= ' | '. printer_friendly_link($mailbox, $passed_id, $passed_ent_id, $color); @@ -609,18 +582,6 @@ $header = $message->header; * ============================================================================= */ - -/* - * The following code shows the header of the message and then exit - */ -if (isset($view_hdr)) { - $template_vars = array(); - $template_vars['full_header'] = parse_viewheader($imapConnection,$passed_id, $passed_ent_id); - $template_vars['return_address'] = set_url_var($PHP_SELF, 'view_hdr'); - view_header($template_vars, '', ''); - exit; -} - if (isset($sendreceipt)) { if ( !$message->is_mdnsent ) { if (isset($identity) ) {