From 40a34e575d4c65b11ea0a4e125c1abf4d3b2c65f Mon Sep 17 00:00:00 2001 From: jervfors Date: Tue, 7 Feb 2006 02:54:08 +0000 Subject: [PATCH] Moving the links "Download this as a file" and "View Unsafe Images" to the "Options" field, where they belong. This has also been requested at the mailing lists. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10655 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 12 +++++++----- src/read_body.php | 8 +++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index d8ab3cbd..6fb01e01 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -334,7 +334,8 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma * order that is their priority. */ global $startMessage, $languages, $squirrelmail_language, - $show_html_default, $sort, $has_unsafe_images, $passed_ent_id, $use_iframe,$iframe_height; + $show_html_default, $sort, $has_unsafe_images, $passed_ent_id, + $use_iframe, $iframe_height, $download_and_unsafe_link; // workaround for not updated config.php if (! isset($use_iframe)) $use_iframe = false; @@ -445,13 +446,15 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma return $body; } + $download_and_unsafe_link = ''; + $link = 'passed_id=' . $id . '&ent_id='.$ent_num. '&mailbox=' . $urlmailbox .'&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0'; if (isset($passed_ent_id)) { $link .= '&passed_ent_id='.$passed_ent_id; } - $body .= '
' . _("Download this as a file") . ''; if ($view_unsafe_images) { $text = _("Hide Unsafe Images"); @@ -464,9 +467,8 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma } } if($text != '') { - $body .= ' | ' . $text . ''; + $download_and_unsafe_link .= ' | ' . $text . ''; } - $body .= '

' . "\n"; } return $body; } @@ -2378,4 +2380,4 @@ function SendDownloadHeaders($type0, $type1, $filename, $force, $filesize=0) { } // end fn SendDownloadHeaders -?> +?> \ No newline at end of file diff --git a/src/read_body.php b/src/read_body.php index bd9ce69b..65e74c7c 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -681,7 +681,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed } function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) { - global $base_uri, $where, $what; + global $base_uri, $where, $what, $download_and_unsafe_link; $urlMailbox = urlencode($mailbox); $urlPassed_id = urlencode($passed_id); @@ -708,6 +708,12 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) { $s .= ' | ' . printer_friendly_link($mailbox, $passed_id, $passed_ent_id); echo $s; + + /* Output the download and/or unsafe images link/-s, if any. */ + if ($download_and_unsafe_link) { + echo $download_and_unsafe_link; + } + do_hook("read_body_header_right"); $s = "\n" . "\n"; -- 2.25.1